{
  "openapi": "3.1.0",
  "info": {
    "title": "Inflation API",
    "version": "1.0.0",
    "description": "US inflation calculator and CPI data since 1913: what $100 from 1990 is worth today, and why.\n\nUS inflation, answered the way people actually ask: what is $100 from 1990 worth today? ($246.32.) Built on the official BLS Consumer Price Index — 405,747 monthly and annual values across 726 US-average series, the all-items index back to 1913 and granular categories from eggs to gasoline to rent — refreshed daily so each mid-month CPI release lands automatically. The calculator endpoint converts any amount between any two years or months since 1913; the rate endpoint returns year-over-year inflation for any period (2022: 8.0%, June 2022: 9.1% — matching BLS published figures exactly) for the headline index or any category; the history endpoint returns a century of annual inflation rates in one call; and raw CPI series are queryable for charting. A dollar from 1913 resolves to $32.52. Built for fintech and payroll products, pricing and contract-escalation tools, real-estate and salary calculators, journalism and education. Public-domain BLS data, self-hosted — no third-party calls at request time.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/inflation.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/inflation"
  },
  "servers": [
    {
      "url": "https://api-inflation.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Finance",
      "description": "Inflation API belongs to the Finance category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/inflation/history": {
      "get": {
        "operationId": "annualInflationHistory",
        "summary": "Annual Inflation History",
        "description": "Annual Inflation History endpoint of the Inflation API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/inflation/annual-inflation-history"
        },
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2019"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2023"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "count": 5,
                  "results": [
                    {
                      "year": 2019,
                      "cpi": 255.657,
                      "inflation_rate_pct": 1.81
                    },
                    {
                      "year": 2020,
                      "cpi": 258.811,
                      "inflation_rate_pct": 1.23
                    },
                    {
                      "year": 2021,
                      "cpi": 270.97,
                      "inflation_rate_pct": 4.7
                    },
                    {
                      "year": 2022,
                      "cpi": 292.655,
                      "inflation_rate_pct": 8
                    },
                    {
                      "year": 2023,
                      "cpi": 304.702,
                      "inflation_rate_pct": 4.12
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/cpi/series": {
      "get": {
        "operationId": "cpiSeriesCatalog",
        "summary": "CPI Series Catalog",
        "description": "CPI Series Catalog endpoint of the Inflation API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/inflation/cpi-series-catalog"
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "50"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "gasoline"
          },
          {
            "name": "seasonal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "U"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "count": 4,
                  "series": [
                    {
                      "id": "CUUR0000SETB01",
                      "item_code": "SETB01",
                      "name": "Gasoline (all types)",
                      "seasonal": "U",
                      "begin_year": 1935,
                      "end_year": 2026
                    },
                    {
                      "id": "CUUR0000SS47014",
                      "item_code": "SS47014",
                      "name": "Gasoline, unleaded regular",
                      "seasonal": "U",
                      "begin_year": 1976,
                      "end_year": 2026
                    },
                    {
                      "id": "CUUR0000SS47015",
                      "item_code": "SS47015",
                      "name": "Gasoline, unleaded midgrade",
                      "seasonal": "U",
                      "begin_year": 1993,
                      "end_year": 2026
                    },
                    {
                      "id": "CUUR0000SS47016",
                      "item_code": "SS47016",
                      "name": "Gasoline, unleaded premium",
                      "seasonal": "U",
                      "begin_year": 1981,
                      "end_year": 2026
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/cpi": {
      "get": {
        "operationId": "cpiValues",
        "summary": "CPI Values",
        "description": "CPI Values endpoint of the Inflation API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/inflation/cpi-values"
        },
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2025"
          },
          {
            "name": "series",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "CUUR0000SA0"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2026"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "series": "CUUR0000SA0",
                  "series_name": "All items",
                  "count": 6,
                  "values": [
                    {
                      "year": 2025,
                      "month": 1,
                      "value": 317.671
                    },
                    {
                      "year": 2025,
                      "month": 2,
                      "value": 319.082
                    },
                    {
                      "year": 2025,
                      "month": 3,
                      "value": 319.799
                    },
                    {
                      "year": 2025,
                      "month": 4,
                      "value": 320.795
                    },
                    {
                      "year": 2025,
                      "month": 5,
                      "value": 321.465
                    },
                    {
                      "year": 2025,
                      "month": 6,
                      "value": 322.561
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/sources": {
      "get": {
        "operationId": "dataSources",
        "summary": "Data Sources",
        "description": "Data Sources endpoint of the Inflation API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/inflation/data-sources"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "attribution": "CPI-U, US city average, 1982-84=100 (BLS, public domain)",
                  "count": 1,
                  "sources": [
                    {
                      "slug": "bls-cpi",
                      "name": "Consumer Price Index (CPI-U, US city average)",
                      "publisher": "US Bureau of Labor Statistics",
                      "licence": "US Government work - public domain",
                      "source_url": "https://www.bls.gov/cpi/",
                      "file_url": "https://download.bls.gov/pub/time.series/cu/cu.data.2.Summaries",
                      "cadence": "monthly (mid-month release)",
                      "record_count": 435095,
                      "retrieved_at": "2026-09-06"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/inflation/calculator": {
      "get": {
        "operationId": "inflationCalculator",
        "summary": "Inflation Calculator",
        "description": "Inflation Calculator endpoint of the Inflation API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/inflation/inflation-calculator"
        },
        "parameters": [
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "100"
          },
          {
            "name": "from_month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "6"
          },
          {
            "name": "from_year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "1990"
          },
          {
            "name": "to_month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "6"
          },
          {
            "name": "to_year",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2025"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "amount": 100,
                  "from": {
                    "year": 1990,
                    "month": 6,
                    "cpi": 129.9
                  },
                  "to": {
                    "year": 2025,
                    "month": 6,
                    "cpi": 322.561
                  },
                  "adjusted_amount": 248.31,
                  "factor": 2.4831,
                  "cumulative_inflation_pct": 148.31
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/inflation/rate": {
      "get": {
        "operationId": "inflationRate",
        "summary": "Inflation Rate",
        "description": "Inflation Rate endpoint of the Inflation API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/inflation/inflation-rate"
        },
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "6"
          },
          {
            "name": "series",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "CUUR0000SA0"
          },
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2022"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "series": "CUUR0000SA0",
                  "series_name": "All items",
                  "period": {
                    "year": 2022,
                    "month": 6
                  },
                  "cpi": 296.311,
                  "previous_cpi": 271.696,
                  "inflation_rate_pct": 9.06
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}