All APIs

Consumer Price Index API

Monthly CPI data from official sources; coverage is listed by country.

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",
  "index_base": "1982-84=100",
  "released_on": "2026-08-12"
}

Endpoints

GETConsumer Price Index/v1/economics/{country}/cpi
country
One supported uppercase country code; see this operation’s coverage list.
period
Omit it for the latest accepted complete release, or pass one exact period.
version_id
Optional immutable publication version. Use `resource_version` from a `dataset.published` or `dataset.revised` event; omit to read the current admitted indicator.

MCP · economics_get_cpi

API reference →
GETConsumer Price Index history/v1/economics/{country}/cpi/observations
country
One supported uppercase country code; see this operation’s coverage list.
start
Inclusive first observation period. On Free and Basic, a start before your plan window is moved to the first period inside it. The response then includes start.
end
Inclusive last observation period.
limit
Maximum number of periods returned. Defaults to 100. A page may contain fewer periods; follow next_cursor.
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
{
  "country": "USA",
  "index_base": "1982-84=100",
  "as_of": "2026-08-12T00:00:00Z",
  "observations": [
    {
      "period": "2026-07",
      "value": "333.918"
    }
  ],
  "next_cursor": null
}

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.

Explore related pages

Economic data API

Official indicators for prices, labour, output, trade, and rates.

Explore the API →

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 index_base 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.

Does the CPI API cover countries worldwide?

The CPI API covers many countries using each country's official national statistics publisher; see the Coverage section for the full list. Use one API key and the same request shape for every country by passing a country code.

Can I use the CPI API for free?

Yes, CPI is available on every plan, including Free, with no card needed for Free. Free includes 5,000 successful requests a month and the last 12 months of history; Basic includes the last 5 years, and Pro the full history.

Make your first request

Get a free API key →