Skip to main content

Macro (FRED / World Bank)

Two macro data sources, unified under the same find-then-fetch pattern:

  • FRED (Federal Reserve Bank of St. Louis) — US and some international macro indicators (GDP, inflation, rates, housing, employment, etc.)
  • World Bank — cross-country structural indicators (GDP per capita, life expectancy, CO₂ emissions, trade as % of GDP, etc.)

Both follow the same flow: call find to resolve a concept phrase to a series id, then call series/wb_series to retrieve the data.


FRED endpoints​

MethodPathDescription
GET/v1/ext/fred/findResolve a concept phrase to FRED series candidates
GET/v1/ext/fred/seriesFetch a FRED time series by id

GET /v1/ext/fred/find​

Resolve a natural-language concept to FRED series candidates. Use this to discover the series_id before fetching data.

ParameterTypeRequiredDescription
qstring✅Concept phrase (e.g. "US inflation", "10-year treasury yield", "unemployment rate").
countrystring—Bias results toward a country (ISO-2).
limitinteger—Max candidates. Default 8.
Find US inflation series
GET /v1/ext/fred/find?q=US+consumer+price+inflation
Find unemployment for Germany
GET /v1/ext/fred/find?q=unemployment+rate&country=DE

Response shape​

{
"query": "US consumer price inflation",
"candidates": [
{
"series_id": "CPIAUCSL",
"title": "Consumer Price Index for All Urban Consumers: All Items",
"frequency": "Monthly",
"units": "Index 1982-1984=100",
"description": "..."
}
]
}

GET /v1/ext/fred/series​

Fetch a FRED time series. Use series_id from find.

ParameterTypeRequiredDescription
series_idstring✅FRED series identifier (e.g. CPIAUCSL, FEDFUNDS, DGS10).
transformstring—Data transformation: pct_change, yoy, diff, log. Omit for raw levels.
fromstring—Start date YYYY-MM-DD.
tostring—End date YYYY-MM-DD.
freqstring—Frequency override: d (daily), w (weekly), m (monthly), q (quarterly), a (annual).
10-year treasury yield, last 2 years
GET /v1/ext/fred/series?series_id=DGS10&from=2024-01-01
CPI YoY change
GET /v1/ext/fred/series?series_id=CPIAUCSL&transform=yoy
Fed funds rate (all history)
GET /v1/ext/fred/series?series_id=FEDFUNDS

World Bank endpoints​

MethodPathDescription
GET/v1/ext/wb/findResolve a concept phrase to World Bank indicator candidates
GET/v1/ext/wb/seriesFetch a World Bank indicator time series

GET /v1/ext/wb/find​

Resolve a natural-language concept to World Bank indicator candidates.

ParameterTypeRequiredDescription
qstring✅Concept phrase (e.g. "GDP per capita", "CO2 emissions", "trade openness").
countrystring—Bias results toward a country (ISO-2).
limitinteger—Max candidates. Default 8.
Find GDP per capita
GET /v1/ext/wb/find?q=GDP+per+capita+PPP
Find trade-related indicators for China
GET /v1/ext/wb/find?q=exports+of+goods+and+services&country=CN

GET /v1/ext/wb/series​

Fetch a World Bank indicator time series. Use indicator from find.

ParameterTypeRequiredDescription
indicatorstring✅World Bank indicator id (e.g. NY.GDP.PCAP.PP.KD).
countrystring—ISO-2 country code (e.g. US, CN, DE). Omit for all countries.
frominteger—Start year (e.g. 2010).
tointeger—End year (e.g. 2023).
databasestring—World Bank database id. Defaults to the main Development Indicators database.
US GDP per capita since 2000
GET /v1/ext/wb/series?indicator=NY.GDP.PCAP.PP.KD&country=US&from=2000
CO2 emissions — all countries, last 10 years
GET /v1/ext/wb/series?indicator=EN.ATM.CO2E.PC&from=2013
Compare China and US trade openness
GET /v1/ext/wb/series?indicator=NE.TRD.GNFS.ZS&country=CN,US

Common FRED series​

Series IDDescription
FEDFUNDSFederal Funds Effective Rate
DGS1010-Year Treasury Constant Maturity Rate
DGS22-Year Treasury Constant Maturity Rate
CPIAUCSLCPI All Urban Consumers (monthly)
PCEPIPCE Price Index
UNRATEUS Unemployment Rate
GDPGross Domestic Product (quarterly)
INDPROIndustrial Production Index
DEXUSEUUSD/EUR Exchange Rate
VIXCLSCBOE Volatility Index (VIX)
MORTGAGE30US30-Year Fixed Mortgage Rate