Get Economic Calendar
get_economic_calendarUpcoming and recently-released macro/economic events -- interest rate decisions, CPI, GDP, PMI, unemployment, payrolls, retail sales, and more -- sourced from Yahoo Finance, the one calendar source confirmed safe for external exposure (a second internal-only source, Trading Economics, carries a ToS caveat and is not exposed here).
Two buckets:
released_recent: events with a real reported value, within the last
lookback_daysdays. Every item here carries a realactualvalue (never blank) plusdiff(actual minus previous -- a plain arithmetic difference, never a beat/miss or consensus judgment; Yahoo doesn't provide point-in-time consensus data).upcoming: not-yet-released events within
days. No item here ever carries anactualvalue.
Every item in both buckets carries key_event: true for the handful of
event types that reliably move markets on their own (rate decisions, CPI,
GDP, headline Non-Farm Payrolls) -- an event-TYPE flag only, never a
beat/miss or directional judgment on the number itself. Set
key_events_only=true to filter to just these, or major_only=true to
restrict to the 8 largest economies.
Both buckets sort major-economy-first, then by recency -- truncating to
limit should never lose a US/EU/UK/JP/CN/DE/FR/CA print to an older or
thinner-economy one.
Pro tier only. For informational purposes only. Not financial advice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Look-ahead window in days for upcoming events (default 3, max 14). | |
| limit | No | Max results per bucket, released_recent and upcoming each capped independently (default 20, max 50). | |
| major_only | No | Restrict to the 8 largest economies (United States, Euro Area, United Kingdom, Japan, China, Germany, France, Canada). Default false returns all countries. | |
| lookback_days | No | Look-back window in days for recently-released events (default 2, max 7). Yahoo's own actual value has a confirmed ~1-day reporting lag, so a same-day-only window misses real releases -- keep this at 2+ to reliably see them. | |
| key_events_only | No | Restrict to the small subset of event types that reliably move markets on their own: interest rate/rate decisions, CPI, GDP, and headline Non-Farm Payrolls. Default false returns every event matching the broader base filter (also includes PMI, unemployment, other payrolls components, retail sales, ADP, inflation). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||