Eurostat
Eurostat API — GDP, unemployment and prices for every EU member state, one dataset code each
When the question is cross-country inside the EU — which economies are growing, where unemployment is falling, national HICP components — or you want the flash estimates the moment Eurostat publishes them.
Reach for it when…
When the question is cross-country inside the EU — which economies are growing, where unemployment is falling, national HICP components — or you want the flash estimates the moment Eurostat publishes them.
Not for: Monetary data (ECB), daily anything (Eurostat is monthly at best), non-EU countries (OECD, IMF, World Bank).
Units, revisions, traps
Units. Depends on the dataset: HICP as annual rate (prc_hicp_manr) or index (prc_hicp_midx); GDP as chain-linked volumes or growth rates; unemployment as a percent of the labour force.
Revisions. Flash estimates are revised at the second and third releases; national accounts are revised for years.
- The JSON-stat format needs unpacking; the SDMX-CSV endpoint is easier in pandas.
- Filters are dimension=value pairs in the query string; the order of dimensions in the SDMX key follows the dataset's structure, not the alphabet.
- geo=EA means the euro area at current composition; EA19/EA20 fix the membership.
Classic mistake: Averaging national inflation rates instead of using the euro-area aggregate, which is weighted.
Three recipes
- Recipe 1 · Euro-area HICP, annual rate, as CSV
- Recipe 2 · Unemployment across member states
- Recipe 3 · Real GDP growth, quarter on quarter, by country
Each recipe: Python · Excel · Sheets, with how to read the result. Python recipes run under pandas; recipe 1 is re-run by the weekly check where the source allows it.
How to use it in your own work
Copy the snippet, change the series id, read the result the way the footer says. Replace YOUR_…_KEY with your own key where one is needed.
Recipe 1Euro-area HICP, annual rate, as CSV
# SDMX 2.1 endpoint with a CSV format: HICP all-items annual rate, euro area
import pandas as pd
u = ("https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/prc_hicp_manr/M.RCH_A.CP00.EA"
"?format=SDMX-CSV&startPeriod=2020-01")
df = pd.read_csv(u)
s = df.set_index(pd.PeriodIndex(df.TIME_PERIOD, freq="M").to_timestamp())["OBS_VALUE"]
print(s.tail(6))- Data → From Web → the same URL → Load.
=IMPORTDATA with the same URL.Recipe 2Unemployment across member states
# monthly unemployment rate, seasonally adjusted, total, all countries
import pandas as pd
u = ("https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/une_rt_m/M.SA.TOTAL.PC_ACT.T."
"?format=SDMX-CSV&lastTimePeriod=1")
df = pd.read_csv(u)
print(df[["geo", "TIME_PERIOD", "OBS_VALUE"]].sort_values("OBS_VALUE"))- From Web with the same URL.
=IMPORTDATA with the same URL.Recipe 3Real GDP growth, quarter on quarter, by country
import pandas as pd
u = ("https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/namq_10_gdp/Q.CLV_PCH_PRE.SCA.B1GQ."
"?format=SDMX-CSV&lastTimePeriod=2")
df = pd.read_csv(u)
print(df.pivot(index="geo", columns="TIME_PERIOD", values="OBS_VALUE").dropna())- From Web with the same URL.
=IMPORTDATA with the same URL.Series → question map
The ids we use from Eurostat API, each with the question it answers. The catalog's compare view reads the concept tags behind these rows.
| Series | Answers | Region | Concept |
|---|---|---|---|
| prc_hicp_manr · CP00 · EA | What is euro-area inflation? | euro area | cpi |
| une_rt_m · TOTAL | Where is unemployment falling in the EU? | European Union | unemployment |
| namq_10_gdp · B1GQ | Which EU economies are growing? | European Union | gdp |
| ei_bsco_m | Consumer confidence, monthly | European Union | sentiment |
Compare with
Same question, different source: ECB Data Portal, BLS API, OECD Data Explorer. The compare view lines up coverage, frequency, history and access side by side and lists what the combination makes possible.
Questions readers ask
Do I need a key for Eurostat?
No. The API is open; be gentle with bulk pulls.
JSON or CSV?
The default JSON is JSON-stat, which needs a helper to flatten. The SDMX 2.1 endpoint with format=SDMX-CSV reads straight into pandas.
Where do dataset codes come from?
The database tree at ec.europa.eu/eurostat/web/main/data/database; the code is in brackets after each dataset name (e.g. prc_hicp_manr).
From the paper
Educational only — we explain, we never advise · snippet licence: public domain · corrections to [email protected], fixed within a day and logged in the changelog.