---
name: macrodataapi
description: Macro and economic data from the primary statistical agencies via MacroDataAPI. Use when the user asks for CPI, inflation, payrolls, unemployment, GDP, PCE, policy rates (Fed, ECB, BoE, RBA), yield curves, the economic release calendar, or point-in-time history for backtests.
---

# MacroDataAPI

28 series from 10 publishers (BLS, BEA, Treasury, Fed, ECB, Eurostat, ONS, Bank of England, ABS, RBA) at https://macrodataapi.com/api/v1. Values are decimal strings. Every response carries `source` (publisher, licence, url), `as_of` and, where known, `next_release_at`.

## Access

- Cheapest at volume: through RealtimeAPI.ai as feed `macrodata`. A free key (https://api.realtimeapi.ai/keys/free) gives 1,000 calls a month across every feed. MCP: https://mcp.realtimeapi.ai/mcp. Setup prompt: https://macrodataapi.com/realtimeapi/prompt.txt
- Direct free key: `POST https://macrodataapi.com/api/v1/auth/keys` with `{"email": "..."}`, header `X-API-Key: mdk_live_...`. 10/min, 500/day; latest values, catalog, calendar, policy rates, yields.
- No key: GET any data endpoint and pay the 402 with x402 (USDC on Base, gasless). History and vintages need a Pro pass (1h, 1d, 7d) or a per-request payment. There are no subscriptions.
- MCP server: https://macrodataapi.com/mcp (streamable HTTP, header X-API-Key). Tools: list_capabilities, create_free_api_key, macro_search_series, macro_latest, macro_history, macro_vintages, macro_calendar, macro_latest_releases, macro_policy_rates, macro_yield_curve.

## Endpoints

- `GET /api/v1/series`: Catalog of every series with publisher, unit, frequency, latest period and next release. $0.005 per request without a key. Refreshes every 60 minutes.
- `GET /api/v1/series/{series_id}`: Latest print for one series with the previous value, change, release time and next release. $0.010 per request without a key. Refreshes at each release; polled every 5 minutes on release days.
- `GET /api/v1/series/{series_id}/history`: Full history of one series, optionally as it stood on a past date (as_of) for point-in-time backtests. $0.020 per request without a key. Refreshes at each release.
- `GET /api/v1/series/{series_id}/vintages`: Every revision of one period of one series: the initial print and each later value with its vintage date. $0.020 per request without a key. Refreshes at each release.
- `GET /api/v1/releases/upcoming`: Scheduled data releases for the next N days across every publisher, with the series each one updates. $0.005 per request without a key. Refreshes every 5 minutes.
- `GET /api/v1/releases/latest`: The most recent releases observed, newest first, with the headline values that changed. $0.010 per request without a key. Refreshes every 60 seconds.
- `GET /api/v1/rates/policy`: Current policy rates of the Fed, ECB, Bank of England and RBA with the last decision date and next meeting. $0.005 per request without a key. Refreshes every 5 minutes.
- `GET /api/v1/yields/{country}`: Daily par yield curve for a country (US today), every tenor, with the previous session and the 2s10s spread. $0.010 per request without a key. Refreshes every 30 minutes.

## Series ids

Pattern `country.topic.detail`. `us.cpi.all.sa`, `us.cpi.all.nsa`, `us.cpi.core.sa`, `us.unemployment.rate`, `us.payrolls.total`, `us.earnings.hourly.private`, `us.ppi.final_demand`, `us.gdp.real.qoq.saar`, `us.pce.price.index`, `us.pce.price.core`, `us.debt.total`, `us.debt.public`, `us.yield.10y`, `us.yield.2y`, `us.yield.3m`, `us.yield.30y`, `us.fedfunds.effective`, `ea.ecb.mrr`, `ea.ecb.dfr`, `ea.hicp.annual`, `ea.unemployment.rate`, `uk.cpi.annual`, `uk.unemployment.rate`, `uk.gdp.qoq`, `uk.boe.bankrate`, `au.cpi.index`, `au.unemployment.rate`, `au.rba.cashrate`.

## Good habits

- Read the key from the MACRODATA_API_KEY (direct) or RTAPI_KEY (RealtimeAPI) environment variable. Never ask the user to paste a key into the chat; never print a full key.
- Periods are YYYY-MM-DD (daily), YYYY-MM (monthly), YYYY-Qn (quarterly). Parse values with a decimal type.
- For backtests use `history?as_of=YYYY-MM-DD` so revisions published after that date are excluded.
- `releases/upcoming?days=7` before quoting a number tells you whether a new print is imminent; `released_at` on a series is when this service observed it.
- Cite the `source` array when you repeat a figure: the licences (US public domain, CC BY 4.0, OGL v3) ask for attribution.
