# Eurostat API

> Eurostat returns country statistics and EU figures as a workflow and API.

Get statistic returns a country's requested statistic and, when reported, the EU figure for the same period. Provide a topic and country; period is optional and defaults to the latest available.

- Page: https://fous.com/tools/eurostat
- Handle: `@eurostat`
- Category: [Data](https://fous.com/tools/category/data)
- Source website: https://ec.europa.eu/eurostat
- Last verified: Sep 29, 2026

## Methods

### Get statistic

Operation `get_statistic`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get an official Eurostat country statistic and its EU figure for the same period. Monthly requests for quarterly and half-yearly series return the containing reporting period; annual topics require a year. The EU figure is unavailable for minimum wages, and some countries do not publish every statistic.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `topic` | string | yes | `"inflation"` | Statistic to look up, for example inflation or household electricity price. |
| `period` | string | no | `"2025-06"` | Year or month to look up; for example 2025 or 2025-06. Defaults to latest available. |
| `country` | string | yes | `"Spain"` | EU or EEA country name, for example Spain. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "country",
    "topic"
  ],
  "properties": {
    "topic": {
      "type": "string",
      "description": "Statistic to look up, for example inflation or household electricity price.",
      "examples": [
        "inflation",
        "household electricity price",
        "population"
      ]
    },
    "period": {
      "type": "string",
      "default": "latest",
      "description": "Year or month to look up; for example 2025 or 2025-06. Defaults to latest available.",
      "examples": [
        "2025-06",
        "2024"
      ]
    },
    "country": {
      "type": "string",
      "description": "EU or EEA country name, for example Spain.",
      "examples": [
        "Spain",
        "Norway"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "topic": "inflation",
      "country": "Spain"
    },
    {
      "topic": "household electricity price",
      "period": "2025-06",
      "country": "Spain"
    },
    {
      "topic": "population",
      "period": "2024",
      "country": "Norway"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `unit` | string | `"% change on a year earlier"` | Plain-language units of measurement. |
| `topic` | string | `"inflation"` | Statistic name. |
| `value` | number | `4.6` | Country figure. |
| `period` | string | `"2026-08"` | Reporting year, month, quarter or half-year. |
| `country` | string | `"Spain"` | Country name. |
| `eu_average` | number or null | `3.2` | EU figure for the same period, if Eurostat reports it. |
| `dataset_code` | string | `"prc_hicp_minr"` | Eurostat dataset code. |
| `dataset_name` | string | `"Harmonised index of consumer prices (HICP) - ECOICOP ver.2 - indices and rates of change, monthly data"` | Name of the official dataset. |
| `data_page_link` | string | `"https://ec.europa.eu/eurostat/databrowser/view/prc_hicp_minr/default/table?lang=en"` | Eurostat page for this dataset. |

**Example input**

```json
{
  "topic": "inflation",
  "country": "Spain"
}
```

**Example output**

```json
{
  "unit": "% change on a year earlier",
  "topic": "inflation",
  "value": 4.6,
  "period": "2026-08",
  "country": "Spain",
  "eu_average": 3.2,
  "dataset_code": "prc_hicp_minr",
  "dataset_name": "Harmonised index of consumer prices (HICP) - ECOICOP ver.2 - indices and rates of change, monthly data",
  "data_page_link": "https://ec.europa.eu/eurostat/databrowser/view/prc_hicp_minr/default/table?lang=en"
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@eurostat",
  "visibility": "public",
  "operation": "get_statistic",
  "version": 1,
  "input": {
    "topic": "inflation",
    "country": "Spain"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@eurostat\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_statistic\",\n  \"version\": 1,\n  \"input\": {\n    \"topic\": \"inflation\",\n    \"country\": \"Spain\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@eurostat",
  "visibility": "public",
  "operation": "get_statistic",
  "version": 1,
  "input": {
    "topic": "inflation",
    "country": "Spain"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/eurostat`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_statistic`: Get statistic. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-eurostat https://api.fous.com/mcp/tools/eurostat --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Compare a country's statistic with its EU figure
- Track inflation by country and reporting period
- Look up household electricity prices by country
- Check statistics for a specific year or month

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Eurostat tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a Eurostat account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from ec.europa.eu when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### How does a country's statistic compare with the EU figure?

Get statistic returns the country value and the EU figure for the same period when Eurostat reports one.

### What was the inflation rate in Spain for a given period?

Get statistic returns the requested statistic for Spain and the selected period, or the latest available period if none is specified.

## Related

- [World Bank API](https://fous.com/tools/world-bank.md): World Bank provides country statistics and latest values within selected years, plus country rankings for a chosen year or the latest broadly covered year.
- [Our World in Data API](https://fous.com/tools/our-world-in-data.md): Research and data on global challenges and long-term trends.
- [World Health Organization API](https://fous.com/tools/world-health-organization.md): The World Health Organization provides public health information, latest outbreak reports, country health statistics with up to 10 years of history when available, and topic fact sheets.
- [Trading Economics API](https://fous.com/tools/trading-economics.md): Trading Economics provides economic indicators, market data and country statistics, including country overviews, latest reported country comparisons and current commodity prices reflecting reported trading days.
- [European Central Bank API](https://fous.com/tools/european-central-bank.md): The European Central Bank provides official euro reference rates and informational currency conversions using the latest preceding published rates when needed, plus current key interest rates and optionally earlier changes.
- [IMF API](https://fous.com/tools/imf.md): IMF economic data provides country and regional forecasts with actual or forecast labels, and country rankings by World Economic Outlook indicators, excluding groups and missing values.
- [Wikipedia API](https://fous.com/tools/wikipedia.md): Wikipedia returns article summaries, images, facts, relevant search matches, readable text and daily historical events, plus human-view counts from July 2015 onward.
- [ESPN API](https://fous.com/tools/espn.md): ESPN provides daily scores and schedules, team results, player statistics, matchup summaries, and latest topic-specific headlines; coverage and published details vary, especially for college and soccer.
- [All Data tools](https://fous.com/tools/category/data)
