# EU Open Data File Finder (`alka-labs/eu-dataset-files`) Actor

- **URL**: https://apify.com/alka-labs/eu-dataset-files.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

$3.00 / 1,000 file row 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-dataset-files

The **actual downloadable files** behind EU open datasets — one flat row per file, with the
direct URL, the format, the licence and the attribution duty already on the row.

The portal answers with datasets; a pipeline needs files. A single dataset in our test run
had 15 distributions across 13 formats, and finding the CSV among them means walking a
nested record per hit. This unit does that walk for you.

### Input

Every field is optional.

```json
{
  "query": "water",
  "country": ["be"],
  "catalogue": ["data-gov-be"],
  "categories": ["ENVI"],
  "formats": ["CSV"],
  "language": "en",
  "max_datasets": 20,
  "max_files": 100,
  "require_download_url": true
}
```

| Field | Meaning |
|---|---|
| `formats` | narrows **the files too**, not just the datasets — ask for CSV and you get CSV rows, not every format of every matching dataset |
| `max_datasets` | how many datasets to walk (1–200) |
| `max_files` | hard cap on rows returned (1–1000) |
| `require_download_url` | `true` (default) returns only files with a direct link. Set `false` to also get files that offer a landing page instead |

### Output

```json
{
  "unit": "eu-dataset-files",
  "version": "1.0.0",
  "total_matching_datasets": 11017,
  "datasets_scanned": 2,
  "returned": 1,
  "files": [
    {
      "dataset_id": "7eacade4-ff0d-4df6-a988-df2f64c42859",
      "dataset_title": "...",
      "dataset_portal_url": "https://data.europa.eu/data/datasets/...?locale=en",
      "catalogue_id": "data-gov-gr",
      "country_code": "GR",
      "publisher": null,
      "file_id": "393fa372-bc7e-450f-87fb-aeb5aa4f8930",
      "file_title": "...",
      "format": "CSV",
      "media_type": null,
      "download_url": "https://data.gov.gr/dataset/.../download/00013.csv",
      "access_url": "https://data.gov.gr/dataset/.../download/00013.csv",
      "license": { "id": "CC_BY_4_0", "label": "Creative Commons Attribution 4.0 International",
                   "uri": "http://spdx.org/licenses/CC-BY-4.0" },
      "attribution_required": "yes",
      "modified": "2026-04-28T13:34:39.293151"
    }
  ]
}
```

`total_matching_datasets` is the size of the haystack; `datasets_scanned` is how much of it
was walked under your caps. When they differ, the file list is a sample, not the whole set.

**The licence is per file, not per dataset** — the portal attaches it to the distribution,
and datasets do mix licences across their files. That is why `attribution_required` is on
every row: whichever file you download, the duty that comes with it is on the same line.

**This unit returns links, it does not fetch the files.** Downloading is your side of the
line, and the rate limit of the host serving the file is yours to respect.

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

### Licensing, personal data, rate limiting

Portal metadata is CC0 1.0 (https://data.europa.eu/en/legal-notice); each file carries its
own licence. No personal data is emitted — the upstream `contact_point` and `creator`
fields never enter the output, and e-mail addresses are redacted from free text. One
request per second, `Retry-After` honoured, official API over plain HTTP, no browser.

### Running it

```
python main.py '{"query": "water", "formats": ["CSV"], "max_files": 10}'
python conferir.py output.json
python fumaca.py
```

# Actor input Schema

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

Full-text search over the datasets whose files you want.

## `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`):

Narrows the files themselves, not just the datasets: ask for CSV and you get CSV rows.

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

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

## `max_datasets` (type: `integer`):

How many matching datasets to open in search of files, 1 to 200.

## `max_files` (type: `integer`):

Hard cap on file rows returned, 1 to 1000. You are charged per row returned.

## `require_download_url` (type: `boolean`):

On: only files that carry a direct download URL. Off: also files that offer a landing page instead.

## Actor input object example

```json
{
  "query": "water",
  "country": [],
  "catalogue": [],
  "categories": [],
  "formats": [
    "CSV"
  ],
  "language": "en",
  "max_datasets": 20,
  "max_files": 100,
  "require_download_url": true
}
```

# Actor output Schema

## `files` (type: `string`):

One flat row per file: direct download URL, format, licence and the attribution duty, with its dataset on the same line.

## `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": "water",
    "country": [],
    "catalogue": [],
    "categories": [],
    "formats": [
        "CSV"
    ],
    "language": "en",
    "max_datasets": 20,
    "max_files": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("alka-labs/eu-dataset-files").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": "water",
    "country": [],
    "catalogue": [],
    "categories": [],
    "formats": ["CSV"],
    "language": "en",
    "max_datasets": 20,
    "max_files": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("alka-labs/eu-dataset-files").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": "water",
  "country": [],
  "catalogue": [],
  "categories": [],
  "formats": [
    "CSV"
  ],
  "language": "en",
  "max_datasets": 20,
  "max_files": 100
}' |
apify call alka-labs/eu-dataset-files --silent --output-dataset

```

## MCP server setup

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

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/YIOBsD6EEB4AF9dHP/builds/MR3ikssjg6OgA6EKX/openapi.json
