In September 2026, 103.95 dollars has the buying power of 100 dollars in November 2025, using CPI indexes of 336.940 and 324.122 respectively. To adjust a price, multiply it by the CPI index of the later month divided by the index of the earlier month.
Adjust the price with the API
The calculation is adjusted = price x CPI(to month) / CPI(from month). Keep the amount attached to its original month, then choose the month whose buying power you want to express it in. The later month's index goes on top of the fraction, and the earlier month's index goes underneath.
- Set up your API key Get a free key and keep it in the environment variable
NARWHAL_API_KEY. The request sends that value in theAuthorization: Bearer YOUR_KEYheader. - Choose the price months For the US example, request
GET /v1/economics/USA/cpi/observations?start=2025-11&end=2026-09. Use November 2025 as the original month and September 2026 as the month you want to express the amount in. - Read the indexes and calculate the amount Use the country's CPI that matches the currency of the price. The script reads the returned observations by period, divides the September 2026 index by the November 2025 index, and multiplies the original amount by that ratio.Python, adjust 100 dollars from November 2025 to September 2026
import os import requests r = requests.get("https://api.narwhalapi.com/v1/economics/USA/cpi/observations", params={"start": "2025-11", "end": "2026-09"}, headers={"Authorization": f"Bearer {os.environ['NARWHAL_API_KEY']}"}, timeout=10) r.raise_for_status() cpi = {o["period"]: float(o["value"]) for o in r.json()["observations"]} def adjust(amount: float, from_period: str, to_period: str) -> float: """Express an amount from one month in the money of another month: amount x CPI(to) / CPI(from).""" return amount * cpi[to_period] / cpi[from_period] print(round(adjust(100, "2025-11", "2026-09"), 2)) - Read the result for the chosen period The script prints
103.95, the dollar amount for September 2026 corresponding to 100 dollars in November 2025. If you need an index for a single month, useGET /v1/economics/USA/cpi?period=2025-11.
The response's observations list contains the period and value for each observation. The script converts those values to numbers and stores them by month. Its adjust function takes an amount and the month labels, then reads the corresponding indexes from that dictionary. Both month labels need to be present in the returned observations. Use the full CPI values in the division and round the resulting dollar amount, as the script does for the September 2026 result.
For a historical request, look at the first returned date. A start date earlier than your plan window moves up to the window's first day without an error, so a response can begin later than you asked. 403 plan_upgrade_required applies when the whole range ends before the window, or when a single date or period is outside it. For longer history, see plans and limits.
Adjust the price in a sheet or calculator
For one amount in a country with a calculator page, use the inflation calculator. Choose the country that matches the money and the months that match the comparison. The amount still belongs to the original month; the result expresses its buying power in the other month.
In a sheet, put the earlier CPI index in B1 and the later CPI index in B2. For 100 dollars, use the formula below. With the November 2025 US index in B1 and the September 2026 US index in B2, the calculation uses the same ratio as the Python script.
=100*B2/B1The order of the cells matters because the formula multiplies by the later index and divides by the earlier one. Keep those month labels alongside the CPI values so the amount, the starting month and the ending month stay connected.
For a column of prices with dates, use the script. Each calculation needs the original amount and its month, along with the month you want to express it in. The function can use different amounts and month labels from the returned observations; the CPI ratio depends on the months selected for each price.
Which month should I use for a yearly price?
Use the month of the price, or the annual average if the price is an annual figure. Be consistent about that choice across the comparison. A price attached to November 2025 uses that month's CPI; an annual figure can use the annual average.
Decide whether the price refers to a month or a year before choosing the index. That determines which CPI value belongs in the earlier part of the calculation and which belongs in the later part.
Can I use US inflation for a price in another currency?
Use the CPI of the country whose money the price is in. For euro prices, use the euro-area or country index you choose. Keep that choice consistent when selecting the earlier and later CPI values.
The dollar example uses US CPI for both November 2025 and September 2026. For a price in another currency, make the country choice before applying the ratio to the amount.
Can I adjust a price for a future month?
A future adjustment needs an assumption of your own because CPI is only published for past months. The formula needs an index for the month you want to express the price in; a future month's CPI is a forecast assumption.
Keep the period attached to any forecast amount. The November 2025 to September 2026 example uses CPI values for those months, while an amount expressed in a future month's money depends on the assumption you choose.
Worked example: a 100 dollar purchase in November 2025
Start with the November 2025 price of 100 dollars. Use the US CPI index of 324.122 for November 2025 and 336.940 for September 2026. Both use the index base 1982-84=100.
| Step | Calculation | Result |
|---|---|---|
| Divide the September 2026 index by the November 2025 index | 336.940 / 324.122 | 1.03955 |
| Multiply the November 2025 price by the CPI ratio | 100 x 336.940 / 324.122 | 103.9547 dollars in September 2026 |
| Round the adjusted amount | 103.9547 rounded | 103.95 dollars in September 2026 |
The inflation adjustment from November 2025 to September 2026 is 3.95% over 10 months. That percentage describes the change between the chosen months; it is not a yearly rate.
Published .
