# EUR-Lex Scraper - EU Regulations, Directives & Case Law (`jungle_synthesizer/eur-lex-eu-legislation-scraper`) Actor

Scrape EUR-Lex for EU legislation: regulations, directives, decisions, judgments, treaties. Returns CELEX IDs, ELI URIs, EuroVoc subjects, amendment tree, legal basis, national transpositions, and full-text URLs. Built for LegalTech, compliance teams, and AI training pipelines.

- **URL**: https://apify.com/jungle\_synthesizer/eur-lex-eu-legislation-scraper.md
- **Developed by:** [BowTiedRaccoon](https://apify.com/jungle_synthesizer) (community)
- **Categories:** Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## EUR-Lex Scraper - EU Regulations, Directives & Case Law

Extract EU legislative documents from [EUR-Lex](https://eur-lex.europa.eu/) — the official database of European Union law. Returns structured records for regulations, directives, decisions, judgments, treaties, and proposals with CELEX IDs, ELI URIs, EuroVoc subject classifications, amendment trees, legal basis references, national transpositions, and full-text/PDF/XML URLs.

Built for LegalTech platforms, compliance teams, regulatory researchers, and AI training pipelines that need structured access to EU legal data at scale.

---

### What It Does

The scraper queries the EUR-Lex SPARQL endpoint (`publications.europa.eu/webapi/rdf/sparql`) using the EU Cellar Common Data Model. Six query modes let you target exactly the documents you need:

| Mode | Use case |
|------|----------|
| **By Keyword** | Full-text search across legislation titles |
| **By CELEX ID** | Fetch a single document by its canonical EU identifier |
| **By EuroVoc Subject** | All legislation tagged with a specific EuroVoc concept |
| **By Date Range** | All acts published between two dates |
| **By Document Type** | Filter by regulation, directive, decision, judgment, etc. |
| **Recent Acts** | Legislation published in the last N days |

---

### Output Fields

| Field | Description |
|-------|-------------|
| `celex_id` | CELEX number — canonical EU document identifier (e.g. `32024R1689`) |
| `eli_uri` | European Legislation Identifier URI |
| `cellar_uri` | Cellar repository URI for this work |
| `document_type` | Resource type code (REG, DIR, DEC, JU, OPIN, etc.) |
| `title` | Full official title in English |
| `publication_date` | Date of publication in the Official Journal (ISO 8601) |
| `effective_date` | Date the act enters into force (ISO 8601) |
| `end_validity_date` | Date the act ceases to be valid / is repealed (ISO 8601) |
| `subject_matter` | EuroVoc subject labels (comma-separated) |
| `legal_basis` | CELEX IDs of treaty articles used as legal basis |
| `amends` | CELEX IDs of acts this document amends |
| `amended_by` | CELEX IDs of acts that amend this document |
| `national_transpositions` | CELEX IDs of national implementing measures (optional, slower) |
| `language_versions` | ISO language codes available in EUR-Lex (e.g. `en,de,fr`) |
| `full_text_url` | EUR-Lex HTML full-text URL |
| `pdf_url` | EUR-Lex PDF URL |
| `xml_url` | EUR-Lex XML (Formex 4) URL |

---

### Input Configuration

#### Required

- **Query Mode** (`mode`) — One of: `by_keyword`, `by_celex_id`, `by_eurovoc_subject`, `by_date_range`, `by_document_type`, `recent_acts`
- **Max Items** (`maxItems`) — Maximum number of records to return (1–50,000)

#### Optional

- **Search Query / CELEX ID / EuroVoc Subject** (`query`) — Keyword(s) for `by_keyword`; CELEX number for `by_celex_id`; EuroVoc label for `by_eurovoc_subject`
- **Document Type Filter** (`documentType`) — Narrow results to: Regulation, Directive, Decision, Opinion, Judgment, Proposal (Regulation), Proposal (Directive), Treaty
- **Date From / Date To** (`dateFrom`, `dateTo`) — Publication date range for `by_date_range` mode (format: YYYY-MM-DD)
- **Lookback Days** (`lookbackDays`) — Days to look back for `recent_acts` mode (1–365, default: 30)
- **Include Amendment Tree** (`includeAmendments`) — Resolve `amends` / `amended_by` relationships (default: true)
- **Include National Transpositions** (`includeTranspositions`) — Fetch national implementing measures — one extra SPARQL call per document, slower (default: false)

---

### Example Inputs

**Find AI Act and related regulations:**
```json
{
  "mode": "by_keyword",
  "query": "artificial intelligence",
  "documentType": "REG",
  "maxItems": 20
}
````

**Fetch the AI Act by CELEX ID:**

```json
{
  "mode": "by_celex_id",
  "query": "32024R1689",
  "maxItems": 1
}
```

**Recent regulations from the last 30 days:**

```json
{
  "mode": "recent_acts",
  "lookbackDays": 30,
  "documentType": "REG",
  "maxItems": 100
}
```

**All data governance legislation:**

```json
{
  "mode": "by_date_range",
  "dateFrom": "2020-01-01",
  "dateTo": "2025-12-31",
  "query": "data governance",
  "maxItems": 500
}
```

***

### Performance Notes

- The SPARQL endpoint is open — no proxy or authentication required.
- Each document requires two SPARQL calls (discovery + enrichment). National transpositions add a third call per document.
- For large result sets (>1,000), allow sufficient timeout. The actor default is 4 hours.
- Rate limiting is applied automatically between queries to respect the endpoint.

***

### Data Source

All data is sourced directly from the **EUR-Lex SPARQL endpoint** — the authoritative EU Cellar linked data repository maintained by the Publications Office of the European Union. Data is structured using the Common Data Model (CDM) ontology.

EUR-Lex is an official EU website; its data is in the public domain under the [EUR-Lex copyright notice](https://eur-lex.europa.eu/content/legal-notice/legal-notice.html).

# Actor input Schema

## `sp_intended_usage` (type: `string`):

Please describe how you plan to use the data extracted by this crawler.

## `sp_improvement_suggestions` (type: `string`):

Provide any feedback or suggestions for improvements.

## `sp_contact` (type: `string`):

Provide your email address so we can get in touch with you.

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

How to select documents from EUR-Lex.

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

Keyword(s) for by\_keyword mode; CELEX number for by\_celex\_id (e.g. 32024R1689); EuroVoc concept URI or label for by\_eurovoc\_subject.

## `documentType` (type: `string`):

Filter by document type. Leave blank for all types.

## `dateFrom` (type: `string`):

Start of publication date range (by\_date\_range mode). Format: YYYY-MM-DD.

## `dateTo` (type: `string`):

End of publication date range (by\_date\_range mode). Format: YYYY-MM-DD.

## `lookbackDays` (type: `integer`):

Number of days to look back for recent\_acts mode.

## `includeAmendments` (type: `boolean`):

Resolve amends / amended\_by relationships from SPARQL.

## `includeTranspositions` (type: `boolean`):

Fetch national\_implementing\_measure relations (slower — one extra SPARQL call per doc).

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

Maximum number of legislative records to return.

## Actor input object example

```json
{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "mode": "by_keyword",
  "query": "artificial intelligence",
  "lookbackDays": 30,
  "includeAmendments": true,
  "maxItems": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "mode": "by_keyword",
    "query": "artificial intelligence",
    "documentType": "",
    "dateFrom": "",
    "dateTo": "",
    "lookbackDays": 30,
    "includeAmendments": true,
    "includeTranspositions": false,
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("jungle_synthesizer/eur-lex-eu-legislation-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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "mode": "by_keyword",
    "query": "artificial intelligence",
    "documentType": "",
    "dateFrom": "",
    "dateTo": "",
    "lookbackDays": 30,
    "includeAmendments": True,
    "includeTranspositions": False,
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("jungle_synthesizer/eur-lex-eu-legislation-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "mode": "by_keyword",
  "query": "artificial intelligence",
  "documentType": "",
  "dateFrom": "",
  "dateTo": "",
  "lookbackDays": 30,
  "includeAmendments": true,
  "includeTranspositions": false,
  "maxItems": 10
}' |
apify call jungle_synthesizer/eur-lex-eu-legislation-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=jungle_synthesizer/eur-lex-eu-legislation-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "EUR-Lex Scraper - EU Regulations, Directives & Case Law",
        "description": "Scrape EUR-Lex for EU legislation: regulations, directives, decisions, judgments, treaties. Returns CELEX IDs, ELI URIs, EuroVoc subjects, amendment tree, legal basis, national transpositions, and full-text URLs. Built for LegalTech, compliance teams, and AI training pipelines.",
        "version": "1.0",
        "x-build-id": "ZaAFJDYIg1DOnyc09"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/jungle_synthesizer~eur-lex-eu-legislation-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-jungle_synthesizer-eur-lex-eu-legislation-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/jungle_synthesizer~eur-lex-eu-legislation-scraper/runs": {
            "post": {
                "operationId": "runs-sync-jungle_synthesizer-eur-lex-eu-legislation-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/jungle_synthesizer~eur-lex-eu-legislation-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-jungle_synthesizer-eur-lex-eu-legislation-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode",
                    "maxItems"
                ],
                "properties": {
                    "sp_intended_usage": {
                        "title": "What is the intended usage of this data?",
                        "minLength": 1,
                        "type": "string",
                        "description": "Please describe how you plan to use the data extracted by this crawler."
                    },
                    "sp_improvement_suggestions": {
                        "title": "How can we improve this crawler for you?",
                        "minLength": 1,
                        "type": "string",
                        "description": "Provide any feedback or suggestions for improvements."
                    },
                    "sp_contact": {
                        "title": "Contact Email",
                        "minLength": 1,
                        "type": "string",
                        "description": "Provide your email address so we can get in touch with you."
                    },
                    "mode": {
                        "title": "Query Mode",
                        "enum": [
                            "by_keyword",
                            "by_celex_id",
                            "by_eurovoc_subject",
                            "by_date_range",
                            "by_document_type",
                            "recent_acts"
                        ],
                        "type": "string",
                        "description": "How to select documents from EUR-Lex."
                    },
                    "query": {
                        "title": "Search Query / CELEX ID / EuroVoc Subject",
                        "type": "string",
                        "description": "Keyword(s) for by_keyword mode; CELEX number for by_celex_id (e.g. 32024R1689); EuroVoc concept URI or label for by_eurovoc_subject."
                    },
                    "documentType": {
                        "title": "Document Type Filter",
                        "enum": [
                            "",
                            "REG",
                            "DIR",
                            "DEC",
                            "OPIN",
                            "JU",
                            "PROP_REG",
                            "PROP_DIR",
                            "TREAT"
                        ],
                        "type": "string",
                        "description": "Filter by document type. Leave blank for all types."
                    },
                    "dateFrom": {
                        "title": "Date From (YYYY-MM-DD)",
                        "type": "string",
                        "description": "Start of publication date range (by_date_range mode). Format: YYYY-MM-DD."
                    },
                    "dateTo": {
                        "title": "Date To (YYYY-MM-DD)",
                        "type": "string",
                        "description": "End of publication date range (by_date_range mode). Format: YYYY-MM-DD."
                    },
                    "lookbackDays": {
                        "title": "Lookback Days",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "Number of days to look back for recent_acts mode."
                    },
                    "includeAmendments": {
                        "title": "Include Amendment Tree",
                        "type": "boolean",
                        "description": "Resolve amends / amended_by relationships from SPARQL."
                    },
                    "includeTranspositions": {
                        "title": "Include National Transpositions",
                        "type": "boolean",
                        "description": "Fetch national_implementing_measure relations (slower — one extra SPARQL call per doc)."
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Maximum number of legislative records to return.",
                        "default": 10
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
