Inflation (CPI)

Consumer price index (IPC) from the National Statistics Institute (INE), whole country. The 12 most recent months.

Loading inflation…

What each column means

The column names are the ones in the INE file. That file has no definitions, so the explanations are mine, not word for word from the INE.

DataAPI fieldINE columnExplanation (mine, unofficial)
MonthdateMes y añoFirst day of the month the data refers to.
IndexindexÍndiceValue of the index, base October 2022 = 100.
Monthlymonthly_changeMensualPercentage change from the previous month.
Year to dateyear_to_date_changeAcum. añoPercentage change accumulated during the year up to that month.
12 monthstwelve_month_changeAcum.12 mesesPercentage change from the same month of the previous year.
Quarterquarter_changeTrimestrePercentage change of the quarter, as published by the INE.
Four monthsfour_month_changeCuatrimestrePercentage change of the four-month period, as published by the INE.

Good to know

  • Changes are percentages: 0.54 means 0.54 %. Cells that the INE leaves empty are returned as null (for example, the changes of the first months of the series).
  • Index values of the first years are very small (1937 is about 0.00000016) because the series is expressed in the current base, after several currency changes.
  • Every time the file is loaded, the monthly and 12-month changes are checked against the index (allowing a tiny difference that exists in the INE's own figures). If they do not match, the load is rejected.
  • The INE publishes each month's figure at the beginning of the following month.

Source: INE CPI file (whole country, base October 2022 = 100). View the original file (Excel)

Use this data in your systems

The API is public and free: it returns the CPI in JSON format, with the whole history since 1937 and no sign-up.

import requests

URL = "https://apitool.techspot365.com/api/v1/inflation"

# Latest 2 months of the CPI
response = requests.get(URL, params={"limit": 2}, timeout=30)
response.raise_for_status()
result = response.json()

for row in result["data"]:
    print(row["date"], row["index"], row["monthly_change"], row["twelve_month_change"])

# While result["meta"]["is_last_page"] is False, request the next page: page=2, 3, ...