Federal Reserve Bank of St. Louis
FRED — The macro library: 840,000 series, one id each, with the longest histories on the free web
Any US macro question — rates, inflation, jobs, GDP — and most international mirrors (OECD, IMF and BIS series are republished here). Reach for it first when you need an official series with a long history and an id that will not change under you.
Reach for it when…
Any US macro question — rates, inflation, jobs, GDP — and most international mirrors (OECD, IMF and BIS series are republished here). Reach for it first when you need an official series with a long history and an id that will not change under you.
Not for: Company fundamentals (EDGAR), intraday or per-ticker prices (Twelve Data, Polygon, Stooq), and anything real-time — FRED updates on the agencies' release calendar, usually the same morning.
Units, revisions, traps
Units. Percent, percent change and index are three different things and the same id is often offered as all three — read the Units line before you compare. Monthly values are stamped on the first of the month.
Revisions. FRED shows today's revised history. The number people saw at the time lives in ALFRED (alfred.stlouisfed.org), the vintage archive.
- CPIAUCSL is an index (1982–84 = 100), not an inflation rate — take the 12-month percent change.
- Daily series such as DGS10 carry '.' on holidays; pass na_values='.' and resample before joining to monthly data.
- Discontinued series stay online with no warning in the CSV — check the last observation date.
- Large downloads — three or more ids, or two long daily series — arrive from fredgraph.csv as a zip (README + CSV), not a CSV; pandas over the bare URL fails with a decode error. Fetch with requests and unzip when the content type says application/zip, or ask for one id at a time.
Classic mistake: Reading CPIAUCSL as inflation, or comparing a daily yield to a monthly CPI without resampling.
Three recipes
- Recipe 1 · Your own yield-curve chart, five lines
- Recipe 2 · Real wage growth, one line
- Recipe 3 · The number they saw at the time (ALFRED vintages)
Each recipe: Python · Excel · Sheets, with how to read the result. Python recipes run under pandas; recipe 1 is re-run by the weekly check where the source allows it.
How to use it in your own work
Copy the snippet, change the series id, read the result the way the footer says. Replace YOUR_…_KEY with your own key where one is needed.
Recipe 1Your own yield-curve chart, five lines
# 10-year minus 2-year Treasury spread, monthly, since 1980
import pandas as pd
url = "https://fred.stlouisfed.org/graph/fredgraph.csv?id=T10Y2Y"
df = pd.read_csv(url, index_col="observation_date", parse_dates=True, na_values=".")
spread = df["T10Y2Y"].resample("ME").last()["1980":]
print(spread.tail()) # spread.plot(title="10y − 2y spread, pp")- Data → Get Data → From Web → paste https://fred.stlouisfed.org/graph/fredgraph.csv?id=T10Y2Y → Load.
- Or install the free FRED Excel add-in and type the series id.
=IMPORTDATA("https://fred.stlouisfed.org/graph/fredgraph.csv?id=T10Y2Y")Recipe 2Real wage growth, one line
# average hourly earnings minus CPI, both as 12-month changes
import pandas as pd
url = "https://fred.stlouisfed.org/graph/fredgraph.csv?id=AHETPI,CPIAUCSL"
df = pd.read_csv(url, index_col="observation_date", parse_dates=True, na_values=".")
yoy = df.pct_change(12) * 100
real = (yoy["AHETPI"] - yoy["CPIAUCSL"]).dropna()
print(real.tail(12).round(2))- Same From Web URL with both ids separated by a comma; add two columns of 12-month % change and subtract.
=IMPORTDATA("https://fred.stlouisfed.org/graph/fredgraph.csv?id=AHETPI,CPIAUCSL") then two helper columns for the 12-row percent change.Recipe 3The number they saw at the time (ALFRED vintages)
# real GDP as it was published on a given day — needs a free API key
import requests, pandas as pd
KEY = "YOUR_FRED_KEY"
u = ("https://api.stlouisfed.org/fred/series/observations?series_id=GDPC1"
f"&realtime_start=2020-07-30&realtime_end=2020-07-30&api_key={KEY}&file_type=json")
obs = requests.get(u, timeout=30).json()["observations"]
df = pd.DataFrame(obs)[["date", "value"]].set_index("date").astype(float)
print(df.tail(4)) # Q2 2020 as first reported, before revisions- Not available through From Web without a key; use the Python recipe or download the vintage from alfred.stlouisfed.org.
- Use the Python recipe; ALFRED vintages are not exposed as a plain CSV.
Series → question map
The ids we use from FRED, each with the question it answers. The catalog's compare view reads the concept tags behind these rows.
| Series | Answers | Region | Concept |
|---|---|---|---|
| T10Y2Y | Is the curve inverted? | United States | curve_spread |
| DGS10 | Where is the 10-year yield? | United States | yield_10y |
| DGS2 | Where is the 2-year yield? | United States | yield_2y |
| FEDFUNDS | What is the Fed's rate, monthly average? | United States | policy_rate |
| CPIAUCSL | What is US inflation doing? (index → pct_change(12)) | United States | cpi |
| UNRATE | Is the job market cracking? | United States | unemployment |
| IC4WSA | Are layoffs rising? (4-week initial claims) | United States | claims |
| GDPC1 | Is the US economy growing? (real GDP) | United States | gdp |
| DTWEXBGS | Is the dollar strong? (broad index) | global | broad_dollar |
| DEXKOUS | Won per dollar, daily | Korea | fx_usd |
| DEXJPUS | Yen per dollar, daily | Japan | fx_usd |
| DEXUSEU | Dollars per euro, daily | euro area | fx_usd |
| AHETPI | Are wages keeping up? | United States | wages |
| M2SL | Is money supply growing? | United States | money_supply |
| CSUSHPINSA | Are house prices rising? (Case-Shiller) | United States | house_prices |
| SOFR | What is the overnight funding rate? | United States | sofr |
Compare with
Same question, different source: ECB Data Portal, BOK ECOS, BIS Data Portal. The compare view lines up coverage, frequency, history and access side by side and lists what the combination makes possible.
Open compare: FRED · ECB Data Portal · BOK ECOS →
Curated: Policy rate and inflation for a country · Recession watch: the curve and the claims · Is the won weak or the dollar strong?.
Questions readers ask
Is FRED free?
Yes. CSV downloads and the Excel add-in need no account; the JSON API needs a free key and allows 120 requests a minute.
Can I republish FRED data?
Most series, with attribution. Some third-party series (a few from private providers) restrict redistribution — the series page shows a notice when that applies.
Why does my FRED number differ from the one in an old article?
FRED shows revised history. The value as first published is in ALFRED, the vintage archive; recipe 3 pulls it.
Why did a multi-series CSV URL fail to parse?
Above a size threshold (several ids, or long daily series) FRED returns a zip archive rather than a CSV. Read it with zipfile, or request one id per URL.
From the paper
Educational only — we explain, we never advise · snippet licence: public domain · corrections to [email protected], fixed within a day and logged in the changelog.