apyhub
Back
▣ VERIFICATION KIT

Country Inflation & CPI Data API

What it does

The Country Inflation API returns CPI and related economic data by country in one request. Send mode to choose latest, history, monthly, adjust, indicators, or countries. You can also send limit, countries, indicator, startYear, endYear, startMonth, or endMonth when the mode needs them. For adjust, send amount, country, fromYear, toYear, fromMonth, or toMonth to compare money across time.

You get back summary counts and rows with the country name, country code, indicator name, year, value, change, unit, source, and fetch time. Some rows also include the prior year or prior value. Monthly calls can include monthly HICP data.

Teams use the Country Inflation API to show inflation charts in finance tools. They use it to compare markets in reports. They also use it to adjust old prices for a country-based calculator.

To match country codes with names, use the Countries Dictionary API. To convert values after inflation, use the Currency Converter API.

POST
Inflation API - CPI & Economic Indicators by Country
https://api.eu.apyhub.com/martin10291/country-inflation-cpi-data

QUICKSTART

GUIDE

Quickstart

Get the latest inflation and CPI rows for a few countries in one request.

curl -X POST "https://api.eu.apyhub.com/martin10291/country-inflation-cpi-data" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"latest","countries":["US","DE","BG"]}'

What you'll get back

Returns a JSON object with billed as an integer, count as an integer, and items as an array of result objects.

Each item may include fields such as iso3, unit, year, value, change, source, country, fetchedAt, indicator, countryName, monthlyHicp, previousYear, indicatorCode, and previousValue.

{
  "billed": 3,
  "count": 3,
  "items": [
    {
      "iso3": "USA",
      "country": "US",
      "indicator": "inflation",
      "year": 2023,
      "value": 4.1
    }
  ]
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
latest = newest yearly value per country and indicator (EU countries also get the newest monthly HICP); history = one row per country and year; monthly = Eurostat HICP per month (EU/EEA/candidate countries); adjust = what an amount from one year (or month) is worth in another, using the official.
Maximum rows returned. Between 1 and 20000.
For adjust: the money amount to convert, e.g. 100. Default 100.

About this endpoint

What it does

Returns CPI and related economic-indicator data by country based on the selected mode. The request body controls which dataset is returned, and the response contains summary fields plus an items array of result rows.

Request Body

ParameterTypeMandatoryDescription
modeENUMNoOne of latest, history, monthly, adjust, indicators, countries. latest returns the newest yearly value per country and indicator; history returns one row per country and year; monthly returns Eurostat HICP per month; adjust converts an amount between years or months; indicators and countries are also supported by the schema. Default: latest.
limitIntegerNoMaximum rows returned. Default: 20. Minimum: 1. Maximum: 100.
amountNumberNoFor adjust: the money amount to convert. Default: 100.
toYearIntegerNoFor adjust: the target year.
countryStringNoFor adjust: one country, such as US or Germany. Default: US.
endYearIntegerNoFor history: last year.
toMonthStringNoFor adjust with monthly precision (EU countries, HICP index): YYYY-MM.
endMonthStringNoFor monthly: last month, YYYY-MM.
fromYearIntegerNoFor adjust: the year of the original amount.
countriesString ArrayNoISO2 codes (US, DE, BG), ISO3 codes (USA, BGR), or English names (Germany). Up to 50 values. Empty defaults to US, DE, GB, JP, BG.
fromMonthStringNoFor adjust with monthly precision (EU countries, HICP index): YYYY-MM.
indicatorStringNoFor history: one indicator key, such as inflation or gdpGrowth. Default: inflation.
startYearIntegerNoFor history: first year, 1960 or later.
indicatorsString ArrayNoFor latest: indicator keys such as inflation, cpi, gdp, gdpGrowth, gdpPerCapita, unemployment, population, interestRate, or a raw World Bank code such as FP.CPI.TOTL.ZG. Empty defaults to inflation.
startMonthStringNoFor monthly: first month, YYYY-MM. Default: 24 months back.

Response

Returns a JSON object with billed and count integer fields, plus an items array of result objects. Each item can include fields such as iso3, unit, year, value, change, source, country, fetchedAt, indicator, countryName, monthlyHicp, previousYear, indicatorCode, and previousValue, depending on the selected mode and data returned.

ParameterTypeMandatoryDescription
billedIntegerNoUnits charged for this call. Only result rows are billed; not-found, unavailable, and invalid rows are free.
countIntegerNoNumber of rows in items.
itemsObject ArrayNoResult rows. The item object may contain iso3, unit, year, value, change, source, country, fetchedAt, indicator, countryName, monthlyHicp, previousYear, indicatorCode, and previousValue fields.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.