Inflation data API
Public, read-only JSON and CSV. No API key required. Current captured datasets; missing values are null in JSON and empty in CSV.
Retrieve observations
/api/v1/series?dataset=cpi&series=headline,rent&start=2020-01&metric=yoy
| Parameter | Accepted values / default |
|---|---|
| dataset | cpi (default), pce |
| series | Comma-separated keys below. Default: headline for CPI; pce for PCE. |
| start / end | YYYY-MM. Default: dataset coverage. Inclusive bounds. |
| metric | index (default), yoy, mom |
| adjustment | CPI index: NSA (default) or SA. CPI yoy: NSA only. CPI mom: SA only. PCE: SA only. |
| format | json (default), csv |
Year-over-year = (current / same month last year − 1) × 100. Month-over-month = (current / prior calendar month − 1) × 100. Index units use the producer’s published base; do not compare absolute index levels across unrelated series. CSV includes capture/version metadata.
CPI series keys
headline— All items (CUUR0000SA0 / CUSR0000SA0)core— Core CPI (CUUR0000SA0L1E / CUSR0000SA0L1E)food— Food (CUUR0000SAF1 / CUSR0000SAF1)energy— Energy (CUUR0000SA0E / CUSR0000SA0E)shelter— Shelter (CUUR0000SAH1 / CUSR0000SAH1)medical— Medical care (CUUR0000SAM / CUSR0000SAM)rent— Rent of primary residence (CUUR0000SEHA / CUSR0000SEHA)oer— Owners’ equivalent rent (CUUR0000SEHC / CUSR0000SEHC)groceries— Groceries (CUUR0000SAF11 / CUSR0000SAF11)restaurants— Food away from home (CUUR0000SEFV / CUSR0000SEFV)electricity— Electricity (CUUR0000SEHF01 / CUSR0000SEHF01)gasoline— Gasoline (CUUR0000SETB01 / CUSR0000SETB01)new_vehicles— New vehicles (CUUR0000SETA01 / CUSR0000SETA01)used_vehicles— Used cars and trucks (CUUR0000SETA02 / CUSR0000SETA02)insurance— Motor vehicle insurance (CUUR0000SETE / CUSR0000SETE)
PCE series keys
pce — headline PCE (PCEPI); core_pce — excluding food and energy (PCEPILFE). Producer: BEA, retrieved through FRED.
Historical release vintages
The public ALFRED archive has a series catalog and one JSON file per available CPI or PCE index series. Each record is [observationMonth, validFrom, validThrough, indexValue]. Dates are inclusive; use the row whose interval contains your as-of date. A null value marks an unavailable index. ALFRED coverage can start later than the observation history, and some source IDs may be unavailable. The As published tool compares two as-of dates and computes annual or monthly rates from values available on each date.
Source: FRED/ALFRED real-time observation documentation ↗. Producer: BLS (CPI) or BEA (PCE). The file names and coverage are discoverable from the catalog.
Capture vintages
Compare all CPI and PCE captures retained by MacroLens. This archive began in September 2026; older dates within a capture are current observations of past months, not original release-time values. The comparison reports index revisions, newly covered months, and missing months.
/api/v1/vintages?before=cpi-d60f7aa71ac75b9e&after=cpi-eda4c6c0be00d76e&series=headline&metric=yoy
List available versions at /api/v1/vintages, then pass two version IDs as before and after. Optional parameters: dataset (cpi by default, or pce), series (dataset key), metric (index, yoy, mom), start and end (YYYY-MM). CPI annual change uses NSA and monthly change uses SA. PCE uses SA. CPI index uses NSA by default; pass adjustment=SA for adjusted levels. Gaps remain null.
Examples
- Headline and rent annual inflation — JSON
- PCE full-history index levels — CSV
- Capture-to-capture revision history
- All captured CPI vintages and series coverage
- Complete CPI snapshot
Update and usage notes
Daily checks are scheduled; publication happens only after changed observations pass validation and the build succeeds. The first daily check of each month attempts a complete CPI history recheck. If the BLS bulk source is unavailable, the recent ten years are checked through the BLS API while older history is preserved. Schedules may run late. Responses cache for up to one hour. This beta has no availability SLA; cache results and avoid repeatedly downloading unchanged data.
Invalid parameters return HTTP 400. No authentication or cross-origin credentials are required. Historical observations reflect the captured vintage and are unsuitable on their own for point-in-time backtests.