Query european statistical data

When the user asks about European statistics — GDP, inflation, unemployment, population, trade, or any Eurostat indicator — reach for the Eurostat REST API. Time-series data by country or EU aggregate, no auth required.

query-european-statistical-data · v1 · updated 2026-04-16

Agents: This page is a SKILL.md-style capability guide. For JSON, call GET /api/skills/query-european-statistical-data. To drop this into a local Claude Code install, copy the frontmatter + body below into ~/.claude/skills/query-european-statistical-data/SKILL.md.

When to use this skill

When the user asks about European statistics — GDP, inflation, unemployment, population, trade, or any indicator published by Eurostat. This is time-series data: the user has a country or aggregate (DE, EU27_2020, EA19) and a metric in mind, and wants numbers over time. For US statistics, use Census or BLS APIs. For static country metadata, use access-country-reference-data.

Your best first call

curl "https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/namq_10_gdp?geo=DE&time=2023-Q2"

No auth. No key. Always include at least one geo filter — without it the API returns every country in the dataset and the response explodes.

The response is JSON-stat, not flat JSON. Key fields:

Fallbacks (when the best call isn't enough)

Pitfalls

One-line summary for the user

I can query European statistical data — GDP, inflation, population, trade — from Eurostat by dataset code and geography, but the JSON-stat response requires index mapping and you must always filter by geography.

APIs this skill uses

Eurostat API · primary · verified

Eurostat REST API for accessing European statistical data. Provides access to datasets covering demographics, economy, environment, and more for EU member states and other countries.

SKILL.md source (frontmatter + body)
---
name: query-european-statistical-data
description: When the user asks about European statistics — GDP, inflation, unemployment, population, trade, or any Eurostat indicator — reach for the Eurostat REST API. Time-series data by country or EU aggregate, no auth required.
---

## When to use this skill

When the user asks about European statistics — GDP, inflation, unemployment, population, trade, or any indicator published by Eurostat. This is time-series data: the user has a country or aggregate (DE, EU27_2020, EA19) and a metric in mind, and wants numbers over time. For US statistics, use Census or BLS APIs. For static country metadata, use `access-country-reference-data`.

## Your best first call

```bash
curl "https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/namq_10_gdp?geo=DE&time=2023-Q2"
```

No auth. No key. Always include at least one `geo` filter — without it the API returns every country in the dataset and the response explodes.

The response is JSON-stat, not flat JSON. Key fields:

- `value` — sparse object mapping flat index → number. Absent keys mean "no data", not zero. Compute the index from `dimension.*.category.index` positions and `size`.
- `id` — ordered dimension names (e.g., `["freq", "unit", "na_item", "geo", "time"]`)
- `size` — dimension cardinalities, same order as `id`
- `dimension` — each key has `category.index` (code → position) and `category.label` (code → human name). Decode `CLV_IHV`, `B1GQ`, `SCA` here.
- `status` — observation flags ("e" = estimate, "p" = provisional). Absent means final.

## Fallbacks (when the best call isn't enough)

- **Discovering which dataset code to use** → `https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/dataflow/ESTAT/all` lists every dataset, but returns XML (not JSON) and is very large.
- **Decoding dimension codes before a data call** → `https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/dataflow/ESTAT/{dataset}` returns SDMX XML with dimension and codelist definitions.

## Pitfalls

- **Always filter by `geo`.** Without `geo=`, a dataset like `nama_10_gdp` returns 44 countries × 32 units × 39 items × decades of time. One geography filter cuts this to a manageable slice.
- **JSON-stat is index-based, not key-value.** The `value` object maps integer positions to numbers. Compute the flat index from `dimension.*.category.index` and `size`. Treating `value` as a string-keyed dict returns nothing.
- **Time format varies by frequency.** Quarterly: `2023-Q2`. Annual: `2023`. Monthly: `2023-01`. Wrong format returns 200 OK with empty `value` — silent failure, not an error.
- **Dataset codes encode methodology versions.** The `10` in `namq_10_gdp` means ESA 2010; `namq_20_gdp` would be ESA 2020. When GDP numbers don't match user expectations, methodology version is likely the cause.

## One-line summary for the user

I can query European statistical data — GDP, inflation, population, trade — from Eurostat by dataset code and geography, but the JSON-stat response requires index mapping and you must always filter by geography.

« Back to all skills