api-ninjas-com Inflation API

The Inflation API provides current economic inflation data for major countries, with options for CPI and HICP indicators.

Operations 2

GET /v1/inflation Get current inflation data #
GET /v1/inflationhistorical Get historical inflation rates #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-inflation-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-inflation-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Inflation API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Inflation
  description: The Inflation API provides current economic inflation data for major countries, with options for CPI and HICP indicators.
paths:
  /v1/inflation:
    get:
      tags:
      - Inflation
      summary: Get current inflation data
      description: Returns current monthly and annual inflation percentages. Premium subscribers only.
      operationId: getCurrentInflation
      parameters:
      - $ref: '#/components/parameters/Country'
      - $ref: '#/components/parameters/Type'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InflationResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InflationOpenapi_ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InflationOpenapi_ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InflationOpenapi_ErrorResponse'
      security:
      - ApiKeyAuth: []
  /v1/inflationhistorical:
    get:
      tags:
      - Inflation
      summary: Get historical inflation rates
      description: Returns historical inflation rates for a given country and (optionally) time range. The maximum number of data points returned per API call is 100. Premium subscribers only.
      operationId: getHistoricalInflation
      parameters:
      - name: country
        in: query
        required: true
        schema:
          type: string
        description: Either the 2-letter country code (ISO-3166-1 alpha-2) or the country name (case-insensitive).
      - name: start_time
        in: query
        required: false
        schema:
          type: integer
        description: Start time for the data range, specified as a UNIX timestamp in seconds.
      - name: end_time
        in: query
        required: false
        schema:
          type: integer
        description: End time for the data range, specified as a UNIX timestamp in seconds.
      - name: type
        in: query
        required: false
        schema:
          type: string
          enum:
          - CPI
          - HICP
        description: 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.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricalInflationResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InflationOpenapi_ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InflationOpenapi_ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InflationOpenapi_ErrorResponse'
      security:
      - ApiKeyAuth: []
components:
  parameters:
    Country:
      name: country
      in: query
      description: 2-letter country code (ISO-3166-1 alpha-2) or name of country (case-insensitive).
      required: false
      schema:
        type: string
    Type:
      name: type
      in: query
      description: 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.
      required: false
      schema:
        type: string
        enum:
        - CPI
        - HICP
  schemas:
    InflationResponse:
      type: array
      items:
        type: object
        properties:
          country:
            type: string
            description: The name of the country.
          country_code:
            type: string
            description: The 2-letter country code (ISO-3166-1 alpha-2).
          type:
            type: string
            description: The type of inflation indicator (CPI or HICP).
          period:
            type: string
            description: The period for the inflation data.
          monthly_rate_pct:
            type: number
            description: The monthly inflation rate as a percentage.
          yearly_rate_pct:
            type: number
            description: The yearly inflation rate as a percentage.
    HistoricalInflationResponse:
      type: object
      properties:
        type:
          type: string
          description: The type of inflation indicator (CPI or HICP).
        country:
          type: string
          description: The name of the country.
        country_code:
          type: string
          description: The 2-letter country code (ISO-3166-1 alpha-2).
        data:
          type: array
          items:
            type: object
            properties:
              timestamp:
                type: integer
                description: UNIX timestamp in seconds for the data point.
              rate_pct:
                type: number
                description: The inflation rate as a percentage for the given timestamp.
          description: Array of historical inflation data points.
    InflationOpenapi_ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message describing the failure.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api