> ## Documentation Index
> Fetch the complete documentation index at: https://docs.financialdatasets.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Financial Datasets API is served at https://api.financialdatasets.ai. Authenticate with the `X-API-KEY` header; create keys at https://financialdatasets.ai. Agents can open and fund their own account without a dashboard: see https://docs.financialdatasets.ai/agents.md.
> Tool-using agents can call Financial Datasets without writing code through the hosted MCP server at https://mcp.financialdatasets.ai/.
> The OpenAPI spec at https://financialdatasets.ai/openapi.json is the source of truth for request and response schemas.
> The index of every docs page is at https://docs.financialdatasets.ai/llms.txt. Append .md to any docs URL to get that page as Markdown.

# Inflation Data API (CPI, PCE)

> Monthly US CPI (from 1947) and PCE price index (from 1959) history in 14 series, including headline and core, with month-over-month and year-over-year changes, updated within minutes of each monthly release.

### Overview

The Financial Datasets inflation API returns the monthly US Consumer Price Index (CPI) and the Personal Consumption Expenditures (PCE) price index, one series per request, with the month-over-month and year-over-year percent changes computed for you. It covers 14 series, with CPI from 1947 and PCE from 1959 to today, updated within minutes of each monthly release. The data comes directly from authoritative government sources ([data provenance](https://docs.financialdatasets.ai/data-provenance.md)).

You can call it as a REST endpoint with an API key, or from Claude, ChatGPT, Cursor, and other AI apps through the [MCP server](https://docs.financialdatasets.ai/mcp-server.md), or pay per request with [x402](https://docs.financialdatasets.ai/x402.md). [Pricing](https://www.financialdatasets.ai/pricing) starts at \$20.

Values are index levels (1982-84 = 100 for CPI, 2017 = 100 for PCE); the changes are percentages.

To get started, please create an account and grab your **API key** at [financialdatasets.ai](https://financialdatasets.ai).

You will use the API key to authenticate your API requests.

### Coverage

| History | Series | Updated |
| - | - | - |
| 1947 to today (CPI), 1959 to today (PCE) | 14 | Within minutes of each monthly release |

### Series

CPI: six concepts, each seasonally adjusted (`_sa`) and not seasonally adjusted (`_nsa`). PCE: headline and core, seasonally adjusted only (the source publishes no unadjusted series).

| Series | What it is | From |
| - | - | - |
| `cpi_all_sa`, `cpi_all_nsa` | All items | 1947 |
| `cpi_core_sa`, `cpi_core_nsa` | All items less food and energy | 1957 |
| `cpi_food_sa`, `cpi_food_nsa` | Food | 1947 |
| `cpi_energy_sa`, `cpi_energy_nsa` | Energy | 1957 |
| `cpi_shelter_sa`, `cpi_shelter_nsa` | Shelter | 1953 |
| `cpi_services_less_energy_sa`, `cpi_services_less_energy_nsa` | Services less energy services | 1957 (NSA), 1967 (SA) |
| `pce_all_sa` | PCE price index, all items | 1959 |
| `pce_core_sa` | PCE price index, all items less food and energy | 1959 |

You can fetch this list, with each series' first available month, with a free `GET` request to:
[https://api.financialdatasets.ai/macro/inflation/series/](https://api.financialdatasets.ai/macro/inflation/series/)

### Reading the fields

* `date` is the reference month as its first day: `2026-08-01` is the August 2026 print. CPI for a month is published in the middle of the next month; PCE about two weeks after that. It is not the release date.
* `value` is the published index level: 1982-84 = 100 for the CPI series, 2017 = 100 for the PCE series. The two bases are not comparable; the percent changes are.
* `change_1m_pct` is the percent change from the prior month and `change_12m_pct` from the same month a year earlier, both rounded to one decimal. The headline "inflation rate" is `change_12m_pct` of `cpi_all_nsa`; the headline monthly figure is `change_1m_pct` of `cpi_all_sa`. The Fed's preferred measure is `change_12m_pct` of `pce_core_sa`.
* A field is `null` when the comparison month was not published. October 2025 is `null` in every series because no October 2025 CPI was published, so the November 2025 1-month change and the October 2026 12-month change are `null` too.
* History is the latest published values. When a past month is revised, the stored value is replaced.

### Getting Started

There are only 3 steps for making a successful API call:

1. Add your API key to the header of the request as `X-API-KEY`.
2. Add the `series` parameter, which is required. Optionally add `start_date` and `end_date` (inclusive, `YYYY-MM-DD`; any day inside a month selects that month). With no dates you get the trailing five years.
3. Execute the API request.

Rows come newest first in pages of up to 10. When more rows remain, the response includes a `next_page_url`; request it as-is to get the next page. See the [pagination guide](https://docs.financialdatasets.ai/guides/pagination.md).

### Example

```python Inflation theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import requests

# add your API key to the headers
headers = {
    "X-API-KEY": "your_api_key_here"
}

# set parameters
series = 'cpi_all_sa'      # required
start_date = '2025-09-01'  # optional
end_date = '2026-08-31'    # optional

# create the URL with parameters
url = (
    f'https://api.financialdatasets.ai/macro/inflation'
    f'?series={series}'
    f'&start_date={start_date}'
    f'&end_date={end_date}'
)

# make API request
response = requests.get(url, headers=headers)

# parse the observations from the response
inflation = response.json().get('inflation')
```

### Example Response

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "inflation": [
    {
      "series": "cpi_all_sa",
      "date": "2026-08-01",
      "value": 334.131,
      "change_1m_pct": 0.4,
      "change_12m_pct": 3.4
    }
  ]
}
```

### FAQ

#### Which series is the headline inflation rate?

The headline inflation rate is `change_12m_pct` of `cpi_all_nsa`. The headline monthly figure is `change_1m_pct` of `cpi_all_sa`. The Fed's preferred measure is `change_12m_pct` of `pce_core_sa`.

#### How fast is a new print available?

Within minutes of each monthly release. CPI for a month is published in the middle of the next month, and PCE about two weeks after that.

#### Are revisions included?

Yes. History holds the latest published values. When a past month is revised, the stored value is replaced.

#### Can an AI agent use this data?

Yes. Claude, ChatGPT, Cursor, and other MCP clients reach it through the [Financial Datasets MCP server](https://docs.financialdatasets.ai/mcp-server.md). An agent with a wallet can also pay per request with [x402](https://docs.financialdatasets.ai/x402.md), with no account.


## OpenAPI

````yaml GET /macro/inflation
openapi: 3.0.1
info:
  title: Financial Datasets API
  description: >-
    Stock market API with real-time and historical financial data for 27,000+
    tickers over 30+ years. Financial statements, equity prices, insider trades,
    SEC filings, and more.
  version: 1.0.0
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  contact:
    name: API Support
    url: mailto:support@financialdatasets.ai
    email: support@financialdatasets.ai
  termsOfService: https://financialdatasets.ai/terms-of-use
servers:
  - url: https://api.financialdatasets.ai/
    description: Production server
security:
  - X-API-KEY: []
tags:
  - name: Financial Statements
    description: Access to income statements, balance sheets, and cash flow statements
  - name: Market Data
    description: Real-time and historical price data
  - name: Company Information
    description: Company facts like ticker, name, and description
  - name: Earnings
    description: Earnings data and related information
  - name: News
    description: Real-time and historical news articles
  - name: SEC Filings
    description: SEC filings and regulatory documents
  - name: Insider Trades
    description: Insider trading activity and transactions
  - name: Insider Sale Notices
    description: SEC Form 144 notices of proposed insider stock sales
  - name: Politician Trades
    description: Stock trades disclosed by members of Congress
  - name: Activist Ownership
    description: Activist stakes from SEC Schedule 13D filings, in real time
  - name: Beneficial Ownership
    description: >-
      Holders of more than 5% of a company's shares, from SEC Schedules 13D and
      13G
  - name: Insider Ownership
    description: Insider ownership statements from SEC Forms 3 and 5
  - name: Institutional Holdings
    description: SEC-direct 13F equity holdings of institutional investment managers
  - name: IPOs
    description: >-
      Upcoming IPOs from SEC registration statements (Form S-1), with extracted
      pre-IPO financial statements
  - name: Index Funds
    description: >-
      ETF and index-fund holdings, weights, and the funds that hold a given
      security
  - name: Financial Metrics
    description: Financial ratios, metrics, and key performance indicators
  - name: Macroeconomics
    description: Real-time and historical macroeconomic data like interest rates
  - name: KPIs
    description: Sector-specific operational KPIs extracted from earnings releases.
  - name: Agent Account
    description: Self-serve account creation and funding for AI agents.
  - name: Search
    description: Search financial documents with one question and get cited passages back
paths:
  /macro/inflation:
    get:
      tags:
        - Macroeconomics
      summary: Inflation (Historical)
      description: >-
        Monthly US inflation history for one series (consumer price index or PCE
        price index), newest first, with the month-over-month and year-over-year
        percent changes. Dates are reference months (first day of the month).
        Values are index levels (1982-84 = 100 for CPI, 2017 = 100 for PCE),
        sourced from authoritative government sources. A change is null when the
        comparison month was not published.
      operationId: getInflation
      parameters:
        - name: series
          in: query
          description: >-
            The series id, e.g. cpi_all_sa or pce_core_sa. CPI: six concepts
            (all items, core, food, energy, shelter, services less energy), each
            seasonally adjusted (_sa) and not (_nsa). PCE: pce_all_sa and
            pce_core_sa. Use the /macro/inflation/series endpoint to get the
            list.
          required: true
          schema:
            type: string
        - name: start_date
          in: query
          description: >-
            The first month to return, inclusive, in YYYY-MM-DD format; any day
            inside a month selects that month. Defaults to five years before
            end_date when both dates are omitted; omit it with an end_date to
            get all available history through that month.
          required: false
          schema:
            type: string
        - name: end_date
          in: query
          description: >-
            The last month to return, inclusive, in YYYY-MM-DD format. Defaults
            to today.
          required: false
          schema:
            type: string
        - name: cursor
          in: query
          description: >-
            Opaque pagination cursor from a previous response's next_page_url.
            When provided, all other query parameters are ignored: the cursor
            carries the original request's filters. Treat it as opaque; do not
            construct or modify it.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Inflation response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InflationResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/PaymentRequiredError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  schemas:
    InflationResponse:
      type: object
      properties:
        inflation:
          type: array
          items:
            $ref: '#/components/schemas/InflationObservation'
        next_page_url:
          type: string
          description: >-
            Absolute URL of the next page of results. Present only when more
            results remain; request it as-is to continue. Each page holds up to
            10 records.
    InflationObservation:
      type: object
      properties:
        series:
          type: string
          description: The series id, e.g. cpi_all_sa or pce_core_sa.
        date:
          type: string
          description: >-
            The reference month as its first day in YYYY-MM-DD format, e.g.
            2026-08-01 for August 2026. Not the release date.
        value:
          type: number
          nullable: true
          description: >-
            The published index level (1982-84 = 100 for CPI series, 2017 = 100
            for PCE series). Null when the month was not published.
        change_1m_pct:
          type: number
          nullable: true
          description: >-
            Percent change from the prior month, rounded to one decimal. Null
            when either month was not published.
        change_12m_pct:
          type: number
          nullable: true
          description: >-
            Percent change from the same month a year earlier, rounded to one
            decimal. Null when either month was not published. For cpi_all_nsa
            this is the headline inflation rate; for pce_core_sa it is the
            Federal Reserve's preferred measure.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: A short error message.
        message:
          type: string
          description: A more detailed error message.
  responses:
    BadRequestError:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Bad Request
            message: Invalid request parameters
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Unauthorized
            message: Invalid API key provided
    PaymentRequiredError:
      description: The request requires a paid subscription
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Payment Required
            message: >-
              This endpoint requires a paid subscription. Please upgrade your
              plan.
    NotFoundError:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Not Found
            message: Ticker XXXX not found
  securitySchemes:
    X-API-KEY:
      type: apiKey
      name: X-API-KEY
      description: API key for authentication.
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.