
Earnings Calendar
- 1.1k installs
- 2.5k repo stars
- Updated July 26, 2026
- tradermonty/claude-trading-skills
earnings-calendar is an agent skill that pulls structured upcoming earnings data for any week via the FMP API for developers who need mid-cap-and-above market event scans inside Claude or Cursor.
About
earnings-calendar in tradermonty/claude-trading-skills fetches structured upcoming earnings reports for a configurable week using the FMP API with mid-cap and above coverage above $2 billion market cap. Generated reports include an executive summary with total companies reporting, mega and large cap counts above $10 billion, mid cap counts between $2 billion and $10 billion, and peak reporting day. Daily sections split before-market-open tickers into tables with ticker, company, market cap, sector, EPS estimate, and revenue estimate columns across a 7-day coverage window. Developers reach for earnings-calendar when scanning market-moving events before trading sessions, macro research, or correlating product launches with sector earnings clusters. The skill formats output as markdown tables agents can paste into research notes or dashboards. Data source attribution to FMP API is explicit in the report header. Triggers include upcoming earnings week, FMP earnings calendar, BMO earnings table, and market cap filtered earnings scan.
- Pulls next-7-day earnings for mid-cap and larger companies (> $2B market cap)
- Groups events by Before Market Open, After Market Close, and Time Not Announced
- Includes ticker, company name, market cap, sector, EPS estimate and revenue estimate
- Delivers executive summary with total count, large-cap count, mid-cap count and peak day
- Outputs ready-to-use markdown calendar that can be referenced by other trading or research agents
Earnings Calendar by the numbers
- 1,070 all-time installs (skills.sh)
- +46 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #132 of 1,136 Finance & Trading skills by installs in the Skillselion catalog
- Security screen: HIGH risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/tradermonty/claude-trading-skills --skill earnings-calendarAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1.1k |
|---|---|
| repo stars | ★ 2.5k |
| Security audit | 2 / 3 scanners passed |
| Last updated | July 26, 2026 |
| Repository | tradermonty/claude-trading-skills ↗ |
How do you fetch upcoming earnings from FMP API?
Pull structured upcoming earnings data for any week directly into Claude or Cursor so they can quickly scan market-moving events before making product or co
Who is it for?
Developers and quantitative analysts who need agent-generated weekly earnings calendars from FMP API with mid-cap-and-above market cap filters.
Skip if: Real-time intraday trade execution, fundamental deep-dive on single tickers, or teams without FMP API access.
When should I use this skill?
User asks for upcoming earnings calendar, FMP earnings this week, BMO earnings table, or market-moving events above $2B market cap.
What you get
Markdown earnings calendar with executive summary, daily BMO tables, EPS and revenue estimates, and market-cap segmentation.
- Weekly earnings markdown report
- BMO ticker tables
- Market-cap segmented executive summary
By the numbers
- Covers 7-day earnings reporting windows via FMP API
- Filters companies above $2B market cap with $10B large-cap segmentation
Files
Earnings Calendar
Overview
This skill retrieves upcoming earnings announcements for US stocks using the Financial Modeling Prep (FMP) API. It focuses on companies with significant market capitalization (mid-cap and above, over $2B) that are likely to impact market movements. The skill generates organized markdown reports showing which companies are reporting earnings over the next week, grouped by date and timing (before market open, after market close, or time not announced).
Key Features:
- Uses FMP API for reliable, structured earnings data
- Filters by market cap (>$2B) to focus on market-moving companies
- Includes EPS and revenue estimates
- Multi-environment support (CLI, Desktop, Web)
- Flexible API key management
- Organized by date, timing, and market cap
Prerequisites
FMP API Key
This skill requires a Financial Modeling Prep API key.
Get Free API Key: 1. Visit: https://site.financialmodelingprep.com/developer/docs 2. Sign up for free account 3. Receive API key immediately 4. Free tier: 250 API calls/day (sufficient for weekly earnings calendar)
API Key Setup by Environment:
Claude Code (CLI):
export FMP_API_KEY="your-api-key-here"Claude Desktop: Set environment variable in system or configure MCP server.
Claude Web: API key will be requested during skill execution (stored only for current session).
Core Workflow
Step 1: Get Current Date and Calculate Target Week
CRITICAL: Always start by obtaining the accurate current date.
Retrieve the current date and time:
- Use system date/time to get today's date
- Note: "Today's date" is provided in the environment (<env> tag)
- Calculate the target week: Next 7 days from current date
Date Range Calculation:
Current Date: [e.g., November 2, 2025]
Target Week Start: [Current Date + 1 day, e.g., November 3, 2025]
Target Week End: [Current Date + 7 days, e.g., November 9, 2025]Why This Matters:
- Earnings calendars are time-sensitive
- "Next week" must be calculated from the actual current date
- Provides accurate date range for API request
Format dates in YYYY-MM-DD for API compatibility.
Step 2: Load FMP API Guide
Before retrieving data, load the comprehensive FMP API guide:
Read: references/fmp_api_guide.mdThis guide contains:
- FMP API endpoint structure and parameters
- Authentication requirements
- Market cap filtering strategy (via Company Profile API)
- Earnings timing conventions (BMO, AMC, TAS)
- Response format and field descriptions
- Error handling strategies
- Best practices and optimization tips
Step 3: API Key Detection and Configuration
Detect API key availability based on environment.
Multi-Environment API Key Detection:
3.1 Check Environment Variable (CLI/Desktop)
if [ ! -z "$FMP_API_KEY" ]; then
echo "✓ API key found in environment"
API_KEY=$FMP_API_KEY
fiIf environment variable is set, proceed to Step 4.
3.2 Prompt User for API Key (Desktop/Web)
If environment variable not found, use AskUserQuestion tool:
Question Configuration:
Question: "This skill requires an FMP API key to retrieve earnings data. Do you have an FMP API key?"
Header: "API Key"
Options:
1. "Yes, I'll provide it now" → Proceed to 3.3
2. "No, get free key" → Show instructions (3.2.1)
3. "Skip API, use manual entry" → Jump to Step 8 (fallback mode)3.2.1 If user chooses "No, get free key":
Provide instructions:
To get a free FMP API key:
1. Visit: https://site.financialmodelingprep.com/developer/docs
2. Click "Get Free API Key" or "Sign Up"
3. Create account (email + password)
4. Receive API key immediately
5. Free tier includes 250 API calls/day (sufficient for daily use)
Once you have your API key, please select "Yes, I'll provide it now" to continue.3.3 Request API Key Input
If user has API key, request input:
Prompt:
Please paste your FMP API key below:
(Your API key will only be stored for this conversation session and will be forgotten when the session ends. For regular use, consider setting the FMP_API_KEY environment variable.)Store API key in session variable:
API_KEY = [user_input]Confirm with user:
✓ API key received and stored for this session.
Security Note:
- API key is stored only in current conversation context
- Not saved to disk or persistent storage
- Will be forgotten when session ends
- Do not share this conversation if it contains your API key
Proceeding with earnings data retrieval...Step 4: Retrieve Earnings Data via FMP API
Use the Python script to fetch earnings data from FMP API.
Script Location:
scripts/fetch_earnings_fmp.pyExecution:
Option A: With Environment Variable (CLI):
python scripts/fetch_earnings_fmp.py 2025-11-03 2025-11-09Option B: With Session API Key (Desktop/Web):
python scripts/fetch_earnings_fmp.py 2025-11-03 2025-11-09 "${API_KEY}"Script Workflow (automatic): 1. Validates API key and date parameters 2. Calls FMP Earnings Calendar API for date range 3. Fetches company profiles (market cap, sector, industry) 4. Filters companies with market cap >$2B 5. Normalizes timing (BMO/AMC/TAS) 6. Sorts by date → timing → market cap (descending) 7. Outputs JSON to stdout
Expected Output Format (JSON):
[
{
"symbol": "AAPL",
"companyName": "Apple Inc.",
"date": "2025-11-04",
"timing": "AMC",
"marketCap": 3000000000000,
"marketCapFormatted": "$3.0T",
"sector": "Technology",
"industry": "Consumer Electronics",
"epsEstimated": 1.54,
"revenueEstimated": 123400000000,
"fiscalDateEnding": "2025-09-30",
"exchange": "NASDAQ"
},
...
]Save to file (recommended for use with report generator):
python scripts/fetch_earnings_fmp.py 2025-11-03 2025-11-09 "${API_KEY}" > earnings_data.jsonOr capture to variable:
earnings_data=$(python scripts/fetch_earnings_fmp.py 2025-11-03 2025-11-09 "${API_KEY}")Error Handling:
If script returns errors:
- 401 Unauthorized: Invalid API key → Verify key or re-enter
- 429 Rate Limit: Exceeded 250 calls/day → Wait or upgrade plan
- Empty Result: No earnings in date range → Expand date range or note in report
- Connection Error: Network issue → Retry or use cached data if available
Step 5: Process and Organize Data
Once earnings data is retrieved (JSON format), process and organize it:
5.1 Parse JSON Data
Load JSON data from script output:
import json
earnings_data = json.loads(earnings_json_string)Or if saved to file:
with open('earnings_data.json', 'r') as f:
earnings_data = json.load(f)5.2 Verify Data Structure
Confirm data includes required fields:
- ✓ symbol
- ✓ companyName
- ✓ date
- ✓ timing (BMO/AMC/TAS)
- ✓ marketCap
- ✓ sector
5.3 Group by Date
Group all earnings announcements by date:
- Sunday, [Full Date] (if applicable)
- Monday, [Full Date]
- Tuesday, [Full Date]
- Wednesday, [Full Date]
- Thursday, [Full Date]
- Friday, [Full Date]
- Saturday, [Full Date] (if applicable)
5.4 Sub-Group by Timing
Within each date, create three sub-sections: 1. Before Market Open (BMO) 2. After Market Close (AMC) 3. Time Not Announced (TAS)
Data is already sorted by timing from the script, so maintain this order.
5.5 Within Each Timing Group
Companies are already sorted by market cap descending (script output):
- Mega-cap (>$200B) first
- Large-cap ($10B-$200B) second
- Mid-cap ($2B-$10B) third
This prioritization ensures the most market-moving companies are listed first.
5.6 Calculate Summary Statistics
Compute:
- Total Companies: Count of all companies in dataset
- Mega/Large Cap Count: Count where marketCap >= $10B
- Mid Cap Count: Count where marketCap between $2B and $10B
- Peak Day: Day of week with most earnings announcements
- Sector Distribution: Count by sector (Technology, Healthcare, Financial, etc.)
- Highest Market Cap Companies: Top 5 companies by market cap
Step 6: Generate Markdown Report
Use the report generation script to create a formatted markdown report from the JSON data.
Script Location:
scripts/generate_report.pyExecution:
Option A: Output to stdout:
python scripts/generate_report.py earnings_data.jsonOption B: Save to file:
python scripts/generate_report.py earnings_data.json earnings_calendar_2025-11-02.mdWhat the script does: 1. Loads earnings data from JSON file 2. Groups by date and timing (BMO/AMC/TAS) 3. Sorts by market cap within each group 4. Calculates summary statistics 5. Generates formatted markdown report 6. Outputs to stdout or saves to file
The script automatically handles all formatting including:
- Proper markdown table structure
- Date grouping and day names
- Market cap sorting
- EPS and revenue formatting
- Summary statistics calculation
Report Structure:
# Upcoming Earnings Calendar - Week of [START_DATE] to [END_DATE]
**Report Generated**: [Current Date]
**Data Source**: FMP API (Mid-cap and above, >$2B market cap)
**Coverage Period**: Next 7 days
**Total Companies**: [COUNT]
---
## Executive Summary
- **Total Companies Reporting**: [TOTAL_COUNT]
- **Mega/Large Cap (>$10B)**: [LARGE_CAP_COUNT]
- **Mid Cap ($2B-$10B)**: [MID_CAP_COUNT]
- **Peak Day**: [DAY_WITH_MOST_EARNINGS]
---
## [Day Name], [Full Date]
### Before Market Open (BMO)
| Ticker | Company | Market Cap | Sector | EPS Est. | Revenue Est. |
|--------|---------|------------|--------|----------|--------------|
| [TICKER] | [COMPANY] | [MCAP] | [SECTOR] | [EPS] | [REV] |
### After Market Close (AMC)
| Ticker | Company | Market Cap | Sector | EPS Est. | Revenue Est. |
|--------|---------|------------|--------|----------|--------------|
| [TICKER] | [COMPANY] | [MCAP] | [SECTOR] | [EPS] | [REV] |
### Time Not Announced (TAS)
| Ticker | Company | Market Cap | Sector | EPS Est. | Revenue Est. |
|--------|---------|------------|--------|----------|--------------|
| [TICKER] | [COMPANY] | [MCAP] | [SECTOR] | [EPS] | [REV] |
---
[Repeat for each day of week]
---
## Key Observations
### Highest Market Cap Companies This Week
1. [COMPANY] ([TICKER]) - [MCAP] - [DATE] [TIME]
2. [COMPANY] ([TICKER]) - [MCAP] - [DATE] [TIME]
3. [COMPANY] ([TICKER]) - [MCAP] - [DATE] [TIME]
### Sector Distribution
- **Technology**: [COUNT] companies
- **Healthcare**: [COUNT] companies
- **Financial**: [COUNT] companies
- **Consumer**: [COUNT] companies
- **Other**: [COUNT] companies
### Trading Considerations
- **Days with Heavy Volume**: [DATES with multiple large-cap earnings]
- **Pre-Market Focus**: [BMO companies that may move markets]
- **After-Hours Focus**: [AMC companies that may move markets]
---
## Timing Reference
- **BMO (Before Market Open)**: Announcements typically around 6:00-8:00 AM ET before market opens at 9:30 AM ET
- **AMC (After Market Close)**: Announcements typically around 4:00-5:00 PM ET after market closes at 4:00 PM ET
- **TAS (Time Not Announced)**: Specific time not yet disclosed - monitor company investor relations
---
## Data Notes
- **Market Cap Categories**:
- Mega Cap: >$200B
- Large Cap: $10B-$200B
- Mid Cap: $2B-$10B
- **Filter Criteria**: This report includes companies with market cap $2B and above (mid-cap+) with earnings scheduled for the next week.
- **Data Source**: Financial Modeling Prep (FMP) API
- **Data Freshness**: Earnings dates and times can change. Verify critical dates through company investor relations websites for the most current information.
- **EPS and Revenue Estimates**: Analyst consensus estimates from FMP API. Actual results will be reported on earnings date.
---
## Additional Resources
- **FMP API Documentation**: https://site.financialmodelingprep.com/developer/docs
- **Seeking Alpha Calendar**: https://seekingalpha.com/earnings/earnings-calendar
- **Yahoo Finance Calendar**: https://finance.yahoo.com/calendar/earnings
---
*Report generated using FMP Earnings Calendar API with mid-cap+ filter (>$2B market cap). Data current as of report generation time. Always verify earnings dates through official company sources.*Formatting Best Practices:
- Use markdown tables for clean presentation
- Bold important company names (mega-cap) if desired
- Include market cap in human-readable format ($3.0T, $150B, $5.2B) - already formatted by script
- Group logically by date then timing
- Include summary section at top for quick overview
- Add EPS and revenue estimates if available
Step 7: Quality Assurance
Before finalizing the report, verify:
Data Quality Checks: 1. ✓ All dates fall within the target week (next 7 days) 2. ✓ Market cap values are present for all companies 3. ✓ Each company has timing specified (BMO/AMC/TAS) 4. ✓ Companies are sorted by market cap within each section 5. ✓ Summary statistics are accurate 6. ✓ Report generation date is clearly stated 7. ✓ EPS and revenue estimates included where available
Completeness Checks: 1. ✓ All days of the target week are included (even if no earnings) 2. ✓ Major known companies are not missing (verify against external sources if needed) 3. ✓ Sector information is included where available 4. ✓ Timing reference section is present 5. ✓ Data sources are credited (FMP API)
Format Checks: 1. ✓ Markdown tables are properly formatted 2. ✓ Dates are consistently formatted 3. ✓ Market caps use consistent units (B for billions, T for trillions) 4. ✓ All sections follow template structure 5. ✓ No placeholder text ([PLACEHOLDER]) remains 6. ✓ EPS and revenue estimates properly formatted
Step 8: Save and Deliver Report
Save the generated report with an appropriate filename:
Filename Convention:
earnings_calendar_[YYYY-MM-DD].mdExample: earnings_calendar_2025-11-02.md
The filename date represents the report generation date, not the earnings week.
Delivery:
- Save the markdown file to the working directory
- Inform the user that the report has been generated
- Provide a brief summary of key findings (e.g., "45 companies reporting next week, with Apple and Microsoft on Monday")
Example Summary:
✓ Earnings calendar report generated: earnings_calendar_2025-11-02.md
Summary for week of November 3-9, 2025:
- 45 companies reporting earnings
- 28 large/mega-cap, 17 mid-cap
- Peak day: Thursday (15 companies)
- Notable: Apple (Mon AMC), Microsoft (Tue AMC), Tesla (Wed AMC)
Top 5 by market cap:
1. Apple - $3.0T (Mon AMC)
2. Microsoft - $2.8T (Tue AMC)
3. Alphabet - $1.8T (Thu AMC)
4. Amazon - $1.6T (Fri AMC)
5. Tesla - $800B (Wed AMC)Fallback Mode (Step 8 Alternative): Manual Data Entry
If API access is unavailable or user chooses to skip API:
Provide Instructions for Manual Entry:
Since FMP API is not available, you can manually gather earnings data:
1. Visit Finviz: https://finviz.com/screener.ashx?v=111&f=cap_midover%2Cearningsdate_nextweek
2. Or Yahoo Finance: https://finance.yahoo.com/calendar/earnings
3. Note down companies reporting next week
Please provide the following information for each company:
- Ticker symbol
- Company name
- Earnings date
- Timing (BMO/AMC/TAS)
- Market cap (approximate)
- Sector
I will format this into the standard earnings calendar report.Process Manual Input: 1. Parse user-provided earnings data 2. Organize by date, timing, and market cap 3. Generate report using same template 4. Note in report: "Data Source: Manual Entry"
Use Cases and Examples
Use Case 1: Weekly Review (Primary Use Case)
User Request: "Get next week's earnings calendar"
Workflow: 1. Get current date (e.g., November 2, 2025) 2. Calculate target week (November 3-9, 2025) 3. Load FMP API guide 4. Detect/request API key 5. Fetch earnings data:
python scripts/fetch_earnings_fmp.py 2025-11-03 2025-11-09 > earnings_data.json6. Generate markdown report:
python scripts/generate_report.py earnings_data.json earnings_calendar_2025-11-02.md7. Notify user with summary
Complete One-Liner:
python scripts/fetch_earnings_fmp.py 2025-11-03 2025-11-09 > earnings_data.json && \
python scripts/generate_report.py earnings_data.json earnings_calendar_2025-11-02.mdUse Case 2: Focused on Specific Day
User Request: "What earnings are coming out Monday?"
Workflow: 1. Get current date and identify next Monday (e.g., November 4, 2025) 2. Fetch full week data (same as Use Case 1) 3. Generate full report but highlight Monday section 4. Provide verbal summary of Monday's earnings with emphasis
Use Case 3: Mega-Cap Focus
User Request: "Show me earnings for companies over $100B market cap next week"
Workflow: 1. Fetch full earnings data (script already filters >$2B) 2. Process and organize as normal 3. When generating report, add a "Mega-Cap Focus" section at top 4. Filter tables to show only companies >$100B 5. Note: Still include full data in appendix for reference
Use Case 4: Sector-Specific
User Request: "What tech companies have earnings next week?"
Workflow: 1. Fetch full earnings data 2. Process and organize as normal 3. Filter results by sector = "Technology" 4. Generate report with focus on technology sector 5. Note: Template structure remains the same; content is filtered
Troubleshooting
Problem: API key not working
Solutions:
- Verify API key is correct (copy-paste carefully)
- Check if API key is active (login to FMP dashboard)
- Ensure no extra spaces before/after key
- Try generating new API key from FMP dashboard
Problem: Script returns empty results
Solutions:
- Verify date range is in future (not past dates)
- Check date format is YYYY-MM-DD
- Try wider date range (e.g., 14 days instead of 7)
- Verify companies actually have announced earnings dates for that week
Problem: Missing major companies
Solutions:
- Company may not have announced earnings date yet
- Some companies announce dates very late (1-2 days before)
- Cross-reference with company investor relations website
- Market cap may have dropped below $2B threshold
Problem: Rate limit hit (429 error)
Solutions:
- Free tier: 250 calls/day
- Each weekly report uses ~3-5 API calls
- Check if other tools/scripts are using same API key
- Wait 24 hours for rate limit reset
- Consider upgrading to paid tier if needed frequently
Problem: Script execution error
Solutions:
- Verify Python 3 is installed:
python3 --version - Install requests library:
pip install requests - Check script has execute permissions:
chmod +x fetch_earnings_fmp.py - Run with python3 explicitly:
python3 fetch_earnings_fmp.py ...
Best Practices
Do's
✓ Always get current date first before any data retrieval ✓ Use FMP API as primary source for reliability ✓ Store API key in environment variable for CLI usage ✓ Sort by market cap to prioritize high-impact companies ✓ Group by date then timing for logical organization ✓ Include summary statistics for quick overview ✓ Credit data sources in report footer ✓ Use clean markdown tables for readability ✓ Provide timing reference section for clarity ✓ Note data freshness and potential for changes ✓ Include EPS and revenue estimates when available
Don'ts
✗ Don't assume "next week" without calculating from current date ✗ Don't omit timing information (BMO/AMC/TAS) ✗ Don't mix date formats within report (stay consistent) ✗ Don't include micro/small-cap unless specifically requested ✗ Don't forget to sort by market cap within sections ✗ Don't share API key in conversations or reports ✗ Don't include earnings from current week or past dates ✗ Don't generate report without quality assurance checks ✗ Don't commit API keys to version control
Security Notes
API Key Security
Important Reminders: 1. ✓ Use free tier API keys for testing 2. ✓ Rotate keys regularly 3. ✓ Don't share conversations containing API keys 4. ✓ Set API key as environment variable for CLI 5. ✓ Keys provided in chat are session-only (forgotten after session ends) 6. ✗ Never commit API keys to Git repositories 7. ✗ Never use production API keys with sensitive data access
Best Practice: For Claude Code (CLI), always use environment variable:
# Add to ~/.zshrc or ~/.bashrc
export FMP_API_KEY="your-key-here"For Claude Web, understand that:
- API key entered in chat is temporary
- Stored only in conversation context
- Not saved to disk
- Forgotten when session ends
Resources
FMP API:
- Main Documentation: https://site.financialmodelingprep.com/developer/docs
- Get API Key: https://site.financialmodelingprep.com/developer/docs
- Earnings Calendar API: https://site.financialmodelingprep.com/developer/docs/earnings-calendar-api
- Company Profile API: https://site.financialmodelingprep.com/developer/docs/companies-key-metrics-api
- Pricing/Rate Limits: https://site.financialmodelingprep.com/developer/docs/pricing
Supplementary Sources (for verification):
- Seeking Alpha: https://seekingalpha.com/earnings/earnings-calendar
- Yahoo Finance: https://finance.yahoo.com/calendar/earnings
- MarketWatch: https://www.marketwatch.com/tools/earnings-calendar
Skill Resources:
- FMP API Guide:
references/fmp_api_guide.md - Python Script:
scripts/fetch_earnings_fmp.py - Report Template:
assets/earnings_report_template.md
---
Summary
This skill provides a reliable, API-driven approach to generating weekly earnings calendars for US stocks. By using FMP API, it ensures structured, accurate data with additional insights like EPS/revenue estimates. The multi-environment support makes it flexible for CLI, Desktop, and Web usage, while the fallback mode ensures functionality even without API access.
Key Workflow: Date Calculation → API Key Setup → API Data Retrieval → Processing → Report Generation → QA → Delivery
Output: Clean, organized markdown report with earnings grouped by date/timing/market cap, including summary statistics and trading considerations.
Upcoming Earnings Calendar - Week of [START_DATE] to [END_DATE]
Report Generated: [CURRENT_DATE] Data Source: FMP API (Mid-cap and above, >$2B market cap) Coverage Period: Next 7 days
---
Executive Summary
- Total Companies Reporting: [TOTAL_COUNT]
- Mega/Large Cap (>$10B): [LARGE_CAP_COUNT]
- Mid Cap ($2B-$10B): [MID_CAP_COUNT]
- Peak Day: [DAY_WITH_MOST_EARNINGS]
---
[DAY_NAME], [FULL_DATE]
Before Market Open (BMO)
| Ticker | Company | Market Cap | Sector | EPS Est. | Revenue Est. |
|---|---|---|---|---|---|
| [TICKER] | [COMPANY_NAME] | [MARKET_CAP] | [SECTOR] | [EPS_EST] | [REV_EST] |
| [TICKER] | [COMPANY_NAME] | [MARKET_CAP] | [SECTOR] | [EPS_EST] | [REV_EST] |
After Market Close (AMC)
| Ticker | Company | Market Cap | Sector | EPS Est. | Revenue Est. |
|---|---|---|---|---|---|
| [TICKER] | [COMPANY_NAME] | [MARKET_CAP] | [SECTOR] | [EPS_EST] | [REV_EST] |
| [TICKER] | [COMPANY_NAME] | [MARKET_CAP] | [SECTOR] | [EPS_EST] | [REV_EST] |
Time Not Announced (TAS)
| Ticker | Company | Market Cap | Sector | EPS Est. | Revenue Est. |
|---|---|---|---|---|---|
| [TICKER] | [COMPANY_NAME] | [MARKET_CAP] | [SECTOR] | [EPS_EST] | [REV_EST] |
---
[NEXT_DAY_NAME], [NEXT_FULL_DATE]
[Repeat structure for each day of the week]
---
Key Observations
Highest Market Cap Companies This Week
1. [COMPANY_NAME] ([TICKER]) - [MARKET_CAP] - [DATE] [TIME] 2. [COMPANY_NAME] ([TICKER]) - [MARKET_CAP] - [DATE] [TIME] 3. [COMPANY_NAME] ([TICKER]) - [MARKET_CAP] - [DATE] [TIME]
Sector Distribution
- Technology: [COUNT] companies
- Healthcare: [COUNT] companies
- Financial: [COUNT] companies
- Consumer: [COUNT] companies
- Other: [COUNT] companies
Trading Considerations
- Days with Heavy Volume: [DATES with multiple large-cap earnings]
- Pre-Market Focus: [BMO companies that may move markets]
- After-Hours Focus: [AMC companies that may move markets]
---
Timing Reference
- BMO (Before Market Open): Announcements typically around 6:00-8:00 AM ET before market opens at 9:30 AM ET
- AMC (After Market Close): Announcements typically around 4:00-5:00 PM ET after market closes at 4:00 PM ET
- TAS (Time Not Announced): Specific time not yet disclosed - monitor company investor relations
---
Data Notes
- Market Cap Categories:
- Mega Cap: >$200B
- Large Cap: $10B-$200B
- Mid Cap: $2B-$10B
- Filter Criteria: This report includes companies with market cap $2B and above (mid-cap+) with earnings scheduled for the next week.
- Data Freshness: Earnings dates and times can change. Verify critical dates through company investor relations websites for the most current information.
- Missing Times: Companies showing "TAS" have not yet announced specific timing. Check for updates 24-48 hours before the earnings date.
- EPS and Revenue Estimates: Analyst consensus estimates from FMP API. Actual results will be reported on earnings date.
---
Additional Resources
- FMP API Documentation: https://site.financialmodelingprep.com/developer/docs
- Seeking Alpha Calendar: https://seekingalpha.com/earnings/earnings-calendar
- Yahoo Finance Calendar: https://finance.yahoo.com/calendar/earnings
---
Report generated using FMP Earnings Calendar API with mid-cap+ filter (>$2B market cap). Data current as of report generation time. Always verify earnings dates through official company sources.
FMP Earnings Calendar API Guide
This reference provides guidance on using the Financial Modeling Prep (FMP) Earnings Calendar API to retrieve upcoming earnings announcements for US stocks.
FMP API Overview
Financial Modeling Prep (FMP) provides a comprehensive financial data API with earnings calendar endpoints that return structured JSON data including announcement dates, EPS estimates, revenue estimates, and actual results for publicly traded companies.
Official Documentation: https://site.financialmodelingprep.com/developer/docs/earnings-calendar-api
API Endpoint
Earnings Calendar Endpoint:
https://financialmodelingprep.com/api/v3/earning_calendarAuthentication
FMP API requires an API key for authentication:
https://financialmodelingprep.com/api/v3/earning_calendar?apikey=YOUR_API_KEY&from=2025-11-03&to=2025-11-09Getting an API Key:
- Free tier: https://site.financialmodelingprep.com/developer/docs
- Sign up for free account
- Receive API key immediately
- Free tier: 250 API calls/day
Request Parameters
Required Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
apikey | string | Your FMP API key | YOUR_API_KEY |
from | date | Start date (YYYY-MM-DD) | 2025-11-03 |
to | date | End date (YYYY-MM-DD) | 2025-11-09 |
Constraints
- Maximum Records: 4000 records per request
- Maximum Date Range: 90 days
- Rate Limiting: Free tier = 250 calls/day, Premium = 750-2500 calls/day
- Date Format: YYYY-MM-DD (ISO 8601)
Example Request
curl "https://financialmodelingprep.com/api/v3/earning_calendar?apikey=YOUR_KEY&from=2025-11-03&to=2025-11-09"Response Format
JSON Structure
[
{
"symbol": "AAPL",
"date": "2025-11-04",
"eps": null,
"epsEstimated": 1.54,
"time": "amc",
"revenue": null,
"revenueEstimated": 123400000000,
"fiscalDateEnding": "2025-09-30",
"updatedFromDate": "2025-11-01"
},
{
"symbol": "MSFT",
"date": "2025-11-05",
"eps": null,
"epsEstimated": 2.75,
"time": "amc",
"revenue": null,
"revenueEstimated": 56200000000,
"fiscalDateEnding": "2025-09-30",
"updatedFromDate": "2025-11-02"
}
]Field Descriptions
| Field | Type | Description |
|---|---|---|
symbol | string | Stock ticker symbol |
date | string | Earnings announcement date (YYYY-MM-DD) |
eps | number/null | Actual EPS (null if not yet announced) |
epsEstimated | number | Estimated EPS by analysts |
time | string | Timing: "bmo" (before market open), "amc" (after market close), "tba" (to be announced) |
revenue | number/null | Actual revenue (null if not yet announced) |
revenueEstimated | number | Estimated revenue by analysts |
fiscalDateEnding | string | Fiscal period ending date |
updatedFromDate | string | Last update date for this entry |
Timing Conventions
BMO (Before Market Open)
- API value:
"bmo"or"pre-market" - Announced before US market opens at 9:30 AM ET
- Typically around 6:00-8:00 AM ET
- Impact: Provides time for market to digest before trading begins
AMC (After Market Close)
- API value:
"amc"or"after-market" - Announced after US market closes at 4:00 PM ET
- Typically around 4:00-5:00 PM ET
- Impact: Overnight reaction, gap up/down at next day's open
TBA (To Be Announced)
- API value:
"tba"ornull - Specific time not yet announced
- Could be BMO or AMC
- Monitor company investor relations for updates
Filtering by Market Cap
FMP API doesn't provide market cap in the earnings calendar endpoint. To filter by market cap:
Option 1: Use Company Profile API (Recommended)
Step 1: Get earnings calendar data
GET /api/v3/earning_calendar?apikey=KEY&from=2025-11-03&to=2025-11-09Step 2: For each symbol, fetch market cap from profile endpoint
GET /api/v3/profile/{symbol}?apikey=KEYResponse includes:
{
"symbol": "AAPL",
"companyName": "Apple Inc.",
"mktCap": 3000000000000,
"sector": "Technology",
"industry": "Consumer Electronics"
}Step 3: Filter companies with mktCap > 2000000000 ($2B+)
Option 2: Use Batch Profile API (More Efficient)
Request profiles for multiple symbols in one call:
GET /api/v3/profile/AAPL,MSFT,GOOGL,AMZN?apikey=KEYThis reduces API calls significantly.
Python Implementation Strategy
Basic Request
import requests
from datetime import datetime, timedelta
def fetch_earnings_calendar(api_key, start_date, end_date):
"""
Fetch earnings calendar from FMP API
Args:
api_key: FMP API key
start_date: Start date (YYYY-MM-DD)
end_date: End date (YYYY-MM-DD)
Returns:
List of earnings announcements
"""
url = "https://financialmodelingprep.com/api/v3/earning_calendar"
params = {
"apikey": api_key,
"from": start_date,
"to": end_date
}
response = requests.get(url, params=params)
response.raise_for_status()
return response.json()
# Usage
api_key = "YOUR_API_KEY"
earnings = fetch_earnings_calendar(api_key, "2025-11-03", "2025-11-09")With Market Cap Filtering
def fetch_company_profiles(api_key, symbols):
"""
Fetch company profiles for multiple symbols (batch)
Args:
api_key: FMP API key
symbols: List of ticker symbols
Returns:
Dictionary mapping symbol to profile data
"""
# Batch symbols (max 100 per request)
batch_size = 100
profiles = {}
for i in range(0, len(symbols), batch_size):
batch = symbols[i:i+batch_size]
symbols_str = ",".join(batch)
url = f"https://financialmodelingprep.com/api/v3/profile/{symbols_str}"
params = {"apikey": api_key}
response = requests.get(url, params=params)
response.raise_for_status()
for profile in response.json():
profiles[profile["symbol"]] = profile
return profiles
def filter_by_market_cap(earnings, profiles, min_market_cap=2000000000):
"""
Filter earnings by minimum market cap ($2B default)
Args:
earnings: List of earnings announcements
profiles: Dictionary of company profiles
min_market_cap: Minimum market cap in dollars
Returns:
Filtered list of earnings for mid-cap+ companies
"""
filtered = []
for earning in earnings:
symbol = earning["symbol"]
profile = profiles.get(symbol)
if profile and profile.get("mktCap", 0) >= min_market_cap:
# Merge earnings data with profile data
earning["marketCap"] = profile["mktCap"]
earning["companyName"] = profile.get("companyName", symbol)
earning["sector"] = profile.get("sector", "N/A")
earning["industry"] = profile.get("industry", "N/A")
filtered.append(earning)
return filtered
# Complete workflow
api_key = "YOUR_API_KEY"
# Step 1: Get earnings calendar
earnings = fetch_earnings_calendar(api_key, "2025-11-03", "2025-11-09")
# Step 2: Get company profiles
symbols = [e["symbol"] for e in earnings]
profiles = fetch_company_profiles(api_key, symbols)
# Step 3: Filter by market cap (>$2B)
filtered_earnings = filter_by_market_cap(earnings, profiles)API Key Management - Multi-Environment Support
Environment 1: Claude Code (CLI)
Set environment variable:
export FMP_API_KEY="your-api-key-here"Access in Python:
import os
api_key = os.environ.get('FMP_API_KEY')Environment 2: Claude Desktop
Configure MCP server settings or use environment variable in system.
Environment 3: Claude Web
API key cannot be stored persistently. Request from user during execution:
Workflow: 1. Check for environment variable 2. If not found, prompt user: "Please provide your FMP API key" 3. Store in session variable for current conversation 4. Use for all API calls in this session
Security Note:
- Key stored only in conversation context
- Forgotten when session ends
- User should use free tier or limited-scope keys
Error Handling
Common Errors
401 Unauthorized:
{
"Error Message": "Invalid API KEY. Please retry or visit our documentation to create one FREE https://site.financialmodelingprep.com/developer/docs"
}Solution: Verify API key is correct
429 Rate Limit Exceeded:
{
"Error Message": "Limit Reach. Please upgrade your plan or visit our documentation for more details at https://site.financialmodelingprep.com/developer/docs"
}Solution: Reduce API calls or upgrade plan
400 Bad Request:
- Invalid date format
- Date range exceeds 90 days
- Missing required parameters
Error Handling Code
def fetch_earnings_with_error_handling(api_key, start_date, end_date):
"""Fetch earnings with proper error handling"""
try:
url = "https://financialmodelingprep.com/api/v3/earning_calendar"
params = {
"apikey": api_key,
"from": start_date,
"to": end_date
}
response = requests.get(url, params=params, timeout=30)
# Check for API errors
if response.status_code == 401:
print("ERROR: Invalid API key")
print("Get free API key: https://site.financialmodelingprep.com/developer/docs")
return None
if response.status_code == 429:
print("ERROR: Rate limit exceeded")
print("Free tier: 250 calls/day. Consider upgrading.")
return None
response.raise_for_status()
data = response.json()
# Check if response is error message
if isinstance(data, dict) and "Error Message" in data:
print(f"API Error: {data['Error Message']}")
return None
return data
except requests.exceptions.Timeout:
print("ERROR: Request timeout. Please try again.")
return None
except requests.exceptions.ConnectionError:
print("ERROR: Connection error. Check your internet connection.")
return None
except Exception as e:
print(f"ERROR: Unexpected error: {str(e)}")
return NoneData Quality Considerations
Accuracy
- FMP data is generally reliable for earnings dates
- EPS and revenue estimates updated regularly from analyst consensus
- Companies can change dates last-minute; verify critical dates
Completeness
- Covers most US publicly traded companies
- Some smaller companies may have limited data
- Pre-IPO companies won't appear until trading begins
Timeliness
- API updated regularly throughout the day
- Earnings dates typically known 2-4 weeks in advance
- Some companies announce dates very close to earnings (1-2 days prior)
Data Freshness
- Check
updatedFromDatefield for last update timestamp - Estimates may change as earnings date approaches
- Time field (
bmo/amc/tba) may update closer to date
Best Practices
1. Calculate Date Range Accurately
Always get current date first:
from datetime import datetime, timedelta
today = datetime.now()
start_date = (today + timedelta(days=1)).strftime("%Y-%m-%d")
end_date = (today + timedelta(days=7)).strftime("%Y-%m-%d")2. Batch API Calls
Use batch endpoints to reduce API calls:
- Earnings calendar: One call for entire week
- Company profiles: Batch up to 100 symbols per call
3. Cache Results
For repeated analyses within same day:
import json
from pathlib import Path
def cache_earnings_data(data, cache_file="earnings_cache.json"):
"""Save earnings data to cache file"""
cache_path = Path(cache_file)
cache_path.write_text(json.dumps(data, indent=2))
def load_cached_data(cache_file="earnings_cache.json", max_age_hours=6):
"""Load cached data if recent enough"""
cache_path = Path(cache_file)
if not cache_path.exists():
return None
# Check cache age
cache_age = datetime.now() - datetime.fromtimestamp(cache_path.stat().st_mtime)
if cache_age.total_seconds() > max_age_hours * 3600:
return None
return json.loads(cache_path.read_text())4. Handle Missing Data Gracefully
def safe_get(data, key, default="N/A"):
"""Safely get value from dict with default"""
value = data.get(key)
return value if value is not None else default5. Sort and Prioritize by Market Cap
def sort_by_market_cap(earnings):
"""Sort earnings by market cap descending"""
return sorted(
earnings,
key=lambda x: x.get("marketCap", 0),
reverse=True
)API Call Optimization
Minimize API Calls
For a typical weekly earnings calendar: 1. Earnings Calendar API: 1 call (all week) 2. Company Profiles API: N/100 calls (where N = number of symbols)
Example:
- 200 companies reporting
- Profile API calls: 200/100 = 2 calls
- Total: 3 API calls (well within 250/day free limit)
Rate Limit Management
import time
def rate_limited_request(url, params, delay=0.1):
"""Make request with rate limiting"""
time.sleep(delay)
return requests.get(url, params=params)For free tier (250 calls/day):
- Per hour limit: ~10 calls/hour safe
- Add 0.5-1 second delay between calls if making many requests
Alternative Endpoints
For Real-Time Market Cap Data
Market Capitalization Endpoint:
GET /api/v3/market-capitalization/{symbol}?apikey=KEYReturns current market cap only (faster, but requires per-symbol calls).
For Historical Earnings Results
Historical Earnings Endpoint:
GET /api/v3/historical/earning_calendar/{symbol}?apikey=KEYReturns past earnings results with actual vs. estimated comparisons.
Comparison: FMP vs Other Data Sources
| Feature | FMP API | Finviz | Yahoo Finance |
|---|---|---|---|
| Access Method | REST API | Web Scraping | Web Scraping |
| Authentication | API Key | None | None |
| Data Format | JSON | HTML | HTML |
| Rate Limit | 250/day (free) | IP-based | IP-based |
| Reliability | High | Medium | Medium |
| Market Cap Filter | Via Profile API | Built-in | Manual |
| EPS Estimates | ✓ | ✗ | ✓ |
| Revenue Estimates | ✓ | ✗ | ✓ |
| Timing Info | ✓ | ✓ | ✓ |
| Historical Data | ✓ | ✗ | Limited |
| Free Tier | ✓ | ✓ | ✓ |
Recommendation: FMP API is the most reliable and structured option for programmatic access.
Troubleshooting
Problem: API returns empty array
Solutions:
- Verify date range is valid (future dates)
- Check date format is YYYY-MM-DD
- Verify API key is active
- Try wider date range (e.g., +14 days instead of +7)
Problem: Some major companies missing
Solutions:
- Company may not have announced earnings date yet
- Some companies announce dates very late (1-2 days before)
- Cross-reference with company investor relations website
- Check if company is on earnings date hold
Problem: Market cap data missing
Solutions:
- Company profile may not be available
- Use alternative market cap endpoint
- Fall back to manual market cap lookup
- Some thinly traded stocks may lack profile data
Problem: Rate limit hit unexpectedly
Solutions:
- Check other scripts/tools using same API key
- Implement caching to reduce repeated calls
- Add delays between requests
- Consider upgrading to paid tier
Example Output Structure
After fetching and processing FMP data:
{
"symbol": "AAPL",
"companyName": "Apple Inc.",
"date": "2025-11-04",
"time": "amc",
"marketCap": 3000000000000,
"sector": "Technology",
"industry": "Consumer Electronics",
"epsEstimated": 1.54,
"revenueEstimated": 123400000000
}This enriched data can then be organized by date, timing, and market cap for the final earnings calendar report.
Resources
- FMP Documentation: https://site.financialmodelingprep.com/developer/docs
- API Key Signup: https://site.financialmodelingprep.com/developer/docs
- Earnings Calendar API: https://site.financialmodelingprep.com/developer/docs/earnings-calendar-api
- Company Profile API: https://site.financialmodelingprep.com/developer/docs/companies-key-metrics-api
- Rate Limits: https://site.financialmodelingprep.com/developer/docs/pricing
---
This guide is optimized for the earnings-calendar skill and FMP API integration.
#!/usr/bin/env python3
"""
FMP Earnings Calendar Fetcher
Retrieves upcoming earnings announcements from Financial Modeling Prep API,
filters by market cap (>$2B), and outputs structured JSON data.
Usage:
# With environment variable
export FMP_API_KEY="your-key"
python fetch_earnings_fmp.py 2025-11-03 2025-11-09
# With API key as argument
python fetch_earnings_fmp.py 2025-11-03 2025-11-09 YOUR_API_KEY
# Help
python fetch_earnings_fmp.py --help
"""
import json
import os
import sys
from datetime import datetime
from typing import Optional
import requests
class FMPEarningsCalendar:
"""FMP Earnings Calendar API client"""
BASE_URL = "https://financialmodelingprep.com/stable"
MIN_MARKET_CAP = 2_000_000_000 # $2B
US_EXCHANGES = ["NYSE", "NASDAQ", "AMEX", "NYSEArca", "BATS", "NMS", "NGM", "NCM"]
def __init__(self, api_key: str, us_only: bool = True):
"""
Initialize FMP client
Args:
api_key: FMP API key
us_only: If True, filter for US stocks only (default: True)
"""
self.api_key = api_key
self.us_only = us_only
def fetch_earnings_calendar(self, start_date: str, end_date: str) -> Optional[list[dict]]:
"""
Fetch earnings calendar from FMP API
Args:
start_date: Start date (YYYY-MM-DD)
end_date: End date (YYYY-MM-DD)
Returns:
List of earnings announcements or None on error
"""
url = f"{self.BASE_URL}/earnings-calendar"
params = {"from": start_date, "to": end_date, "apikey": self.api_key}
try:
response = requests.get(url, params=params, timeout=30)
if response.status_code == 401:
print("❌ ERROR: Invalid API key", file=sys.stderr)
print(
"Get free API key: https://site.financialmodelingprep.com/developer/docs",
file=sys.stderr,
)
return None
if response.status_code == 429:
print("❌ ERROR: Rate limit exceeded", file=sys.stderr)
print("Free tier: 250 calls/day. Consider upgrading.", file=sys.stderr)
return None
response.raise_for_status()
data = response.json()
# Check if response is error message
if isinstance(data, dict) and "Error Message" in data:
print(f"❌ API Error: {data['Error Message']}", file=sys.stderr)
return None
print(f"✓ Retrieved {len(data)} earnings announcements", file=sys.stderr)
return data
except requests.exceptions.Timeout:
print("❌ ERROR: Request timeout. Please try again.", file=sys.stderr)
return None
except requests.exceptions.ConnectionError:
print("❌ ERROR: Connection error. Check your internet connection.", file=sys.stderr)
return None
except Exception as e:
print(f"❌ ERROR: Unexpected error: {str(e)}", file=sys.stderr)
return None
def fetch_company_profiles(self, symbols: list[str]) -> dict[str, dict]:
"""
Fetch company profiles for multiple symbols (batch)
Args:
symbols: List of ticker symbols
Returns:
Dictionary mapping symbol to profile data
"""
profiles = {}
print(f"✓ Fetching profiles for {len(symbols)} companies...", file=sys.stderr)
for i, symbol in enumerate(symbols):
url = f"{self.BASE_URL}/profile"
params = {"symbol": symbol, "apikey": self.api_key}
try:
response = requests.get(url, params=params, timeout=30)
response.raise_for_status()
data = response.json()
if isinstance(data, list) and len(data) > 0 and isinstance(data[0], dict):
profiles[data[0].get("symbol")] = data[0]
if (i + 1) % 50 == 0:
print(f" ✓ Fetched {i + 1}/{len(symbols)} profiles", file=sys.stderr)
except Exception as e:
print(
f" ⚠️ Warning: Failed to fetch profile for {symbol}: {str(e)}",
file=sys.stderr,
)
continue
print(f"✓ Retrieved {len(profiles)} company profiles", file=sys.stderr)
return profiles
def filter_by_market_cap(self, earnings: list[dict], profiles: dict[str, dict]) -> list[dict]:
"""
Filter earnings by minimum market cap and enrich with company data
Args:
earnings: List of earnings announcements
profiles: Dictionary of company profiles
Returns:
Filtered and enriched list of earnings
"""
filtered = []
for earning in earnings:
symbol = earning.get("symbol")
if not symbol:
continue
profile = profiles.get(symbol)
# Filter by market cap and exchange
if profile:
market_cap = profile.get("marketCap", 0)
if market_cap < self.MIN_MARKET_CAP:
continue
exchange = profile.get("exchange", "N/A")
# Filter by US exchanges if us_only is True
if self.us_only and exchange not in self.US_EXCHANGES:
continue
# Enrich with profile data
earning["marketCap"] = market_cap
earning["companyName"] = profile.get("companyName", symbol)
earning["sector"] = profile.get("sector", "N/A")
earning["industry"] = profile.get("industry", "N/A")
earning["exchange"] = exchange
filtered.append(earning)
if self.us_only:
print(
f"✓ Filtered to {len(filtered)} US mid-cap+ companies (>${self.MIN_MARKET_CAP / 1e9:.0f}B)",
file=sys.stderr,
)
else:
print(
f"✓ Filtered to {len(filtered)} mid-cap+ companies (>${self.MIN_MARKET_CAP / 1e9:.0f}B)",
file=sys.stderr,
)
return filtered
def normalize_timing(self, time_value: Optional[str]) -> str:
"""
Normalize timing values to BMO/AMC/TAS
Args:
time_value: Raw time value from API
Returns:
Normalized timing: BMO, AMC, or TAS
"""
if not time_value:
return "TAS"
time_lower = time_value.lower()
if time_lower in ["bmo", "pre-market", "before market open"]:
return "BMO"
elif time_lower in ["amc", "after-market", "after market close"]:
return "AMC"
else:
return "TAS"
def format_market_cap(self, market_cap: float) -> str:
"""
Format market cap in human-readable format
Args:
market_cap: Market cap in dollars
Returns:
Formatted string (e.g., "$3.0T", "$150B")
"""
if market_cap >= 1e12:
return f"${market_cap / 1e12:.1f}T"
elif market_cap >= 1e9:
return f"${market_cap / 1e9:.1f}B"
elif market_cap >= 1e6:
return f"${market_cap / 1e6:.0f}M"
else:
return f"${market_cap:,.0f}"
def process_earnings(self, earnings: list[dict]) -> list[dict]:
"""
Process and standardize earnings data
Args:
earnings: Raw earnings data
Returns:
Processed earnings data
"""
processed = []
for earning in earnings:
# Normalize timing
timing = self.normalize_timing(earning.get("time"))
# Format market cap
market_cap = earning.get("marketCap", 0)
market_cap_formatted = self.format_market_cap(market_cap)
processed_earning = {
"symbol": earning.get("symbol"),
"companyName": earning.get("companyName", earning.get("symbol")),
"date": earning.get("date"),
"timing": timing,
"marketCap": market_cap,
"marketCapFormatted": market_cap_formatted,
"sector": earning.get("sector", "N/A"),
"industry": earning.get("industry", "N/A"),
"epsEstimated": earning.get("epsEstimated"),
"revenueEstimated": earning.get("revenueEstimated"),
"fiscalDateEnding": earning.get("fiscalDateEnding"),
"exchange": earning.get("exchange", "N/A"),
}
processed.append(processed_earning)
return processed
def sort_earnings(self, earnings: list[dict]) -> list[dict]:
"""
Sort earnings by date, timing, and market cap
Args:
earnings: Processed earnings data
Returns:
Sorted earnings data
"""
# Define timing order
timing_order = {"BMO": 1, "AMC": 2, "TAS": 3}
return sorted(
earnings,
key=lambda x: (
x.get("date", ""),
timing_order.get(x.get("timing", "TAS"), 3),
-x.get("marketCap", 0), # Descending market cap
),
)
def get_api_key() -> Optional[str]:
"""
Get API key from environment or command line
Returns:
API key or None
"""
# Method 1: Command line argument (position 3)
if len(sys.argv) >= 4:
api_key = sys.argv[3]
print("✓ API key provided via command line argument", file=sys.stderr)
return api_key
# Method 2: Environment variable
api_key = os.environ.get("FMP_API_KEY")
if api_key:
print("✓ API key loaded from FMP_API_KEY environment variable", file=sys.stderr)
return api_key
# Not found
print("❌ ERROR: No API key found", file=sys.stderr)
print("", file=sys.stderr)
print("Options:", file=sys.stderr)
print("1. Set environment variable: export FMP_API_KEY='your-key'", file=sys.stderr)
print("2. Pass as argument: python fetch_earnings_fmp.py START END YOUR_KEY", file=sys.stderr)
print(
"3. Get free API key: https://site.financialmodelingprep.com/developer/docs",
file=sys.stderr,
)
return None
def validate_date(date_str: str) -> bool:
"""
Validate date format (YYYY-MM-DD)
Args:
date_str: Date string
Returns:
True if valid, False otherwise
"""
try:
datetime.strptime(date_str, "%Y-%m-%d")
return True
except ValueError:
return False
def print_usage():
"""Print usage instructions"""
print("Usage:", file=sys.stderr)
print(" python fetch_earnings_fmp.py START_DATE END_DATE [API_KEY]", file=sys.stderr)
print("", file=sys.stderr)
print("Arguments:", file=sys.stderr)
print(" START_DATE Start date in YYYY-MM-DD format", file=sys.stderr)
print(" END_DATE End date in YYYY-MM-DD format", file=sys.stderr)
print(" API_KEY (Optional) FMP API key (or use FMP_API_KEY env var)", file=sys.stderr)
print("", file=sys.stderr)
print("Examples:", file=sys.stderr)
print(" export FMP_API_KEY='your-key'", file=sys.stderr)
print(" python fetch_earnings_fmp.py 2025-11-03 2025-11-09", file=sys.stderr)
print("", file=sys.stderr)
print(" python fetch_earnings_fmp.py 2025-11-03 2025-11-09 your-key", file=sys.stderr)
print("", file=sys.stderr)
print("Output:", file=sys.stderr)
print(" JSON data is written to stdout", file=sys.stderr)
print(" Progress messages are written to stderr", file=sys.stderr)
def main():
"""Main execution"""
# Check for help flag
if len(sys.argv) > 1 and sys.argv[1] in ["-h", "--help", "help"]:
print_usage()
sys.exit(0)
# Validate arguments
if len(sys.argv) < 3:
print("❌ ERROR: Missing required arguments", file=sys.stderr)
print("", file=sys.stderr)
print_usage()
sys.exit(1)
start_date = sys.argv[1]
end_date = sys.argv[2]
# Validate dates
if not validate_date(start_date):
print(f"❌ ERROR: Invalid start date format: {start_date}", file=sys.stderr)
print("Expected format: YYYY-MM-DD", file=sys.stderr)
sys.exit(1)
if not validate_date(end_date):
print(f"❌ ERROR: Invalid end date format: {end_date}", file=sys.stderr)
print("Expected format: YYYY-MM-DD", file=sys.stderr)
sys.exit(1)
# Get API key
api_key = get_api_key()
if not api_key:
sys.exit(1)
print("", file=sys.stderr)
print(f"📅 Fetching earnings calendar: {start_date} to {end_date}", file=sys.stderr)
print("", file=sys.stderr)
# Initialize client
client = FMPEarningsCalendar(api_key)
# Step 1: Fetch earnings calendar
print("Step 1: Fetching earnings calendar...", file=sys.stderr)
earnings = client.fetch_earnings_calendar(start_date, end_date)
if earnings is None:
sys.exit(1)
if len(earnings) == 0:
print("⚠️ Warning: No earnings announcements found for date range", file=sys.stderr)
print(json.dumps([], indent=2))
sys.exit(0)
# Step 2: Fetch company profiles
print("", file=sys.stderr)
print("Step 2: Fetching company profiles...", file=sys.stderr)
symbols = list(set([e.get("symbol") for e in earnings if e.get("symbol")]))
profiles = client.fetch_company_profiles(symbols)
# Step 3: Filter by market cap
print("", file=sys.stderr)
print("Step 3: Filtering by market cap...", file=sys.stderr)
filtered_earnings = client.filter_by_market_cap(earnings, profiles)
if len(filtered_earnings) == 0:
print("⚠️ Warning: No companies with market cap >$2B found", file=sys.stderr)
print(json.dumps([], indent=2))
sys.exit(0)
# Step 4: Process earnings data
print("", file=sys.stderr)
print("Step 4: Processing earnings data...", file=sys.stderr)
processed_earnings = client.process_earnings(filtered_earnings)
# Step 5: Sort earnings
print("", file=sys.stderr)
print("Step 5: Sorting by date, timing, and market cap...", file=sys.stderr)
sorted_earnings = client.sort_earnings(processed_earnings)
print(f"✓ Final dataset: {len(sorted_earnings)} companies", file=sys.stderr)
# Output JSON to stdout
print("", file=sys.stderr)
print("✓ Complete! Writing JSON output...", file=sys.stderr)
print(json.dumps(sorted_earnings, indent=2))
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""
Earnings Calendar Report Generator
Generates formatted markdown reports from earnings data JSON.
Usage:
# Output to stdout
python generate_report.py earnings_data.json
# Output to file
python generate_report.py earnings_data.json earnings_calendar.md
# Help
python generate_report.py --help
"""
import json
import sys
from collections import defaultdict
from datetime import datetime
def load_earnings_data(filepath: str) -> list[dict]:
"""
Load earnings data from JSON file
Args:
filepath: Path to JSON file
Returns:
List of earnings announcements
"""
try:
with open(filepath) as f:
content = f.read()
# Handle case where file has progress messages before JSON
json_start = content.find("[")
if json_start != -1:
content = content[json_start:]
data = json.loads(content)
if not isinstance(data, list):
print("ERROR: JSON file must contain an array of earnings data", file=sys.stderr)
sys.exit(1)
return data
except FileNotFoundError:
print(f"ERROR: File not found: {filepath}", file=sys.stderr)
sys.exit(1)
except json.JSONDecodeError as e:
print(f"ERROR: Invalid JSON in file: {e}", file=sys.stderr)
sys.exit(1)
except Exception as e:
print(f"ERROR: Unexpected error reading file: {e}", file=sys.stderr)
sys.exit(1)
def group_by_date(earnings: list[dict]) -> dict:
"""
Group earnings by date and timing
Args:
earnings: List of earnings announcements
Returns:
Dictionary grouped by date and timing
"""
by_date = defaultdict(lambda: {"BMO": [], "AMC": [], "TAS": []})
for stock in earnings:
date = stock.get("date")
timing = stock.get("timing", "TAS")
if date:
by_date[date][timing].append(stock)
return by_date
def calculate_summary_stats(earnings: list[dict]) -> dict:
"""
Calculate summary statistics
Args:
earnings: List of earnings announcements
Returns:
Dictionary with summary statistics
"""
total = len(earnings)
large_cap = sum(1 for s in earnings if s.get("marketCap", 0) >= 10_000_000_000)
mid_cap = total - large_cap
# Sector distribution
sectors = defaultdict(int)
for stock in earnings:
sector = stock.get("sector", "N/A")
sectors[sector] += 1
# Peak day
by_date = group_by_date(earnings)
peak = max(by_date.items(), key=lambda x: sum(len(v) for v in x[1].values()))
peak_date, peak_data = peak
peak_count = sum(len(v) for v in peak_data.values())
return {
"total": total,
"large_cap": large_cap,
"mid_cap": mid_cap,
"sectors": dict(sectors),
"peak_date": peak_date,
"peak_count": peak_count,
}
def get_day_name(date_str: str) -> str:
"""
Convert date string to full day name
Args:
date_str: Date in YYYY-MM-DD format
Returns:
Formatted day name (e.g., "Monday, November 03, 2025")
"""
date_obj = datetime.strptime(date_str, "%Y-%m-%d")
return date_obj.strftime("%A, %B %d, %Y")
def format_revenue(revenue: float) -> str:
"""
Format revenue in human-readable format
Args:
revenue: Revenue in dollars
Returns:
Formatted string (e.g., "$3.5B", "$150M")
"""
if revenue >= 1e12:
return f"${revenue / 1e12:.1f}T"
elif revenue >= 1e9:
return f"${revenue / 1e9:.1f}B"
elif revenue >= 1e6:
return f"${revenue / 1e6:.0f}M"
else:
return f"${revenue:,.0f}"
def generate_report(earnings: list[dict]) -> str:
"""
Generate markdown earnings calendar report
Args:
earnings: List of earnings announcements
Returns:
Formatted markdown report
"""
if not earnings:
return "# Earnings Calendar\n\nNo earnings data available.\n"
# Calculate statistics
stats = calculate_summary_stats(earnings)
by_date = group_by_date(earnings)
# Get date range
dates = sorted(by_date.keys())
if dates:
start_date = datetime.strptime(dates[0], "%Y-%m-%d")
end_date = datetime.strptime(dates[-1], "%Y-%m-%d")
date_range = f"{start_date.strftime('%B %d')} to {end_date.strftime('%B %d, %Y')}"
else:
date_range = "Unknown"
# Top 5 by market cap
top5 = sorted(earnings, key=lambda x: x.get("marketCap", 0), reverse=True)[:5]
# Generate report
report = f"""# Upcoming Earnings Calendar - Week of {date_range}
**Report Generated**: {datetime.now().strftime("%B %d, %Y")}
**Data Source**: FMP API (US stocks, Mid-cap and above, >$2B market cap)
**Coverage Period**: Next 7 days
**Total Companies**: {stats["total"]}
---
## Executive Summary
- **Total Companies Reporting**: {stats["total"]}
- **Mega/Large Cap (>$10B)**: {stats["large_cap"]}
- **Mid Cap ($2B-$10B)**: {stats["mid_cap"]}
- **Peak Day**: {get_day_name(stats["peak_date"]).split(",")[0]} ({stats["peak_count"]} companies)
---
"""
# Generate day-by-day sections
for date in dates:
day_name = get_day_name(date)
report += f"## {day_name}\n\n"
timings = ["BMO", "AMC", "TAS"]
timing_labels = {
"BMO": "Before Market Open (BMO)",
"AMC": "After Market Close (AMC)",
"TAS": "Time Not Announced (TAS)",
}
for timing in timings:
stocks = by_date[date][timing]
report += f"### {timing_labels[timing]}\n\n"
if not stocks:
report += "*No earnings announcements*\n\n"
else:
report += "| Ticker | Company | Market Cap | Sector | EPS Est. | Revenue Est. |\n"
report += "|--------|---------|------------|--------|----------|--------------|\n"
# Top 30 by market cap
display_stocks = sorted(stocks, key=lambda x: x.get("marketCap", 0), reverse=True)[
:30
]
for stock in display_stocks:
ticker = stock.get("symbol", "N/A")
company = stock.get("companyName", "N/A")[:35]
mcap = stock.get("marketCapFormatted", "N/A")
sector = stock.get("sector", "N/A")[:18]
eps = stock.get("epsEstimated")
eps_str = f"${eps:.2f}" if eps is not None else "N/A"
rev = stock.get("revenueEstimated")
rev_str = format_revenue(rev) if rev else "N/A"
report += (
f"| {ticker} | {company} | {mcap} | {sector} | {eps_str} | {rev_str} |\n"
)
if len(stocks) > 30:
report += f"\n*Showing top 30 of {len(stocks)} companies by market cap*\n"
report += "\n"
report += "---\n\n"
# Key observations
report += "## Key Observations\n\n### Highest Market Cap Companies This Week\n"
for i, stock in enumerate(top5, 1):
date_str = datetime.strptime(stock["date"], "%Y-%m-%d").strftime("%a")
company = stock.get("companyName", stock.get("symbol"))
ticker = stock.get("symbol", "N/A")
mcap = stock.get("marketCapFormatted", "N/A")
timing = stock.get("timing", "TAS")
report += f"{i}. {company} ({ticker}) - {mcap} - {date_str} {timing}\n"
report += "\n### Sector Distribution\n"
top_sectors = sorted(stats["sectors"].items(), key=lambda x: x[1], reverse=True)[:5]
for sector, count in top_sectors:
report += f"- **{sector}**: {count} companies\n"
peak_day_name = get_day_name(stats["peak_date"]).split(",")[0]
report += f"""
### Trading Considerations
- **Peak Day**: {peak_day_name} with {stats["peak_count"]} earnings announcements
- **Pre-Market Focus**: BMO announcements before 9:30 AM ET
- **After-Hours Focus**: AMC announcements after 4:00 PM ET
---
## Timing Reference
- **BMO (Before Market Open)**: Announcements typically around 6:00-8:00 AM ET before market opens at 9:30 AM ET
- **AMC (After Market Close)**: Announcements typically around 4:00-5:00 PM ET after market closes at 4:00 PM ET
- **TAS (Time Not Announced)**: Specific time not yet disclosed - monitor company investor relations
---
## Data Notes
- **Market Cap Categories**:
- Mega Cap: >$200B
- Large Cap: $10B-$200B
- Mid Cap: $2B-$10B
- **Filter Criteria**: This report includes US companies with market cap $2B and above (mid-cap+) with earnings scheduled for the next week.
- **Data Source**: Financial Modeling Prep (FMP) API
- **Data Freshness**: Earnings dates and times can change. Verify critical dates through company investor relations websites for the most current information.
- **EPS and Revenue Estimates**: Analyst consensus estimates from FMP API. Actual results will be reported on earnings date.
---
## Additional Resources
- **FMP API Documentation**: https://site.financialmodelingprep.com/developer/docs
- **Seeking Alpha Calendar**: https://seekingalpha.com/earnings/earnings-calendar
- **Yahoo Finance Calendar**: https://finance.yahoo.com/calendar/earnings
---
*Report generated using FMP Earnings Calendar API with US stocks mid-cap+ filter (>$2B market cap). Data current as of report generation time. Always verify earnings dates through official company sources.*
"""
return report
def print_usage():
"""Print usage instructions"""
print("Usage:", file=sys.stderr)
print(" python generate_report.py INPUT_JSON [OUTPUT_FILE]", file=sys.stderr)
print("", file=sys.stderr)
print("Arguments:", file=sys.stderr)
print(" INPUT_JSON Path to earnings data JSON file (required)", file=sys.stderr)
print(
" OUTPUT_FILE Path to output markdown file (optional, defaults to stdout)",
file=sys.stderr,
)
print("", file=sys.stderr)
print("Examples:", file=sys.stderr)
print(" python generate_report.py earnings_data.json", file=sys.stderr)
print(" python generate_report.py earnings_data.json earnings_calendar.md", file=sys.stderr)
print("", file=sys.stderr)
print("Input JSON format:", file=sys.stderr)
print(
" Array of earnings objects with fields: symbol, companyName, date, timing,",
file=sys.stderr,
)
print(
" marketCap, marketCapFormatted, sector, epsEstimated, revenueEstimated", file=sys.stderr
)
def main():
"""Main execution"""
# Check for help flag
if len(sys.argv) > 1 and sys.argv[1] in ["-h", "--help", "help"]:
print_usage()
sys.exit(0)
# Validate arguments
if len(sys.argv) < 2:
print("ERROR: Missing required argument", file=sys.stderr)
print("", file=sys.stderr)
print_usage()
sys.exit(1)
input_file = sys.argv[1]
output_file = sys.argv[2] if len(sys.argv) > 2 else None
print(f"📄 Loading earnings data from: {input_file}", file=sys.stderr)
earnings = load_earnings_data(input_file)
print(f"✓ Loaded {len(earnings)} companies", file=sys.stderr)
print("📝 Generating markdown report...", file=sys.stderr)
report = generate_report(earnings)
if output_file:
with open(output_file, "w") as f:
f.write(report)
print(f"✓ Report saved to: {output_file}", file=sys.stderr)
else:
print(report)
if __name__ == "__main__":
main()
"""Shared fixtures for Earnings Calendar tests"""
import os
import sys
# Add scripts directory to path so modules can be imported
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
# Add tests directory to path so helpers can be imported
sys.path.insert(0, os.path.dirname(__file__))
"""Tests for Earnings Calendar scripts.
Covers:
- FMPEarningsCalendar helper methods (no API calls)
- Date validation
- Report generation (generate_report.py pure functions)
"""
import pytest
from fetch_earnings_fmp import FMPEarningsCalendar, validate_date
from generate_report import (
calculate_summary_stats,
format_revenue,
generate_report,
get_day_name,
group_by_date,
)
# ── Fixtures ──────────────────────────────────────────────────────────
@pytest.fixture
def client():
"""FMP client with dummy API key (no API calls made)."""
return FMPEarningsCalendar(api_key="dummy-key")
@pytest.fixture
def sample_earnings():
"""Sample earnings data for testing."""
return [
{
"symbol": "AAPL",
"companyName": "Apple Inc.",
"date": "2025-11-05",
"timing": "AMC",
"marketCap": 3_000_000_000_000,
"marketCapFormatted": "$3.0T",
"sector": "Technology",
"industry": "Consumer Electronics",
"epsEstimated": 1.55,
"revenueEstimated": 89_500_000_000,
"exchange": "NASDAQ",
},
{
"symbol": "MSFT",
"companyName": "Microsoft Corp",
"date": "2025-11-04",
"timing": "BMO",
"marketCap": 2_500_000_000_000,
"marketCapFormatted": "$2.5T",
"sector": "Technology",
"industry": "Software",
"epsEstimated": 2.80,
"revenueEstimated": 60_000_000_000,
"exchange": "NASDAQ",
},
{
"symbol": "JNJ",
"companyName": "Johnson & Johnson",
"date": "2025-11-04",
"timing": "BMO",
"marketCap": 400_000_000_000,
"marketCapFormatted": "$400.0B",
"sector": "Healthcare",
"industry": "Drug Manufacturers",
"epsEstimated": 2.60,
"revenueEstimated": 22_000_000_000,
"exchange": "NYSE",
},
]
# ── normalize_timing ──────────────────────────────────────────────────
class TestNormalizeTiming:
def test_bmo_variants(self, client):
assert client.normalize_timing("bmo") == "BMO"
assert client.normalize_timing("pre-market") == "BMO"
assert client.normalize_timing("before market open") == "BMO"
def test_amc_variants(self, client):
assert client.normalize_timing("amc") == "AMC"
assert client.normalize_timing("after-market") == "AMC"
assert client.normalize_timing("after market close") == "AMC"
def test_none_returns_tas(self, client):
assert client.normalize_timing(None) == "TAS"
def test_unknown_returns_tas(self, client):
assert client.normalize_timing("unknown") == "TAS"
assert client.normalize_timing("") == "TAS"
# ── format_market_cap ─────────────────────────────────────────────────
class TestFormatMarketCap:
def test_trillion(self, client):
assert client.format_market_cap(3_000_000_000_000) == "$3.0T"
assert client.format_market_cap(1_500_000_000_000) == "$1.5T"
def test_billion(self, client):
assert client.format_market_cap(150_000_000_000) == "$150.0B"
assert client.format_market_cap(2_000_000_000) == "$2.0B"
def test_million(self, client):
assert client.format_market_cap(500_000_000) == "$500M"
def test_small(self, client):
assert client.format_market_cap(999_999) == "$999,999"
# ── filter_by_market_cap ──────────────────────────────────────────────
class TestFilterByMarketCap:
def test_filters_below_2b(self, client):
earnings = [
{"symbol": "BIG"},
{"symbol": "SMALL"},
]
profiles = {
"BIG": {"marketCap": 10_000_000_000, "exchange": "NYSE"},
"SMALL": {"marketCap": 500_000_000, "exchange": "NYSE"},
}
result = client.filter_by_market_cap(earnings, profiles)
assert len(result) == 1
assert result[0]["symbol"] == "BIG"
def test_filters_non_us_exchanges(self, client):
earnings = [{"symbol": "US"}, {"symbol": "UK"}]
profiles = {
"US": {"marketCap": 5_000_000_000, "exchange": "NYSE"},
"UK": {"marketCap": 5_000_000_000, "exchange": "LSE"},
}
result = client.filter_by_market_cap(earnings, profiles)
assert len(result) == 1
assert result[0]["symbol"] == "US"
def test_no_profile_excluded(self, client):
earnings = [{"symbol": "NOPROFILE"}]
profiles = {}
result = client.filter_by_market_cap(earnings, profiles)
assert len(result) == 0
def test_enriches_with_profile_data(self, client):
earnings = [{"symbol": "AAPL"}]
profiles = {
"AAPL": {
"marketCap": 3_000_000_000_000,
"companyName": "Apple Inc.",
"sector": "Technology",
"industry": "Consumer Electronics",
"exchange": "NASDAQ",
},
}
result = client.filter_by_market_cap(earnings, profiles)
assert result[0]["companyName"] == "Apple Inc."
assert result[0]["sector"] == "Technology"
# ── sort_earnings ─────────────────────────────────────────────────────
class TestSortEarnings:
def test_sorted_by_date_then_timing_then_mcap(self, client):
earnings = [
{"date": "2025-11-05", "timing": "AMC", "marketCap": 100},
{"date": "2025-11-04", "timing": "BMO", "marketCap": 200},
{"date": "2025-11-04", "timing": "AMC", "marketCap": 300},
{"date": "2025-11-04", "timing": "BMO", "marketCap": 500},
]
result = client.sort_earnings(earnings)
# 2025-11-04 first, BMO before AMC, higher mcap first within BMO
assert result[0]["date"] == "2025-11-04"
assert result[0]["timing"] == "BMO"
assert result[0]["marketCap"] == 500
assert result[1]["timing"] == "BMO"
assert result[1]["marketCap"] == 200
assert result[2]["timing"] == "AMC"
# ── validate_date ─────────────────────────────────────────────────────
class TestValidateDate:
def test_valid_date(self):
assert validate_date("2025-11-04") is True
def test_invalid_format(self):
assert validate_date("11-04-2025") is False
assert validate_date("2025/11/04") is False
def test_invalid_date(self):
assert validate_date("2025-13-01") is False
assert validate_date("not-a-date") is False
# ── Report generation helpers ─────────────────────────────────────────
class TestGroupByDate:
def test_groups_correctly(self, sample_earnings):
result = group_by_date(sample_earnings)
assert "2025-11-04" in result
assert "2025-11-05" in result
assert len(result["2025-11-04"]["BMO"]) == 2
assert len(result["2025-11-05"]["AMC"]) == 1
def test_empty_input(self):
assert group_by_date([]) == {}
class TestFormatRevenue:
def test_trillion(self):
assert format_revenue(1_500_000_000_000) == "$1.5T"
def test_billion(self):
assert format_revenue(89_500_000_000) == "$89.5B"
def test_million(self):
assert format_revenue(500_000_000) == "$500M"
class TestGetDayName:
def test_known_date(self):
result = get_day_name("2025-11-04")
assert "Tuesday" in result
assert "November" in result
class TestCalculateSummaryStats:
def test_stats(self, sample_earnings):
stats = calculate_summary_stats(sample_earnings)
assert stats["total"] == 3
assert stats["large_cap"] == 3 # all > $10B
assert stats["mid_cap"] == 0
assert stats["sectors"]["Technology"] == 2
assert stats["sectors"]["Healthcare"] == 1
assert stats["peak_count"] == 2 # Nov 4 has 2 entries
class TestGenerateReport:
def test_report_contains_companies(self, sample_earnings):
report = generate_report(sample_earnings)
assert "AAPL" in report
assert "MSFT" in report
assert "JNJ" in report
def test_empty_earnings(self):
report = generate_report([])
assert "No earnings data available" in report
def test_report_has_sections(self, sample_earnings):
report = generate_report(sample_earnings)
assert "Executive Summary" in report
assert "Key Observations" in report
assert "Sector Distribution" in report
Related skills
How it compares
Pick earnings-calendar for FMP weekly earnings tables; pick single-ticker fundamental skills when analyzing one company's filings in depth.
FAQ
What data source does earnings-calendar use?
earnings-calendar pulls upcoming earnings from the FMP API, filtering to mid-cap and above companies with market caps greater than $2 billion across a 7-day reporting window.
What does the earnings-calendar report include?
earnings-calendar outputs an executive summary—total reporters, large-cap and mid-cap counts, peak day—plus daily before-market-open tables with ticker, sector, EPS estimate, and revenue estimate columns.
Is Earnings Calendar safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.