← Back to API Ninjas
Get current inflation data
Returns current monthly and annual inflation percentages.
API Ninjas·$0.001 per call
Example code
// Using @orth/sdk - The simplest way to call APIs
// Install: npm install @orth/sdk
import Orthogonal from "@orth/sdk";
const orthogonal = new Orthogonal({
apiKey: process.env.ORTHOGONAL_API_KEY,
});
const output = await orthogonal.run({
api: "api-ninjas",
path: "/v1/inflation"
});
console.log(output);Query parameters
country
string
2-letter country code (ISO-3166-1 alpha-2) or name of country (case-insensitive).
type
string
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. (Allowed: CPI, HICP)