All APIs

Consumer Price Index API

Monthly CPI data from official sources in ten countries.

First request

Quickstart
curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/USA/cpi?period=2026-07" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
Example response Illustrative response · not a live request
{
  "country": "USA",
  "period": "2026-07",
  "value": "333.918",
  "base_period": "1982-84",
  "base_value": "100",
  "released_on": "2026-08-12"
}

Endpoints

GETConsumer Price Index/v1/economics/{country}/cpi
country
One supported uppercase country code: AUS, CAN, DEU, FRA, GBR, JPN, MYS, NLD, SGP, and USA.
period
Omit it for the latest accepted complete release, or pass one exact period.

MCP · economics_get_cpi

API reference
GETConsumer Price Index history/v1/economics/{country}/cpi/observations
country
One supported uppercase country code: AUS, CAN, DEU, FRA, GBR, JPN, MYS, NLD, SGP, and USA.
start
Inclusive first observation period.
end
Inclusive last observation period.
limit
Maximum observations returned. Defaults to 100.
cursor
The next_cursor from the previous page.

MCP · economics_get_cpi_history

API reference

History

cURL
curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/USA/cpi/observations?start=2026-07&limit=100" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
Example response Illustrative response · not a live request
{
  "observations": [
    {
      "country": "USA",
      "measure": "cpi",
      "value": "333.918",
      "unit": "INDEX",
      "transformation": "",
      "period": "2026-07"
    }
  ],
  "next_cursor": null,
  "as_of": "2026-08-29T16:00:00Z"
}

Sources and methodology

Explicit periods

Omit it for the latest accepted complete release, or pass one exact period.

REST and MCP

Use one API key for current and historical data through REST or MCP.

Common questions

Is CPI the same as inflation?

CPI is an index level, while inflation measures a percentage change in prices; use the inflation API when you need an inflation rate.

Can I compare CPI values across countries?

Check base_period and base_value before comparing index levels: countries can use different reference bases.

How do I request the latest CPI?

Omit period for the latest accepted complete release, or specify a month using YYYY-MM.

Make your first request

Get a free API key