Save over 30% when you subscribe to an annual subscription plan!

Inflation API

The Inflation API provides current economic inflation data for 38 major countries. The stats are usually updated monthly - although certain countries may lag behind or update more infrequently.

Available endpoints:

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
282ms305ms357ms757ms1083ms

Didn't find what you were looking for? Suggest an improvement

/v1/inflation GET

https://api.api-ninjas.com/v1/inflation

Returns current monthly and annual inflation percentages.

The following inflation measures are available:

Country CodeCountryCPIHICP
ATAustriaYesYes
BEBelgiumYesYes
BRBrazilYes premium only-
CACanadaYes-
CLChileYes-
CNChinaYes premium only-
CZCzech RepublicYes premium onlyYes premium only
DKDenmarkYes premium onlyYes premium only
EEEstoniaYesYes
FIFinlandYes premium onlyYes
FRFranceYes premium onlyYes premium only
DEGermanyYesYes
GRGreeceYes premium onlyYes premium only
HUHungaryYesYes
ISIcelandYesYes
INIndiaYes premium only-
IDIndonesiaYes premium only-
IEIrelandYesYes
ILIsraelYes premium only-
ITItalyYes premium onlyYes premium only
JPJapanYes premium only-
MXMexicoYes-
NONorwayYes-
PLPolandYes premium onlyYes premium only
PTPortugalYesYes
RURussiaYes-
SKSlovakiaYesYes
SISloveniaYes premium onlyYes
KRSouth KoreaYes premium only-
ZASouth AfricaYes premium only-
ESSpainYes premium onlyYes premium only
SESwedenYesYes
CHSwitzerlandYes-
NLThe NetherlandsYesYes premium only
TRTürkiyeYes premium onlyYes premium only
GBUnited KingdomYes premium onlyYes premium only
USUnited StatesYes premium only-

Parameters

  • type  optional

    Inflation indicator type. Can be either CPI (Consumer Price Index) or HICP (Harmonized Index of Consumer Prices). If not provided, the CPI will be used by default.

  • country  optional

    2-letter country code (ISO-3166-1 alpha-2) or name of country (case-insensitive).

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response Fields

  • country

    The name of the country.

  • country_code

    The 2-letter country code (ISO-3166-1 alpha-2).

  • type

    The type of inflation indicator (CPI or HICP).

  • period

    The period for the inflation data.

  • monthly_rate_pct

    The monthly inflation rate as a percentage.

  • yearly_rate_pct

    The yearly inflation rate as a percentage.

Sample Request Live Demo!

Country
https://api.api-ninjas.com/v1/inflation?country=CA

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
1 2 3 4 5 6 7 8 9 10 [ { "country": "Canada", "country_code": "CA", "type": "CPI", "period": "Oct 2023", "monthly_rate_pct": 0.06, "yearly_rate_pct": 3.12 } ]

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/inflation?country=United%20States" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.

/v1/inflationhistorical GET

Business, Professional and annual plan subscribers only

https://api.api-ninjas.com/v1/inflationhistorical

Returns historical inflation rates for a given country and (optionally) time range. The maximum number of data points returned per API call is 100.

Parameters

  • country  required

    Either the 2-letter country code (ISO-3166-1 alpha-2) or the country name (case-insensitive). See the list of supported countries in the /v1/inflation endpoint above.

  • type  optional

    Inflation indicator type. Can be either CPI (Consumer Price Index) or HICP (Harmonized Index of Consumer Prices). If not provided, the CPI will be used by default.

  • start_time  optional

    Start time for the data range, specified as a UNIX timestamp in seconds.

  • end_time  optional

    End time for the data range, specified as a UNIX timestamp in seconds.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response Fields

  • type

    The type of inflation indicator (CPI or HICP).

  • country

    The name of the country.

  • country_code

    The 2-letter country code (ISO-3166-1 alpha-2).

  • data

    Array of historical inflation data points. Each element is an object containing:
    timestamp (UNIX timestamp in seconds for the data point),
    rate_pct (the inflation rate as a percentage for the given timestamp).

Sample Request Live Demo!

Country
https://api.api-ninjas.com/v1/inflationhistorical?country=CA

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 { "type": "cpi", "country": "Canada", "country_code": "CA", "data": [ { "timestamp": 1659312000, "rate_pct": 8.26 }, { "timestamp": 1661990400, "rate_pct": 8.2 }, { "timestamp": 1664582400, "rate_pct": 7.75 }, { "timestamp": 1667260800, "rate_pct": 7.11 }, ... ] }