Inflation

Historical and current CPI inflation rates for 241 countries, sourced from the World Bank. Returns up to 30 years of annual data per country.

Get API Key

Vue d'ensemble

Cas d'utilisation

  • Economic dashboards and financial research tools
  • Country comparison and risk analysis
  • Inflation-adjusted financial modelling
  • Macroeconomics education platforms
  • Investment research and reporting

Fonctionnalités

241 countries covered
Up to 30 years of annual CPI data
Sourced from the World Bank (FP.CPI.TOTL.ZG indicator)
Current rate and 10 years of history in a single request
ISO 3166-1 alpha-2 country codes
Batch endpoint for up to 50 countries per request

Points de terminaison de l'API

Get Inflation Rate

Returns the latest annual CPI inflation rate for a country plus the previous 10 years of historical data.

GET
https://requiems.xyz/v1/finance/inflation

Paramètres

Nom Type Requis Description
country string Requis ISO 3166-1 alpha-2 country code (e.g. US, GB, DE). Case-insensitive.

Essayez-le

Démo en direct
Requête

ISO 3166-1 alpha-2 country code (e.g. US, GB, DE). Case-insensitive.

Champs de réponse

Champ Type Description
country string ISO 3166-1 alpha-2 country code, uppercased
rate number Latest annual CPI inflation rate as a percentage (e.g. 2.9495 means 2.9495%)
period string Year of the latest data point (e.g. 2024)
historical array<object> Up to 10 previous years of inflation data, ordered newest to oldest
historical[].period string Year of the historical data point
historical[].rate number Annual CPI inflation rate for that year

Exemples de code

curl "https://requiems.xyz/v1/finance/inflation?country=US" \
  -H "requiems-api-key: YOUR_API_KEY"

Réponses d'erreur

bad_request

The country parameter is missing or is not a valid ISO 3166-1 alpha-2 code.

not_found

No inflation data found for the given country code.

internal_error

Unexpected server error.

Batch Inflation Rates

Returns inflation data for up to 50 countries in a single request. Results are in the same order as the input. Countries with no data return found: false instead of failing the whole request. Billing: 1 credit per country (not per HTTP request).

POST
https://requiems.xyz/v1/finance/inflation/batch

Paramètres

Nom Type Requis Description
countries array<string> Requis Array of ISO 3166-1 alpha-2 country codes. Min: 1, Max: 50.

Essayez-le

Démo en direct
Requête

Array of ISO 3166-1 alpha-2 country codes. Min: 1, Max: 50.

Champs de réponse

Champ Type Description
results array<object> One entry per country, in the same order as the input array
results[].country string ISO 3166-1 alpha-2 country code, uppercased
results[].found boolean false when the country has no data in the World Bank set
results[].rate number Latest CPI inflation rate. Omitted when found: false
results[].period string Year of the latest data point. Omitted when found: false
results[].historical array<object> Up to 10 previous years. Omitted when found: false
total integer Total number of results returned (equals number of countries sent)

Exemples de code

curl -X POST "https://requiems.xyz/v1/finance/inflation/batch" \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"countries": ["US", "AR", "DE"]}'

Réponses d'erreur

validation_failed

Body is invalid: empty array, more than 50 items, or a bad country code.

internal_error

Unexpected server error.

Foire aux questions