Financial Literature

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.

macroratespriceslabourfxUnited Statesglobal
Asset classesmacro · rates · prices · labour · fx
Frequencydaily → annual
History1947 → today
Limit · costCSV: no key · API: free key, 120 requests/min
KeyNo key — None for CSV or the Excel add-in; a free key for the JSON API (fred.stlouisfed.org/docs/api/api_key.html).
Formats · pull withcsv · json · excel-addin — python, excel, sheets
LicenceFRED terms of use: most series free to use with attribution; a minority of third-party series restrict redistribution — the series page says which.
RedistributeWith attribution; check series notes
Best for“Is the yield curve inverted?” · “What did US CPI do last month?” · “Any US macro series with a long, stable history”
When to use it

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.

How to read it

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.

How to use it in your own work

Three recipes

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")
How to read the resultHistorically the loud moment is the un-inversion — the spread turning positive again — not the inversion itself. Percentage points, not percent.

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))
How to read the resultNegative means pay rose slower than prices. Both series are monthly and seasonally adjusted, so the subtraction is fair.

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
How to read the resultCompare the vintage to today's GDPC1 to see the size of revisions — for 2020 Q2 the first print and the current value differ by billions.

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.

SeriesAnswersRegionConcept
T10Y2YIs the curve inverted?United Statescurve_spread
DGS10Where is the 10-year yield?United Statesyield_10y
DGS2Where is the 2-year yield?United Statesyield_2y
FEDFUNDSWhat is the Fed's rate, monthly average?United Statespolicy_rate
CPIAUCSLWhat is US inflation doing? (index → pct_change(12))United Statescpi
UNRATEIs the job market cracking?United Statesunemployment
IC4WSAAre layoffs rising? (4-week initial claims)United Statesclaims
GDPC1Is the US economy growing? (real GDP)United Statesgdp
DTWEXBGSIs the dollar strong? (broad index)globalbroad_dollar
DEXKOUSWon per dollar, dailyKoreafx_usd
DEXJPUSYen per dollar, dailyJapanfx_usd
DEXUSEUDollars per euro, dailyeuro areafx_usd
AHETPIAre wages keeping up?United Stateswages
M2SLIs money supply growing?United Statesmoney_supply
CSUSHPINSAAre house prices rising? (Case-Shiller)United Stateshouse_prices
SOFRWhat is the overnight funding rate?United Statessofr

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.