Technical writing
BLS CPI: The Consumer Price Index and the Federal Inflation Measurement Behind Every Policy Decision
Every month, the Bureau of Labor Statistics releases a single number that moves bond markets, shapes Federal Reserve policy, sets Social Security benefit levels, adjusts union contracts, and recalibrates roughly $1.4 trillion in annual federal spending. That number is the Consumer Price Index — the United States government's official measure of inflation and the most consequential economic statistic in the world.
What the CPI Is
The Consumer Price Index measures the average change over time in the prices paid by urban consumers for a fixed market basket of goods and services. The Bureau of Labor Statistics has published it continuously since 1913, making it one of the longest uninterrupted economic time series in the federal statistical system. Each monthly release reflects price data collected from roughly 23,000 retail establishments and 50,000 housing units across 75 urban areas.
The BLS publishes two primary CPI variants that serve different policy purposes:
- CPI-U (All Urban Consumers) — the headline measure, covering approximately 93% of the US population. This is the series quoted in news coverage and the one most commonly referred to when people say “inflation.” FRED series CPIAUCSL (seasonally adjusted) and CPIAUCNS (not seasonally adjusted).
- CPI-W (Urban Wage Earners and Clerical Workers) — a narrower variant covering approximately 29% of the population, restricted to households where more than half of income comes from wage or clerical work. CPI-W is the statutory basis for the Social Security cost-of-living adjustment (COLA) and for adjustments to federal civil service retirement under CSRS.
- Chained CPI-U (C-CPI-U) — introduced in 2002, the Chained CPI uses a superlative index formula that accounts for consumer substitution between products as relative prices change. Because consumers shift spending toward goods that become relatively cheaper, the Chained CPI typically rises 0.2–0.3 percentage points per year more slowly than the fixed-weight CPI-U. Congress has debated adopting the Chained CPI for Social Security indexing; the difference compounds significantly over decades.
All three variants are published monthly. CPI-U and CPI-W are benchmarked to the 1982–84=100 base period, so the current all-items index level in the range of 310–320 means that prices have roughly tripled since the early 1980s. The Chained CPI uses a December 1999=100 base.
The Basket and Expenditure Weights
The market basket that the CPI tracks is not a fixed list of specific products. It is a weighted structure of expenditure categories, with weights set to reflect the spending patterns of urban consumers as measured by the Consumer Expenditure (CE) Survey conducted annually by BLS. The CE Survey is itself a major federal statistical effort, combining a quarterly interview survey and a two-week diary survey to capture the full range of household spending.
The approximate expenditure weights for the 2022–2024 base period are:
- Housing (shelter) — approximately 35%. The single largest category by a substantial margin. This weight alone determines more of the CPI's monthly behavior than any other component.
- Transportation — approximately 16%, encompassing new and used vehicle prices, motor fuel, vehicle insurance, and public transportation.
- Food — approximately 14%, split between food at home (groceries, FRED: CPIFABSL) and food away from home (restaurants).
- Education and communication — approximately 7%, including tuition, internet service, and telephone services.
- Medical care — approximately 7%, covering medical services, prescription drugs, and medical equipment.
- Recreation — approximately 5%.
- Apparel — approximately 3%.
- Other goods and services — approximately 13%.
The housing weight deserves particular attention because of a methodological choice that is frequently debated. The CPI measures housing costs for homeowners not through actual mortgage payments or home prices — which would make the index sensitive to interest rate changes and volatile asset markets — but through Owners' Equivalent Rent (OER): what a homeowner would hypothetically pay to rent their own home in the current market. OER is estimated by asking homeowners what they think their home would rent for and by tracking actual rents on comparable properties. OER alone accounts for roughly 25% of the entire CPI weight.
The OER methodology has critics on multiple sides. During the 2021–2023 inflation episode, OER lagged actual rent increases by 12–18 months because BLS captures the average of all leases, including long-running leases at below-market rates, not just new-lease prices. Real-time rent indices like those published by Apartment List and Zillow showed rent growth of 15–25% in 2021, while OER was still showing 4–5%. This lag caused the CPI to understate true housing cost pressures during the surge and has kept shelter inflation elevated in 2024–2025 even as market rents have decelerated — the lagged mechanics work in both directions.
CPI-U vs. the PCE Deflator: Why the Fed Uses a Different Measure
A frequent point of confusion in monetary policy analysis is that the Federal Reserve does not target CPI. The Fed's official inflation target — 2% per year — is expressed in terms of the Personal Consumption Expenditures (PCE) price index published by the Bureau of Economic Analysis. PCE typically runs 0.3–0.5 percentage points below CPI-U on a 12-month basis, and the gap is systematic, not random.
The structural differences between CPI-U and PCE matter for understanding monetary policy debates:
- Scope of spending captured. CPI measures only what consumers pay out-of-pocket. PCE includes spending on behalf of consumers by third parties — most importantly, employer-provided health insurance and Medicare and Medicaid expenditures. The result is that PCE's medical care weight is substantially larger than CPI's, and its overall scope is broader.
- Index formula. CPI uses a Laspeyres-type fixed-weight formula (updated annually). PCE uses a Fisher chain-weighted formula that continuously incorporates substitution behavior, similar to the Chained CPI-U but applied at a much finer level of detail. This formula difference accounts for roughly half of the persistent CPI–PCE gap.
- Shelter weight. Because PCE includes third-party spending, housing services are a smaller share of the PCE basket than of CPI. This means the OER lag discussed above has a smaller effect on PCE than on CPI.
- Weight updates. CPI weights are updated once every two years. PCE weights update continuously as spending patterns shift, making PCE somewhat more responsive to structural changes in the economy.
For monetary policy analysis, the practical implication is that when CPI is running at 3.5% and PCE is running at 2.8%, the Fed is closer to its target than the headline CPI number suggests. Analysts who conflate CPI and PCE will systematically misread the Fed's reaction function.
Index Structure: Core vs. Headline, Urban Areas, and Geography
The BLS publishes CPI data for the US city average, four census regions, nine census divisions, and 23 major metropolitan areas. Metro-area data is published bimonthly for smaller areas and monthly for the largest markets.
Within the all-items index, the most analytically significant distinction is betweenheadline CPI and Core CPI. Core CPI excludes food and energy — the two most volatile components of the basket. Food prices fluctuate with weather, harvests, and commodity markets. Energy prices respond to geopolitical events and seasonal demand in ways that have little to do with underlying domestic inflation dynamics.
Core CPI (FRED: CPILFESL) is the signal that policymakers and forecasters watch most closely. During energy price spikes — the 1973 oil embargo, the 2005 Gulf Coast hurricanes, the 2022 Russia-Ukraine conflict — headline CPI and core CPI diverge sharply. Core provides a more stable read on persistent inflationary pressure. The same logic applies to core PCE, which the Fed explicitly emphasizes in its communications.
Beyond headline and core, BLS publishes hundreds of sub-index series covering specific expenditure categories. Key FRED series IDs for the major components:
- CPIAUCSL — CPI-U all items, seasonally adjusted
- CPIAUCNS — CPI-U all items, not seasonally adjusted
- CPILFESL — Core CPI (ex food and energy), seasonally adjusted
- CUSR0000SAH1 — Shelter CPI, seasonally adjusted
- CPIENGSL — Energy CPI, seasonally adjusted
- CPIFABSL — Food at home (grocery) CPI
- CUSR0000SEHA — Rent of primary residence
- CUSR0000SEHC — Owners' equivalent rent
The 2021–2023 Inflation Episode
The most significant inflation episode in four decades began in early 2021 and peaked in June 2022 when headline CPI-U reached 9.1% on a 12-month basis — the highest reading since November 1981. Understanding what drove that episode and how different components behaved is essential context for interpreting CPI data going forward.
Multiple independent supply and demand shocks converged. On the demand side, the American Rescue Plan Act ($1.9 trillion in March 2021) combined with prior pandemic-era transfers to produce an extraordinary surge in household purchasing power precisely when production capacity was constrained. The Bureau of Economic Analysis reported that the personal saving rate reached 33.8% in April 2020 as households accumulated savings they could not spend; as the economy reopened, that pent-up demand was released simultaneously.
On the supply side, global semiconductor shortages cascading from factory shutdowns in Taiwan, Japan, and Malaysia crippled automotive production. New vehicle inventory fell to historic lows in 2021, and used vehicle prices responded by surging more than 40% year-over-year by mid-2021 — a category that alone contributed over one percentage point to headline CPI at the peak. Container shipping costs increased tenfold. Port congestion backed up from California to Rotterdam.
The February 2022 Russian invasion of Ukraine then delivered a second supply shock. Global energy prices spiked immediately — Brent crude reached $130/barrel in March 2022 — and the energy CPI contributed roughly 3.5 percentage points to the 9.1% June 2022 peak. European natural gas prices reached levels equivalent to $500/barrel oil, with knock-on effects on fertilizer production and food commodity prices.
The Federal Open Market Committee's response was the fastest rate-hiking cycle since the early 1980s: 525 basis points of increases between March 2022 and July 2023, raising the federal funds rate target from 0–0.25% to 5.25–5.50%. As goods prices disinflated rapidly once supply chains normalized, shelter inflation proved far stickier — the OER measurement lag meant that the lagged effect of 2021–2022 rent increases was still flowing into the CPI shelter component well into 2024, keeping core services inflation elevated even as goods deflation took hold.
By mid-2024, headline CPI had fallen to approximately 3%, core CPI to approximately 3.3%, and PCE to approximately 2.5%. The “last mile” of disinflation from 3% back to 2% proved slower than markets initially expected, largely because of the persistence in shelter components.
Social Security COLA and Federal Spending Indexation
The stakes of CPI measurement extend well beyond financial markets. Approximately $1.4 trillion in annual federal spending is indexed to CPI series, making the measurement methodology a fiscal policy question with real distributional consequences.
The Social Security Act requires that the annual cost-of-living adjustment for Social Security benefits be calculated using the average CPI-W for the third quarter (July, August, September) of the current year relative to the same period in the prior year. The resulting COLA applies to benefits beginning in January of the following year. The 2023 COLA of 8.7% — the largest since 1981 — reflected the June 2022 inflation peak flowing through the Q3 average. The 2024 COLA was 3.2%. The 2025 COLA was 2.5%.
Beyond Social Security, CPI-W indexation applies to Civil Service Retirement System (CSRS) annuities, veterans' benefits, Supplemental Nutrition Assistance Program (SNAP) benefit levels, and federal income tax bracket thresholds (which use the Chained CPI after the Tax Cuts and Jobs Act of 2017 switched the indexing formula). Federal poverty guidelines, which drive Medicaid and ACA subsidy eligibility, are also updated using CPI. A sustained one-percentage-point overstatement or understatement in CPI translates to tens of billions of dollars per year in spending differences compounded over time.
Accessing CPI Data: BLS API and FRED
BLS publishes CPI data through multiple access channels suited to different analytical needs.
The BLS Public Data API at api.bls.gov/publicAPI/v2/timeseries/data/ is the primary programmatic interface. Unregistered requests are rate-limited to 25 series queries per day and 10 years of history. Registering for a free API key raises the limit to 500 series per day and 20 years of history and enables the calculations parameter, which instructs the API to return percent-change calculations alongside raw index values, avoiding the need to compute them locally.
CPI series IDs follow a structured prefix convention. The format for the most common all-urban series is CU SR 0000 [item code] (seasonally adjusted) or CU US 0000 [item code] (not seasonally adjusted), where 0000 designates the US city average. Metropolitan area data substitutes the area code for 0000. The BLS Series ID Search tool at bls.gov allows construction of arbitrary series IDs for specific geographies and expenditure categories.
FRED (Federal Reserve Economic Data at fred.stlouisfed.org) mirrors the major CPI series and provides a convenient query interface. FRED series IDs are typically more memorable than BLS series IDs and include derived series such as CPIAUCSL. The FRED API and the fredapi Python package are alternatives to the BLS API when working with a smaller set of well-known series.
For bulk historical downloads, BLS also provides flat-file downloads at download.bls.gov/pub/time.series/cu/ covering the complete CPI database in pipe-delimited text format — useful for loading the full series catalog into a database without API rate limits.
Python: Pulling and Plotting CPI Component Inflation
The following script uses the BLS Public Data API to retrieve 10 years of monthly data for four series — headline CPI-U, core CPI, shelter CPI, and energy CPI — requests the API-computed 12-month percent changes, and plots all four on a single chart. The result shows the 2021–2023 inflation episode and the divergence between volatile energy prices and stickier shelter inflation in the disinflation phase.
import requests
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
from datetime import datetime
API_URL = "https://api.bls.gov/publicAPI/v2/timeseries/data/"
# Series IDs
# CPIAUCSL - CPI-U All Items, seasonally adjusted
# CPILFESL - Core CPI (ex food and energy), seasonally adjusted
# CUSR0000SAH1 - Shelter CPI, seasonally adjusted
# CPIENGSL - Energy CPI, seasonally adjusted
SERIES = {
"Headline CPI-U": "CPIAUCSL",
"Core CPI (ex food & energy)": "CPILFESL",
"Shelter": "CUSR0000SAH1",
"Energy": "CPIENGSL",
}
end_year = datetime.now().year
start_year = end_year - 10
headers = {"Content-Type": "application/json"}
payload = {
"seriesid": list(SERIES.values()),
"startyear": str(start_year),
"endyear": str(end_year),
"calculations": {"output_type": 1}, # include 12-month pct change
}
resp = requests.post(API_URL, json=payload, headers=headers, timeout=60)
resp.raise_for_status()
data = resp.json()
if data.get("status") != "REQUEST_SUCCEEDED":
raise RuntimeError("BLS API error: " + str(data.get("message", "")))
# Build a reverse map: series_id -> label
id_to_label = {v: k for k, v in SERIES.items()}
frames = []
for series_obj in data["Results"]["series"]:
sid = series_obj["seriesID"]
label = id_to_label.get(sid, sid)
rows = []
for obs in series_obj["data"]:
if obs.get("period", "").startswith("M") and obs["period"] != "M13":
pct = obs.get("calculations", {}).get("pct_changes", {}).get("1", None)
if pct is not None:
rows.append({
"date": pd.Period(obs["year"] + "-" + obs["period"][1:], freq="M").to_timestamp(),
"pct_change_12m": float(pct),
"series": label,
})
if rows:
frames.append(pd.DataFrame(rows))
df = pd.concat(frames, ignore_index=True)
df = df.sort_values(["series", "date"])
# Plot
fig, ax = plt.subplots(figsize=(12, 6))
line_styles = {
"Headline CPI-U": {"color": "#0b4a8f", "linewidth": 2.2, "linestyle": "-"},
"Core CPI (ex food & energy)": {"color": "#d97706", "linewidth": 2.0, "linestyle": "--"},
"Shelter": {"color": "#059669", "linewidth": 1.6, "linestyle": "-."},
"Energy": {"color": "#dc2626", "linewidth": 1.4, "linestyle": ":"},
}
for label, grp in df.groupby("series"):
style = line_styles.get(label, {})
ax.plot(grp["date"], grp["pct_change_12m"], label=label, **style)
ax.axhline(0, color="#6b7280", linewidth=0.8, linestyle="-")
ax.axhline(2.0, color="#6b7280", linewidth=0.8, linestyle="--", alpha=0.5)
ax.annotate("Fed 2% target (PCE, approx.)", xy=(df["date"].min(), 2.05),
fontsize=8, color="#6b7280")
ax.yaxis.set_major_formatter(mtick.PercentFormatter(decimals=1))
ax.set_xlabel("")
ax.set_ylabel("12-Month % Change", fontsize=10)
ax.set_title("US CPI Components: 12-Month Percent Change", fontsize=13, fontweight="bold")
ax.legend(loc="upper left", fontsize=9)
ax.grid(axis="y", linestyle=":", alpha=0.4)
fig.tight_layout()
plt.savefig("cpi_components.png", dpi=150)
plt.show()
print("Chart saved to cpi_components.png")
The calculations payload field instructs the BLS API to return percent changes alongside raw index values; output_type: 1 returns both. The 12-month change lives at obs['calculations']['pct_changes']['1'] in the response structure — the key '1' corresponds to one year. Registering for a free BLS API key and passing it as a registrationKey field in the payload raises the series limit and enables up to 20 years of history in a single request.
Substituting different FRED/BLS series IDs into the SERIES dict allows the same pattern to track metropolitan area CPI variants, specific expenditure categories like used cars or airline fares, or the CPI-W series used for Social Security COLA calculations.
Limitations and Measurement Debates
The CPI is not a perfect cost-of-living index, and BLS does not claim it is. A true cost-of-living index would hold utility — the welfare level the consumer experiences — constant rather than holding the basket of goods constant. The Boskin Commission (1996) estimated that the CPI overstated true inflation by approximately 1.1 percentage points per year due to substitution bias, outlet substitution bias, quality change, and new product bias. BLS has addressed many of those criticisms through geometric mean aggregation within categories (reducing substitution bias) and hedonic quality adjustments (particularly for electronics and vehicles), but measurement debates continue.
Geographic variation in price levels is not captured by the national CPI-U. A consumer in San Francisco and a consumer in rural Mississippi face very different absolute price levels, but both face the same CPI weight structure when their nominal incomes are adjusted by the national index. BLS publishes the American Community Survey and regional CPI variants, but there is no official county-level CPI. Research using the BEA Regional Price Parities offers the closest proxy for geographic price-level differences.
The expenditure weights reflect average urban consumer spending. Households with above- or below-average spending on housing, energy, or medical care will experience inflation very differently from the headline CPI. Elderly households, for example, spend a higher share of income on medical care and a lower share on education and transportation relative to the CPI basket — which is one reason some researchers argue that CPI-W, used for Social Security indexing, systematically understates inflation as experienced by Social Security recipients.
The Federal Reserve's preferred inflation gauge is the PCE deflator, published as part of the BEA's National Income and Product Accounts. The GDP release that includes PCE components — and the relationship between nominal and real GDP — is covered in BEA GDP Accounts: National Income, Product, and the Expenditure Framework.
Wage-price dynamics — whether rising labor costs are feeding into service-sector inflation — are most directly measured through BLS payroll and wage data at the county and industry level. See BLS QCEW: The County-Level Employment and Wages Dataset Behind Every Local Economic Analysis.
The Federal Reserve's monetary policy response to the 2021–2023 inflation episode is visible in bank balance sheet data and reserve levels tracked in the H.8 release. See Federal Reserve H.8: Assets and Liabilities of Commercial Banks in the United States.