The Earnings API provides access to historical earnings data, earnings trends, index trends, and detailed earnings reports.
Get Earnings History
Retrieve historical earnings data for a company.
const history = await axion.earnings.history('AAPL');
Historical earnings data including EPS and revenue for past quarters
Get Earnings Trend
Retrieve earnings trend data showing estimates and actuals.
const trend = await axion.earnings.trend('AAPL');
Earnings trend data including analyst estimates and historical performance
Get Earnings Index
Retrieve earnings index trend data.
const index = await axion.earnings.index('AAPL');
Earnings index trend data
Get Earnings Report
Retrieve a detailed earnings report for a specific quarter.
const report = await axion.earnings.report('AAPL', {
year: '2024',
quarter: 'Q1'
});
The year of the earnings report (e.g., ‘2024’)
The quarter of the earnings report (e.g., ‘Q1’, ‘Q2’, ‘Q3’, ‘Q4’)
Detailed earnings report for the specified quarter including revenue, EPS, and guidance
Example Usage
Here’s a complete example showing how to analyze earnings data:
import { Axion } from 'axion-sdk';
const axion = new Axion('your-api-key');
async function analyzeEarnings(ticker: string) {
try {
// Get historical earnings
const history = await axion.earnings.history(ticker);
console.log('Earnings History:', history.data);
// Get earnings trend and estimates
const trend = await axion.earnings.trend(ticker);
console.log('Analyst Estimates:', trend.data);
// Get specific quarterly report
const report = await axion.earnings.report(ticker, {
year: '2024',
quarter: 'Q1'
});
console.log('Q1 2024 Report:', report.data);
// Get earnings index
const index = await axion.earnings.index(ticker);
console.log('Earnings Index:', index.data);
} catch (error) {
console.error('Error fetching earnings data:', error);
}
}
analyzeEarnings('AAPL');
Tracking Multiple Quarters
You can track earnings across multiple quarters:
async function trackQuarterlyEarnings(ticker: string) {
const quarters = ['Q1', 'Q2', 'Q3', 'Q4'];
const year = '2024';
for (const quarter of quarters) {
try {
const report = await axion.earnings.report(ticker, { year, quarter });
console.log(`${quarter} ${year}:`, report.data);
} catch (error) {
console.error(`Error fetching ${quarter} ${year}:`, error);
}
}
}
trackQuarterlyEarnings('AAPL');