On 24 October 2026, the releases available had year-on-year inflation of 3.7% in the United States, 3.5% in the United Kingdom, 3.3% in Germany, 3.1% in Canada, 2.1% in Japan and 4.0% in Australia. Australia's figure was for August 2026; the others were for September 2026. The inflation endpoint returns the same fields for every country, so you call it once per country and sort the results.
Do it with the API
Use GET /v1/economics/{country}/inflation for each country you want to compare. Each response has period, year_over_year, month_over_month, year_to_date and released_on. Keep the period and release date beside the rate when you build your comparison.
The script converts year_over_year to a number before sorting. It retains the country code, period and release date in the same row, then prints the rate with one decimal place. The returned month_over_month and year_to_date fields are available in the response; this comparison uses year_over_year throughout.
- Get a key and store it Get a free API key and keep it in the
NARWHAL_API_KEYenvironment variable. Requests useAuthorization: Bearer YOUR_KEYwith the base URLhttps://api.narwhalapi.com; the script reads the key from that variable and sends it in the authorization header. - Request the countries and sort their rates Use the Python script to request inflation for the United States, United Kingdom, Germany, Canada, Japan and Australia. It makes one request per country, takes the year-on-year rate from each successful response, and prints the rows from highest to lowest with their periods and release dates.Python, latest inflation for six countries
import os import requests H = {"Authorization": f"Bearer {os.environ['NARWHAL_API_KEY']}"} rows = [] for country in ["USA", "GBR", "DEU", "CAN", "JPN", "AUS"]: r = requests.get(f"https://api.narwhalapi.com/v1/economics/{country}/inflation", headers=H, timeout=10) if r.ok: d = r.json() rows.append((float(d["year_over_year"]), country, d["period"], d["released_on"])) for yoy, country, period, released in sorted(rows, reverse=True): print(f"{country} {yoy:>4.1f}% {period} released {released}") - Read the dates beside each rate Use
periodto identify the month the rate describes andreleased_onfor its publication date. When periods differ, include that difference in your dashboard or report so a reader can see which months are being compared. Leave both dates attached to the country when you sort the rows. - Use the sorted output in your report Read each printed line as the country code, year-on-year inflation rate, period and release date. Use that order for a ranking in a dashboard or report, and run the script after each release when you update the comparison. Include the period beside the percentage wherever you copy a row from the output.
Do it in a sheet or without code
Use the website's by-country inflation table for a glance at the published rates, or open each country's inflation page. Paste the values into a sheet if you want to arrange the countries yourself. Include a country column, the year-on-year rate, its period and its release date, then sort by the rate from highest to lowest.
Move the whole row when sorting so the rate stays with its country and dates. A sheet also lets you keep the published period visible while reading the ranking. If your report compares a shared month, use the period column to identify which rows belong to that month before calculating a spread. Keep countries with a different period clearly identified when you include them in the same comparison.
Which option to use when
| Situation | Best option | Why |
|---|---|---|
| A glance at published inflation | The website table | Read the by-country rates without writing code |
| A dashboard or report | The script, run after each release | Request each country and sort the returned rates |
| A country is not covered | Report the missing coverage | Skip the country and tell the reader instead of guessing |
Why are the inflation periods different?
Countries publish on their own schedules, so the releases available on a given date can describe different months. On 24 October 2026, Australia's available monthly inflation figure was for August 2026 because its September figure had not been published. The other countries in the worked example had figures for September 2026.
A ranking across those releases therefore includes a period difference. For a September comparison within that example, use the United States and Japan figures when calculating their spread. Keep Australia's August label visible if you include it in the broader ranking.
Is every country's CPI measured the same way?
No. Narwhal publishes official national statistics, and each country's CPI is its national statistical office's own measure. Definitions differ by country. Compare the rates as published and read the economics methodology for details about the measures behind them.
The endpoint's shared field names let you put the responses into the same comparison. Keep the national measure in mind when interpreting the order: the same response fields do not make the countries' CPI definitions identical.
What if a country returns 404 for inflation?
A 404 series_not_found response means the inflation series is not covered or has not been published yet. On 24 October 2026, Indonesia and South Korea returned this error for inflation. Read the coverage page for the list of covered countries.
Skip that country and state the omission in your report. An omitted country has no rate in the comparison, so leave it out of the ranking and the spread calculation. The script's successful rows alone do not explain an absence; use the error response to explain why the country is missing.
Worked example: ranking six countries
Start with the releases available on 24 October 2026. Take each country's year-on-year inflation rate and order the rows from highest to lowest. Preserve the period and publication date alongside each value.
| Country | Year-on-year inflation | Period | Released on |
|---|---|---|---|
| Australia (AUS) | 4.0% | 2026-08 | 2026-09-30 |
| United States (USA) | 3.7% | 2026-09 | 2026-10-14 |
| United Kingdom (GBR) | 3.5% | 2026-09 | 2026-10-21 |
| Germany (DEU) | 3.3% | 2026-09 | 2026-10-13 |
| Canada (CAN) | 3.1% | 2026-09 | 2026-10-19 |
| Japan (JPN) | 2.1% | 2026-09 | 2026-10-23 |
For the releases available on 24 October 2026, the highest rate in this group was Australia's 4.0% for August 2026, and the lowest was Japan's 2.1% for September 2026. Use those endpoints for the full ranking's spread. For the shared September 2026 period, pair the United States rate of 3.7% with Japan's 2.1%.
Subtract Japan's September 2026 rate from Australia's August 2026 rate for the spread across all the available releases on 24 October 2026. Then calculate the United States to Japan spread using their September 2026 rates. Express each difference in percentage points and retain the period labels with the calculation.
Australia (August 2026) to Japan (September 2026):
4.0% - 2.1% = 1.9 percentage points
United States (September 2026) to Japan (September 2026):
3.7% - 2.1% = 1.6 percentage pointsPublished .
