# Eurostat Statistics Scraper (`kawsar/eurostat-statistics-scraper`) Actor

Collect public EU statistics datasets like national accounts or labor figures. Simply enter a dataset code with your chosen dimension filters, run the actor, and download or export your results as CSV, JSON, or Excel files.

- **URL**: https://apify.com/kawsar/eurostat-statistics-scraper.md
- **Developed by:** [Kawsar](https://apify.com/kawsar) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Eurostat Statistics Scraper

<p align="center">
  <img src="https://imgur.com/gOU4wq5.png" alt="Eurostat Statistics" style="max-width:100%; border-radius:14px; width:680px;" />
</p>

Eurostat Statistics Scraper allows you to collect structured EU statistical datasets and convert them into clean formats like JSON, CSV, or Excel. Simply provide a dataset code and your desired dimension filters to retrieve and store the exact metrics you need.

***

### Key Features & Use Cases

- **National Accounts**: Pull GDP metrics across different countries by applying unit and indicator filters (e.g., using `nama_10_gdp`).
- **Labour Market Trends**: Track unemployment statistics over time with custom start periods (e.g., using `une_rt_a`).
- **Automated Archiving**: Periodically rerun your saved filters to capture updated figures and timestamps automatically.
- **Dataset Structure Lookup**: Use catalogue mode to explore all available dimensions inside a dataset before refining your filters.
- **Flexible Data Export**: Easily plug extracted data directly into downstream workflows, spreadsheets, or automation pipelines.

***

### Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `mode` | String | `values` | `values` extracts standard dataset rows. `catalogue` saves one row per dimension contained in the dataset. |
| `datasetCode` | String | `nama_10_gdp` | The code identifying the dataset to fetch. |
| `filters` | Object | `{"geo": ["DE"], "unit": ["CP_MEUR"], "na_item": ["B1GQ"]}` | Specific dimension filters to apply. Lists are passed as repeating filter parameters. |
| `sinceTimePeriod` | String | `""` | Optional starting period (e.g., `2021`). |
| `lang` | String | `EN` | Language for labels (`EN`, `FR`, or `DE`). |
| `maxItems` | Integer | `100` | Maximum number of rows to save (capped at 1000). |
| `requestDelaySecs` | Number | `0.5` | Pause duration between consecutive requests (minimum 0.5s). |
| `timeoutSecs` | Integer | `300` | Total run time limit in seconds before stopping new requests. |
| `requestTimeoutSecs` | Integer | `30` | Timeout duration for individual HTTP requests. |
| `proxyConfiguration` | Object | `{"useApifyProxy": false}` | Custom proxy settings if required. |

***

### Example Input Configuration

```json
{
    "mode": "values",
    "datasetCode": "nama_10_gdp",
    "filters": {
        "geo": ["DE", "FR"],
        "unit": ["CP_MEUR"],
        "na_item": ["B1GQ"],
        "time": ["2023"]
    },
    "sinceTimePeriod": "",
    "lang": "EN",
    "maxItems": 100,
    "requestDelaySecs": 0.5,
    "timeoutSecs": 300,
    "requestTimeoutSecs": 30,
    "proxyConfiguration": { "useApifyProxy": false }
}

```

***

### Sample Extracted Data

Below is an example output record collected in **values** mode:

```json
{
    "version": "2.0",
    "class": "dataset",
    "label": "Gross domestic product (GDP) and main components (output, expenditure and income) - annual data",
    "source": "ESTAT",
    "updated": "2026-10-09T23:00:00+0200",
    "value": { "0": 4254930.0, "1": 2833826.4 },
    "status": { "0": "p" },
    "id": ["freq", "unit", "na_item", "geo", "time"],
    "size": [1, 1, 1, 2, 1],
    "dimension": {},
    "extension": { "id": "NAMA_10_GDP", "agencyId": "ESTAT" },
    "mode": "values",
    "scraped_at": "2026-10-12T00:00:00Z"
}

```

#### Output Fields Explanation

- `version`: Payload format version.
- `class`: Dataset categorization flag.
- `label`: Human-readable dataset title.
- `source`: Data source provider.
- `updated`: Timestamp showing when the source last modified the data.
- `value`: Map of numerical data observations keyed by index.
- `status`: Observation flags or status indicators.
- `id`: Array defining dimension order.
- `size`: Array indicating size per dimension.
- `dimension`: Category indices and label definitions.
- `extension`: Dataset metadata details.
- `mode`: Extraction mode used (`values` or `catalogue`).
- `scraped_at`: UTC timestamp when the row was extracted.

***

### How It Works

1. **Parameters**: Reads dataset codes, filters, language preferences, and optional time periods.
2. **Execution**: Issues structured retrieval requests while respecting your configured delays.
3. **Resilience**: Features automatic retry handling with exponential backoff for rate limits or server blips.
4. **Error Handling**: Gracefully logs missing datasets or structural errors into clear error rows without crashing your entire run.
5. **Batch Processing**: Outputs clean, deduplicated rows in manageable batches until reaching your set item limits.

***

### Frequently Asked Questions

##### How up-to-date are the numbers?

Every record contains an `updated` timestamp directly from the origin source so you always know how fresh your data is.

##### What happens if I enter an invalid dataset code?

The actor captures the response status into a single structured error row and completes cleanly instead of failing the job.

***

### Legal & Compliance

- **Attribution**: Always provide proper credit when publishing or sharing figures collected using this scraper.
- **Terms & Fair Use**: Respect established rate limits and applicable licensing or usage policies when reusing collected metrics.
- **Disclaimer**: This actor is an independent utility and is not affiliated with, endorsed by, or officially associated with Eurostat or any related entity.

### Trademark Notice

Eurostat Statistics and related names, logos, and trademarks belong to their respective owners. Their use in this documentation is solely to identify the source of the data and does not imply affiliation, sponsorship, endorsement, or partnership.

### Disclaimer

Disclaimer: This Actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or otherwise officially associated with Eurostat Statistics or its owners. All data is collected from publicly available sources. Users are responsible for complying with the source's terms of use, rate limits, and attribution or licensing requirements.

# Actor input Schema

## `mode` (type: `string`):

values returns one JSON-stat dataset row. catalogue returns one row per dimension in that same dataset response.

## `datasetCode` (type: `string`):

Eurostat dataset code, such as nama_10_gdp or une_rt_a.

## `filters` (type: `object`):

Map of dimension names to one code or a list of codes. Each list entry is sent as a repeated query parameter.

## `sinceTimePeriod` (type: `string`):

Optional start of the time window, sent as sinceTimePeriod. Example: 2021. Leave empty to omit it.

## `lang` (type: `string`):

Label language for the JSON-stat response. One of EN, FR, or DE.

## `maxItems` (type: `integer`):

Maximum dataset rows to save in one run, including error rows. Free cap is 1000.

## `requestDelaySecs` (type: `number`):

Seconds to wait between HTTP calls. Minimum 0.5 so requests stay sequential and paced.

## `timeoutSecs` (type: `integer`):

Stop scheduling new requests after this many seconds. Rows already saved are kept.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds for each call to the Eurostat data API.

## `proxyConfiguration` (type: `object`):

Optional proxy. Default is no proxy. Enable Apify Proxy only if the data API blocks your IP.

## Actor input object example

```json
{
  "mode": "values",
  "datasetCode": "nama_10_gdp",
  "filters": {
    "geo": [
      "DE",
      "FR"
    ],
    "unit": [
      "CP_MEUR"
    ],
    "na_item": [
      "B1GQ"
    ],
    "time": [
      "2023"
    ]
  },
  "sinceTimePeriod": "2021",
  "lang": "EN",
  "maxItems": 100,
  "requestDelaySecs": 0.5,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `datasetUrl` (type: `string`):

Default dataset for this run.

## `overview` (type: `string`):

Table of dataset rows from this run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "values",
    "datasetCode": "nama_10_gdp",
    "filters": {
        "geo": [
            "DE",
            "FR"
        ],
        "unit": [
            "CP_MEUR"
        ],
        "na_item": [
            "B1GQ"
        ],
        "time": [
            "2023"
        ]
    },
    "sinceTimePeriod": "",
    "lang": "EN",
    "maxItems": 100,
    "requestDelaySecs": 0.5,
    "timeoutSecs": 300,
    "requestTimeoutSecs": 30,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/eurostat-statistics-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "values",
    "datasetCode": "nama_10_gdp",
    "filters": {
        "geo": [
            "DE",
            "FR",
        ],
        "unit": ["CP_MEUR"],
        "na_item": ["B1GQ"],
        "time": ["2023"],
    },
    "sinceTimePeriod": "",
    "lang": "EN",
    "maxItems": 100,
    "requestDelaySecs": 0.5,
    "timeoutSecs": 300,
    "requestTimeoutSecs": 30,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("kawsar/eurostat-statistics-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "values",
  "datasetCode": "nama_10_gdp",
  "filters": {
    "geo": [
      "DE",
      "FR"
    ],
    "unit": [
      "CP_MEUR"
    ],
    "na_item": [
      "B1GQ"
    ],
    "time": [
      "2023"
    ]
  },
  "sinceTimePeriod": "",
  "lang": "EN",
  "maxItems": 100,
  "requestDelaySecs": 0.5,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call kawsar/eurostat-statistics-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kawsar/eurostat-statistics-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/IcRa2szLBDCtadZ4w/builds/S5cXXJcY2SoRJjDUW/openapi.json
