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:
- /v1/inflation - Get current monthly and annual inflation percentages
- /v1/inflationhistorical - Get historical inflation rates for a given country and time range
From 8,147 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 275ms | 318ms | 363ms | 592ms | 1153ms |
Similar APIs
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 Code | Country | CPI | HICP |
|---|---|---|---|
| AT | Austria | Yes | Yes |
| BE | Belgium | Yes | Yes |
| BR | Brazil | Yes premium only | - |
| CA | Canada | Yes | - |
| CL | Chile | Yes | - |
| CN | China | Yes premium only | - |
| CZ | Czech Republic | Yes premium only | Yes premium only |
| DK | Denmark | Yes premium only | Yes premium only |
| EE | Estonia | Yes | Yes |
| FI | Finland | Yes premium only | Yes |
| FR | France | Yes premium only | Yes premium only |
| DE | Germany | Yes | Yes |
| GR | Greece | Yes premium only | Yes premium only |
| HU | Hungary | Yes | Yes |
| IS | Iceland | Yes | Yes |
| IN | India | Yes premium only | - |
| ID | Indonesia | Yes premium only | - |
| IE | Ireland | Yes | Yes |
| IL | Israel | Yes premium only | - |
| IT | Italy | Yes premium only | Yes premium only |
| JP | Japan | Yes premium only | - |
| MX | Mexico | Yes | - |
| NO | Norway | Yes | - |
| PL | Poland | Yes premium only | Yes premium only |
| PT | Portugal | Yes | Yes |
| RU | Russia | Yes | - |
| SK | Slovakia | Yes | Yes |
| SI | Slovenia | Yes premium only | Yes |
| KR | South Korea | Yes premium only | - |
| ZA | South Africa | Yes premium only | - |
| ES | Spain | Yes premium only | Yes premium only |
| SE | Sweden | Yes | Yes |
| CH | Switzerland | Yes | - |
| NL | The Netherlands | Yes | Yes premium only |
| TR | Türkiye | Yes premium only | Yes premium only |
| GB | United Kingdom | Yes premium only | Yes premium only |
| US | United States | Yes premium only | - |
Parameters
typeoptionalInflation indicator type. Can be either
CPI(Consumer Price Index) orHICP(Harmonized Index of Consumer Prices). If not provided, theCPIwill be used by default.countryoptional2-letter country code (ISO-3166-1 alpha-2) or name of country (case-insensitive).
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
countryThe name of the country.
country_codeThe 2-letter country code (ISO-3166-1 alpha-2).
typeThe type of inflation indicator (CPI or HICP).
periodThe period for the inflation data.
monthly_rate_pctThe monthly inflation rate as a percentage.
yearly_rate_pctThe yearly inflation rate as a percentage.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/inflation?country=CAHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
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
countryrequiredEither 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.
typeoptionalInflation indicator type. Can be either
CPI(Consumer Price Index) orHICP(Harmonized Index of Consumer Prices). If not provided, theCPIwill be used by default.start_timeoptionalStart time for the data range, specified as a UNIX timestamp in seconds.
end_timeoptionalEnd time for the data range, specified as a UNIX timestamp in seconds.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
typeThe type of inflation indicator (CPI or HICP).
countryThe name of the country.
country_codeThe 2-letter country code (ISO-3166-1 alpha-2).
dataArray of historical inflation data points, each containing:
timestampUNIX timestamp in seconds for the data point.
rate_pctThe inflation rate as a percentage for the given timestamp.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/inflationhistorical?country=CAHeaders
X-Api-KeyLog in or sign up to get your API Key