← MacroLens explorer

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
ParameterAccepted values / default
datasetcpi (default), pce
seriesComma-separated keys below. Default: headline for CPI; pce for PCE.
start / endYYYY-MM. Default: dataset coverage. Inclusive bounds.
metricindex (default), yoy, mom
adjustmentCPI index: NSA (default) or SA. CPI yoy: NSA only. CPI mom: SA only. PCE: SA only.
formatjson (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

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

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.