# EU Open Data Search (`alka-labs/eu-open-data-search`) Actor

- **URL**: https://apify.com/alka-labs/eu-open-data-search.md
- **Developed by:** [Igor Lima](https://apify.com/alka-labs) (community)
- **Categories:** Developer tools, AI, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 dataset record returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## eu-open-data-search

Search the **EU Open Data Portal** (1.7 million datasets, measured 16 Sep 2026, harvested from dozens of national
catalogues) and get back flat, clean JSON.

The portal's own API answers with records that carry every title in 24 languages, nest the
licence three levels down inside each distribution, and include the publisher's contact
e-mail. This unit returns one record per dataset, in the language you asked for, with the
licence resolved and **no personal data in it at all**.

### Input

Every field is optional. With no input you get the 20 most relevant datasets on the portal.

```json
{
  "query": "air quality",
  "country": ["be", "nl"],
  "catalogue": ["data-gov-be"],
  "categories": ["ENVI"],
  "formats": ["CSV", "JSON"],
  "licenses": ["CC_BY_4_0"],
  "language": "en",
  "max_results": 20
}
```

| Field | Meaning |
|---|---|
| `query` | full-text search over titles, descriptions and keywords |
| `country` | lowercase country codes as the portal uses them (`be`, `de`, `fr`, …) |
| `catalogue` | source catalogue id (`data-gov-be`, `govdata`, `datos-gob-es`, …) |
| `categories` | EU data theme codes (`ENVI`, `TECH`, `AGRI`, `SOCI`, `EDUC`, …) |
| `formats` | distribution formats (`CSV`, `JSON`, `XLSX`, `SHP`, `PDF`, …) |
| `licenses` | licence ids as published by the portal (`CC_BY_4_0`, …) |
| `language` | which language to collapse multilingual titles to; falls back to English, then to whatever the publisher provided |
| `max_results` | 1 to 500 |

### Output

```json
{
  "unit": "eu-open-data-search",
  "version": "1.0.0",
  "generated_at": "2026-09-16T15:30:00Z",
  "source": { "portal": "data.europa.eu", "portal_metadata_license": "CC0-1.0", "...": "..." },
  "query": { "...": "echoed back, so a stored result explains itself" },
  "total_matches": 269,
  "returned": 2,
  "datasets": [
    {
      "id": "https-www-odwb-be-explore-dataset-belaqi-qualite-air-issep-",
      "title": "BelAQI Index - Belgian Air Quality Index",
      "description": "The dataset presents air quality according to the BelAQI index...",
      "portal_url": "https://data.europa.eu/data/datasets/...?locale=en",
      "landing_page": "https://www.odwb.be/explore/dataset/belaqi-qualite-air-issep/information/",
      "publisher": "City of Liège",
      "catalogue_id": "data-gov-be",
      "country_code": "BE",
      "country_label": "Belgium",
      "categories": ["AGRI"],
      "keywords": ["environnement", "air"],
      "languages": ["fr"],
      "issued": "2024-04-15T00:00:00",
      "modified": "2026-09-08T01:05:14.968Z",
      "high_value_dataset": false,
      "formats": ["CSV", "JSON", "PARQUET", "SHP", "XLSX", "..."],
      "licenses": [
        { "id": "CC_BY_4_0", "label": "Creative Commons Attribution 4.0 International",
          "uri": "http://spdx.org/licenses/CC-BY-4.0" }
      ],
      "attribution_required": "yes",
      "distribution_count": 15
    }
  ]
}
```

`esquema.json` is the contract. If it changes, this is a new version, not a fix.

### Licensing and attribution

Portal **metadata** is dedicated to the public domain under CC0 1.0
(https://data.europa.eu/en/legal-notice). Individual **datasets** keep their own licence,
which is why every record carries `licenses` and `attribution_required`:

- `"yes"` — the licence asks for credit. Attribute the `publisher`.
- `"no"` — a public-domain dedication, no credit required.
- `"unknown"` — the source published no licence for this dataset. It is never reported as
  `"no"` by default: an absent licence is not a permissive one.

### No personal data

Upstream records contain `contact_point` and `creator` fields with people's names and
e-mail addresses. This unit builds its output field by field from an allowlist, so those
fields cannot travel through it, and it redacts e-mail addresses out of free text as well.
`publisher` is emitted only when the source types it as an organisation. The smoke test
asserts all of this on every run.

### Rate limiting

The portal publishes no rate limit. This unit self-throttles to one request per second,
walks at most 20 pages per call, and honours `Retry-After` on HTTP 429. Nothing here works
around a limit, a login, or a bot check — it is the official documented API over plain
HTTP, with no browser involved.

### Running it

```
python main.py '{"query": "air quality", "max_results": 5}'   # or pipe JSON on stdin
python conferir.py output.json                                # validate against the schema
python fumaca.py                                              # live end-to-end check
```

# Actor input Schema

## `query` (type: `string`):

Full-text search over titles, descriptions and keywords. Leave empty to browse the whole portal.

## `country` (type: `array`):

Publishing country, as the portal spells it: lowercase ISO codes such as be, de, fr. Empty means every country.

## `catalogue` (type: `array`):

Catalogue ids such as data-gov-be, govdata, datos-gob-es. Empty means every catalogue.

## `categories` (type: `array`):

EU data theme codes: ENVI, TECH, AGRI, SOCI, EDUC, ECON, ENER, GOVE, HEAL, INTR, JUST, REGI, TRAN.

## `formats` (type: `array`):

Distribution formats such as CSV, JSON, XLSX, SHP, PDF.

## `licenses` (type: `array`):

Licence ids as the portal publishes them, such as CC\_BY\_4\_0 or CC0\_1\_0.

## `language` (type: `string`):

Which language to collapse the multilingual titles to. Falls back to English, then to whatever the publisher provided.

## `max_results` (type: `integer`):

How many dataset records to return, 1 to 500. You are charged per record returned.

## Actor input object example

```json
{
  "query": "air quality",
  "country": [],
  "catalogue": [],
  "categories": [],
  "formats": [],
  "licenses": [],
  "language": "en",
  "max_results": 20
}
```

# Actor output Schema

## `datasets` (type: `string`):

One flat record per dataset: title, publisher, country, portal URL, formats, licence and the attribution duty.

## `summary` (type: `string`):

The query echoed back, how big the haystack was, how many records you got, and the licence notice. It carries no records, so a stored result explains itself without being paid for twice.

# 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 = {
    "query": "air quality",
    "country": [],
    "catalogue": [],
    "categories": [],
    "formats": [],
    "licenses": [],
    "language": "en",
    "max_results": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("alka-labs/eu-open-data-search").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 = {
    "query": "air quality",
    "country": [],
    "catalogue": [],
    "categories": [],
    "formats": [],
    "licenses": [],
    "language": "en",
    "max_results": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("alka-labs/eu-open-data-search").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 '{
  "query": "air quality",
  "country": [],
  "catalogue": [],
  "categories": [],
  "formats": [],
  "licenses": [],
  "language": "en",
  "max_results": 20
}' |
apify call alka-labs/eu-open-data-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alka-labs/eu-open-data-search"
        }
    }
}
```

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/ASrCarhAo1kH8A90P/builds/GY52FuTYC3lXGq4uA/openapi.json
