curl --request GET \
--url https://api.financialdatasets.ai/macro/inflation \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.financialdatasets.ai/macro/inflation"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.financialdatasets.ai/macro/inflation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.financialdatasets.ai/macro/inflation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.financialdatasets.ai/macro/inflation"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.financialdatasets.ai/macro/inflation")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.financialdatasets.ai/macro/inflation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"inflation": [
{
"series": "<string>",
"date": "<string>",
"value": 123,
"change_1m_pct": 123,
"change_12m_pct": 123
}
],
"next_page_url": "<string>"
}{
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"error": "Unauthorized",
"message": "Invalid API key provided"
}{
"error": "Payment Required",
"message": "This endpoint requires a paid subscription. Please upgrade your plan."
}{
"error": "Not Found",
"message": "Ticker XXXX not found"
}Historical
Get monthly US inflation history: headline and core CPI since 1947 plus food, energy, shelter, and services, and the headline and core PCE price index since 1959, with month-over-month and year-over-year changes.
curl --request GET \
--url https://api.financialdatasets.ai/macro/inflation \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.financialdatasets.ai/macro/inflation"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.financialdatasets.ai/macro/inflation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.financialdatasets.ai/macro/inflation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.financialdatasets.ai/macro/inflation"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.financialdatasets.ai/macro/inflation")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.financialdatasets.ai/macro/inflation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"inflation": [
{
"series": "<string>",
"date": "<string>",
"value": 123,
"change_1m_pct": 123,
"change_12m_pct": 123
}
],
"next_page_url": "<string>"
}{
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"error": "Unauthorized",
"message": "Invalid API key provided"
}{
"error": "Payment Required",
"message": "This endpoint requires a paid subscription. Please upgrade your plan."
}{
"error": "Not Found",
"message": "Ticker XXXX not found"
}Overview
The Inflation API lets you pull the monthly US Consumer Price Index (CPI) and the Personal Consumption Expenditures (PCE) price index, the Federal Reserve’s preferred inflation gauge, for one series at a time, with the month-over-month and year-over-year percent changes computed for you. We source the data directly from authoritative government sources. 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. 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 |
GET request to:
https://api.financialdatasets.ai/macro/inflation/series/
Reading the fields
dateis the reference month as its first day:2026-08-01is 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.valueis 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_pctis the percent change from the prior month andchange_12m_pctfrom the same month a year earlier, both rounded to one decimal. The headline “inflation rate” ischange_12m_pctofcpi_all_nsa; the headline monthly figure ischange_1m_pctofcpi_all_sa. The Fed’s preferred measure ischange_12m_pctofpce_core_sa.- A field is
nullwhen the comparison month was not published. October 2025 isnullin every series because no October 2025 CPI was published, so the November 2025 1-month change and the October 2026 12-month change arenulltoo. - 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:- Add your API key to the header of the request as
X-API-KEY. - Add the
seriesparameter, which is required. Optionally addstart_dateandend_date(inclusive,YYYY-MM-DD; any day inside a month selects that month). With no dates you get the trailing five years. - Execute the API request.
next_page_url; request it as-is to get the next page. See the pagination guide.
Example
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
{
"inflation": [
{
"series": "cpi_all_sa",
"date": "2026-08-01",
"value": 334.131,
"change_1m_pct": 0.4,
"change_12m_pct": 3.4
}
]
}
Authorizations
API key for authentication.
Query Parameters
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.
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.
The last month to return, inclusive, in YYYY-MM-DD format. Defaults to today.
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.