A raise keeps up with prices when it is at least the year-over-year CPI change. Narwhal gives inflation for each country, and the Python below turns a raise and an inflation rate into a real change; it holds no wage benchmark data for most countries.
Read the inflation rate of each country
The inflation endpoint returns the latest annual and monthly price change for a country. These two requests ask for Germany and Japan.
curl -s -H "Authorization: Bearer $NARWHAL_API_KEY" \
"https://api.narwhalapi.com/v1/economics/DEU/inflation"{
"country": "DEU",
"period": "2026-09",
"year_over_year": "3.3",
"month_over_month": "0.6",
"year_to_date": "3.2",
"released_on": "2026-10-13"
}curl -s -H "Authorization: Bearer $NARWHAL_API_KEY" \
"https://api.narwhalapi.com/v1/economics/JPN/inflation"{
"country": "JPN",
"period": "2026-09",
"year_over_year": "2.1",
"month_over_month": "0.0",
"year_to_date": "1.3",
"released_on": "2026-10-23"
}year_over_year is the percentage change of the consumer price index against the same month a year earlier, here 3.3 for Germany and 2.1 for Japan in the latest month, period. month_over_month is the change since the month before, and year_to_date is the change since December. released_on is the publication date. The values are decimal strings in percent.
Cross-check against the index
The same rate can be rebuilt from the index. The observations endpoint returns the monthly CPI, and the response below keeps the first and last month of the 13 returned for Germany.
curl -s -H "Authorization: Bearer $NARWHAL_API_KEY" \
"https://api.narwhalapi.com/v1/economics/DEU/cpi/observations?start=2025-09&end=2026-09"{
"country": "DEU",
"as_of": "2026-10-13T00:00:00Z",
"index_base": "2020=100",
"observations": [
{
"period": "2025-09",
"value": "122.6"
},
{
"period": "2026-09",
"value": "126.6"
}
],
"next_cursor": null
}126.6 divided by 122.6 is 1.0326, so the index rose 3.26 percent over the 12 months, which rounds to the 3.3 in year_over_year. The same check for Japan gives 2.10 percent from 102.2 and 100.1.
Compare the raise with prices
Narwhal holds no salary or wage benchmark data for most countries, so this page writes only the price side. You bring the raise. The real change is one plus the raise divided by one plus inflation, minus one. A positive result means the pay buys more than a year ago, and a negative result means it buys less.
- Take the raise Use the percentage change in pay between the two periods, on the same basis both times, such as gross monthly pay.
- Read inflation Request the inflation of the country and keep
periodandyear_over_year. - Compute the ratio Divide one plus the raise by one plus inflation, subtract one and multiply by 100.
- Report the pair State the country, the month of the inflation figure and the sign of the result.
import json
import os
import urllib.request
from decimal import Decimal
def get(path):
req = urllib.request.Request(
"https://api.narwhalapi.com" + path,
headers={"Authorization": "Bearer " + os.environ["NARWHAL_API_KEY"]},
)
with urllib.request.urlopen(req, timeout=30) as r:
return json.load(r)
def check_raise(country, raise_percent):
latest = get(f"/v1/economics/{country}/inflation")
period = latest["period"]
year, month = period.split("-")
prior = f"{int(year) - 1}-{month}"
index = get(f"/v1/economics/{country}/cpi/observations?start={prior}&end={period}")
values = {o["period"]: Decimal(o["value"]) for o in index["observations"]}
from_index = (values[period] / values[prior] - 1) * 100
inflation = Decimal(latest["year_over_year"])
raise_ = Decimal(raise_percent)
real = ((1 + raise_ / 100) / (1 + inflation / 100) - 1) * 100
print(f"{country} {period}: inflation {inflation}% (from index {from_index:.2f}%), "
f"raise {raise_}%, real change {real:+.2f}%")
check_raise("DEU", "3.0")
check_raise("JPN", "2.5")
| Country | Month | Inflation | Raise | Real change |
|---|---|---|---|---|
| Germany (DEU) | 2026-09 | 3.3% | 3.0% | -0.29% |
| Japan (JPN) | 2026-09 | 2.1% | 2.5% | +0.39% |
The raise of 3.0 percent in Germany falls short of 3.3 percent inflation, so pay lost 0.29 percent of purchasing power. The raise of 2.5 percent in Japan is above 2.1 percent, so it gained 0.39 percent. The script also prints the rate rebuilt from the index beside the published one.
The inflation figure is the headline CPI of the whole country. It measures an average basket, so it will not match the price change that one household feels, and it covers prices only. A raise that matches inflation keeps buying power level on average, and it does not say whether the pay was adequate to begin with.
What do month over month and year to date add?
month_over_month shows the latest single month, which is useful when prices are moving fast. year_to_date is the change since the previous December. For Germany it reads 3.2, which matches 126.6 against the December 2025 index of 122.7. Use it when the pay review happens once a year in January and you want to know how much of the year's price rise has already happened.
Why divide instead of subtracting?
Pay and prices both compound, so the exact real change is the ratio. For Germany, subtracting 3.3 from 3.0 gives -0.30 percentage points, while the ratio gives -0.29 percent. The gap is small at these rates and grows as the rates rise.
Which inflation period should I compare with?
Use the 12 months that end when the raise took effect. The inflation endpoint returns the latest month. For an earlier month, call /v1/economics/{country}/inflation/observations with start and end; it returns year_over_year, month_over_month and year_to_date for each period. A raise effective in July 2026, for example, compares with the July 2026 row.
Where does the pay side come from?
From you. Use your payroll records, an offer letter or a survey you trust, and enter the raise as a percentage. The API has the price side only. For Canada, the any-series route can search tables on wages, which the any-series documentation describes, and this page does not use them.
Does the comparison work across countries?
Each raise is compared with the prices of its own country, in its own currency, so the real changes can sit side by side. The comparison says nothing about the level of pay in either country, and it does not convert currencies. For a ranking of inflation between countries, the guide on comparing inflation between countries shows the request pattern.
Published .