Stock Earnings Premium
Get historical earnings per share data or a future earnings calendar for a stock.
Endpoint
https://api.marketdata.app/v1/stocks/earnings/{symbol}/
Method
GET
Request Example
- HTTP
- JavaScript
- TypeScript
- Python
- Go
- PHP
- Java
- Kotlin
- C#
import { MarketDataClient } from "@marketdata/sdk";
const client = new MarketDataClient();
try {
const earnings = await client.stocks.earnings("AAPL");
for (const e of earnings) {
console.log(
`FY${e.fiscalYear} Q${e.fiscalQuarter}: ` +
`reported=${e.reportedEPS} estimated=${e.estimatedEPS}`
);
}
} catch (error) {
console.error(error);
}
import { MarketDataClient } from "@marketdata/sdk";
import type { StockEarningsResponse } from "@marketdata/sdk";
const client = new MarketDataClient();
try {
const earnings: StockEarningsResponse = await client.stocks.earnings("AAPL");
for (const e of earnings) {
console.log(
`FY${e.fiscalYear} Q${e.fiscalQuarter}: ` +
`reported=${e.reportedEPS} estimated=${e.estimatedEPS}`
);
}
} catch (error) {
console.error(error);
}
from marketdata import MarketDataClient
client = MarketDataClient()
earnings = client.stocks.earnings("AAPL")
print(earnings)
import (
"fmt"
api "github.com/MarketDataApp/sdk-go"
)
func ExampleStockEarningsRequest() {
earningsReports, err := StockEarnings().Symbol("AAPL").Get()
if err != nil {
fmt.Print(err)
return
}
for _, report := range earningsReports {
fmt.Println(report)
}
}
use MarketDataApp\Client;
$client = new Client();
$earnings = $client->stocks->earnings(symbol: "AAPL");
// Display formatted earnings summary
echo $earnings;
import com.marketdata.sdk.MarketDataClient;
import com.marketdata.sdk.stocks.StockEarningsRequest;
try (MarketDataClient client = new MarketDataClient()) {
client.stocks().earnings(StockEarningsRequest.of("AAPL")).values().forEach(System.out::println);
}
import com.marketdata.sdk.MarketDataClient
import com.marketdata.sdk.stocks.StockEarningsRequest
MarketDataClient().use { client ->
client.stocks().earnings(StockEarningsRequest.of("AAPL")).values().forEach(::println)
}
using MarketDataApp;
using var client = await MarketDataClient.CreateAsync();
foreach (var report in (await client.Stocks.GetEarningsAsync("AAPL")).Values)
{
Console.WriteLine(report);
}
A request without from, to or date returns only upcoming reports: from today through the next three years. For past reports, set from and to, or date for a single day.
Response Example
{
"s": "ok",
"symbol": ["AAPL"],
"fiscalYear": [2027],
"fiscalQuarter": [1],
"date": [1798693200],
"reportDate": [1801112400],
"reportTime": ["after close"],
"currency": ["USD"],
"reportedEPS": [null],
"estimatedEPS": [2.9],
"surpriseEPS": [null],
"surpriseEPSpct": [null],
"updated": [1793941200]
}
The example is the upcoming report that the request above returns. A past report has the same fields, with the reported EPS and the surprise filled in.
Request Parameters
- Required
- Optional
-
symbol
stringThe company's ticker symbol.
-
from
dateThe earliest earnings report to include in the output. If you use countback,
fromis not required. Withoutfrom,toanddate, the output starts today and includes only upcoming reports. Accepted timestamp inputs: ISO 8601, unix, spreadsheet. -
to
dateThe latest earnings report to include in the output. Accepted timestamp inputs: ISO 8601, unix, spreadsheet.
-
countback
numberCountback will fetch a specific number of earnings reports before
to. If you usefrom, countback is not required. Withoutto, countback counts back from the end of the default window, so it returns only upcoming reports. For the latest past reports, settoto today's date. -
date
dateRetrieve a specific earnings report by date. Accepted timestamp inputs: ISO 8601, unix, spreadsheet.
Response Attributes
- Success
- No Data
- Error
-
s
stringWill always be
okwhen there is data for the symbol requested. -
symbol
array[string]The symbol of the stock.
-
fiscalYear
array[number]The fiscal year of the earnings report. This may not always align with the calendar year.
-
fiscalQuarter
array[number]The fiscal quarter of the earnings report. This may not always align with the calendar quarter.
-
date
array[date]The last calendar day that corresponds to this earnings report.
-
reportDate
array[date]The date the earnings report was released or is projected to be released.
Estimated Dates for Future EarningsFor upcoming earnings events, the
reportDateis an estimate based on historical reporting patterns and is not a confirmed date. These dates frequently change as companies update their reporting schedules. Only after a company has actually reported its earnings does thereportDatebecome a confirmed, historical data point. Do not make trading decisions based on estimated future earnings dates. -
reportTime
array[string]The value will be either
before open,after close, orduring market hours. It can benull. -
currency
array[string]The currency of the earnings report.
-
reportedEPS
array[number]The earnings per share reported by the company. Earnings reported are typically non-GAAP unless the company does not report non-GAAP earnings.
nullfor an upcoming report.tipGAAP (Generally Accepted Accounting Principles) earnings per share (EPS) count all financial activities except for discontinued operations and major changes in accounting methods. Non-GAAP EPS, on the other hand, typically doesn't include losses or devaluation of assets, and often leaves out irregular expenses like significant restructuring costs, large tax or legal charges, especially for companies not in the financial sector.
-
estimatedEPS
array[number]The average consensus estimate by Wall Street analysts.
nullwhen no consensus estimate is available. -
surpriseEPS
array[number]The difference (in earnings per share) between the estimated earnings per share and the reported earnings per share.
nullwhenreportedEPSisnull. -
surpriseEPSpct
array[number]The difference in percentage terms between the estimated EPS and the reported EPS, expressed as a decimal. For example, if the estimated EPS is 1.00 and the reported EPS is 1.20, the surpriseEPSpct would be 0.20 (or 20%).
nullwhenreportedEPSisnull. -
updated
array[date]The date/time the earnings data for this ticker was last updated.
-
s
stringStatus will be
no_dataif no earnings data can be found for the symbol. For a request without dates, this means that no upcoming report is known for the symbol: for example funds and ETFs, which do not report earnings.
-
s
stringStatus will be
errorif the request produces an error response. -
errmsg
stringAn error message.
Usage Information
Data Availability
This endpoint provides historical earnings data and future earnings calendar information. Earnings data is fundamental data that is updated after companies report their quarterly and annual results.
| User Type | Exchange Entitlement | Data Type |
|---|---|---|
| All Users | Not Required | Historical/Fundamental |
Pricing
The cost of using the earnings API endpoint is 1 credit per API call.
| Data Type | Cost Basis | Credits Required per Unit |
|---|---|---|
| Earnings Data | Per API call | 1 credit |