# Catalonia DOGC Legislation Scraper (`spain-data/catalonia-dogc-legislation`) Actor

Get Catalan laws, decrees and orders from the DOGC via the official Generalitat open data API. Catalan and Spanish titles, in force or repealed status, ELI links. Archive since 1977. Filter by keyword, rank and department.

- **URL**: https://apify.com/spain-data/catalonia-dogc-legislation.md
- **Developed by:** [Roberto Valera Calatrava](https://apify.com/spain-data) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 provisions

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

## Catalonia DOGC Legislation Scraper (Diari Oficial de la Generalitat de Catalunya)

**Get Catalan laws, decree-laws, decrees and ministerial orders** published in the **DOGC (Diari Oficial de la Generalitat de Catalunya)**, as clean structured data. Everything comes from the **official open data API of the Generalitat de Catalunya**, updated daily.

Each provision comes with its **title in Catalan and Spanish**, legal rank, official number, publication date, **validity status (in force or repealed)** and links to the **ELI**, HTML, PDF and XML versions in both languages. The archive goes back to **1977** (more than 31,000 provisions).

> Normativa catalana del DOGC: lleis, decrets llei, decrets i ordres, en català i castellà, amb vigència i enllaços ELI.

### What does Catalonia DOGC Legislation Scraper do?

- Queries the **official open data dataset** "Normativa del DOGC i del Portal Jurídic de Catalunya" (no fragile HTML scraping).
- Returns laws, decree-laws, legislative decrees, decrees and orders from **Section 1 of the DOGC** (general provisions).
- Lets you filter by **keyword (Catalan or Spanish)**, **legal rank**, **department**, **validity** and **date range**.
- Gives you links to the **consolidated latest version** on the Portal Jurídic de Catalunya (ELI) and to the original publication in HTML, PDF and XML.

### Who is it for?

| You are... | Use it to... |
| --- | --- |
| A law firm or legal department working in Catalonia | Track **new Catalan legislation** in your practice areas. |
| A compliance team or company operating in Catalonia | Get an alert when the **Generalitat** regulates your sector (housing, tourism, environment, health...). |
| A legal tech or AI company | Build a **bilingual corpus of Catalan legislation** since 1977. |
| A consultancy, association or public affairs team | Monitor **decrees and orders** by department. |
| A researcher or journalist | Analyse Catalan regulatory activity over time. |

### How to use it

1. Click **Try for free** (or **Start**).
2. Optionally enter **keywords** (Catalan or Spanish), choose **legal ranks** or **department codes**.
3. Choose **Days back** (default 30) or set a **date range**.
4. Click **Start** and download the results as **JSON, CSV, Excel or HTML**, or connect an integration.

#### Get a weekly Catalan legislation alert (recommended)

1. Save your filters as a **Task** with **Days back = 7**.
2. Add a weekly **Schedule**.
3. Connect an **integration** (Google Sheets, Slack, email, Zapier, Make or a webhook).

### Input examples

**All new Catalan laws and decree-laws from the last 3 months:**

```json
{
  "ranks": ["Llei", "Decret llei"],
  "daysBack": 90
}
```

**Housing legislation in force (any date), for a legal AI corpus:**

```json
{
  "keywords": ["habitatge", "vivienda"],
  "status": "Vigent",
  "startDate": "1977-01-01",
  "maxItems": 5000
}
```

**Orders from the Department of Health in 2026:**

```json
{
  "ranks": ["Ordre"],
  "departmentCodes": ["SLT"],
  "startDate": "2026-01-01"
}
```

#### Input fields

| Field | Description |
| --- | --- |
| Keywords | Words to look for in the Catalan or Spanish title (accents ignored). |
| Exclude keywords | Skip provisions containing these words. |
| Legal rank | Law, decree-law, legislative decree, decree, order. |
| Department codes | Department code in the order number, e.g. SLT (Health), ECF (Economy), JUS (Justice), ARP (Agriculture), EDU (Education), TER (Territory). |
| Validity | All, in force (Vigent) or repealed (Derogada). |
| Days back | Provisions published in the last N days (default 30). |
| Start / end date | Optional publication date range (archive since 1977). |
| Maximum results | Stop after N provisions. |

### Output example

```json
{
  "id": "26295001",
  "titol": "Llei 14/2026, de 21 d'octubre, de les cambres oficials de comerç, indústria, serveis i navegació i del Consell General de les Cambres Oficials de Comerç, Indústria, Serveis i Navegació de Catalunya",
  "tituloEs": "Ley 14/2026, de 21 de octubre, de las cámaras oficiales de comercio, industria, servicios y navegación y del Consejo General de las Cámaras Oficiales de Comercio, Industria, Servicios y Navegación de Cataluña",
  "rang": "Llei",
  "numeroOficial": "14/2026",
  "codiDepartament": null,
  "dataDocument": "2026-10-21",
  "dataPublicacio": "2026-10-23",
  "numeroDogc": "9779",
  "vigencia": "Vigent",
  "derogada": false,
  "urlEli": "https://portaljuridic.gencat.cat/eli/es-ct/l/2026/10/21/14",
  "urlHtml": "https://portaljuridic.gencat.cat/eli/es-ct/l/2026/10/21/14/dof/cat/html",
  "urlPdf": "https://portaljuridic.gencat.cat/eli/es-ct/l/2026/10/21/14/dof/cat/pdf",
  "urlXml": "https://portaljuridic.gencat.cat/eli/es-ct/l/2026/10/21/14/dof/cat/xml",
  "urlHtmlEs": "https://portaljuridic.gencat.cat/eli/es-ct/l/2026/10/21/14/dof/spa/html",
  "urlPdfEs": "https://portaljuridic.gencat.cat/eli/es-ct/l/2026/10/21/14/dof/spa/pdf",
  "urlXmlEs": "https://portaljuridic.gencat.cat/eli/es-ct/l/2026/10/21/14/dof/spa/xml"
}
```

### How much does it cost?

You pay **only for the provisions you get**: **$5 per 1,000 results** (half a cent per provision), with discounts on Apify's paid plans. Platform usage is included.

| Typical use | Approximate cost |
| --- | --- |
| Weekly alert (~5 new provisions) | about $0.03 per week |
| All 2026 legislation (~200 provisions) | about $1 |
| Full archive since 1977 (~31,000 provisions) | about $155 |

Apify's free plan includes monthly credits, so you can try it at no cost.

### FAQ

**Where does the data come from?**
From the official open data dataset "Normativa del DOGC i del Portal Jurídic de Catalunya", published by the Generalitat de Catalunya (EADOP) on its open data portal and updated daily.

**Which provisions are included?**
Laws, decree-laws, legislative decrees, decrees and orders from Section 1 of the DOGC (general provisions), in force and repealed, since 5 December 1977. Resolutions, notices and announcements are not included in the source dataset.

**Is the full text included?**
Each item links to the HTML, PDF and XML text in Catalan and Spanish, and to the consolidated latest version on the Portal Jurídic de Catalunya.

**Does it include personal data?**
No. The source dataset only contains general provisions (laws, decrees and orders).

### Data source

Data: open data portal of the Generalitat de Catalunya (Dades obertes de Catalunya), dataset "Normativa del DOGC i del Portal Jurídic de Catalunya". Attribution: Entitat Autònoma del Diari Oficial i de Publicacions de la Generalitat de Catalunya (EADOP). Reuse is subject to the portal's terms of use.

This Actor is not affiliated with or endorsed by the Generalitat de Catalunya.

### Related Actors

- **[Spain BOE Legislation Scraper](https://apify.com/spain-data/spain-boe-legislation)**: new Spanish state laws, decrees and orders from the BOE, with legal metadata and full text.
- **[Spain Public Tenders Scraper](https://apify.com/spain-data/spain-public-tenders)**: Spanish public tenders (licitaciones) with filters by keyword, CPV, region and budget.

### Feedback

Found a bug or need a new field or filter? Open an issue in the **Issues** tab and it will be looked at quickly.

***

**Resum en català:** obtén les lleis, decrets llei, decrets i ordres del DOGC des de l'API oficial de dades obertes de la Generalitat, amb títols en català i castellà, vigència i enllaços ELI. Arxiu des de 1977.

**Resumen en español:** obtén las leyes, decretos ley, decretos y órdenes del DOGC desde la API oficial de datos abiertos de la Generalitat, con títulos en catalán y castellano, vigencia y enlaces ELI. Archivo desde 1977.

# Actor input Schema

## `keywords` (type: `array`):

Only return provisions whose Catalan or Spanish title contains at least one of these words (accents ignored). Example: habitatge, vivienda, turisme, subvencions.

## `excludeKeywords` (type: `array`):

Skip provisions containing any of these words.

## `ranks` (type: `array`):

Leave empty for all ranks.

## `departmentCodes` (type: `array`):

Filter ministerial orders by the department code in their number, e.g. SLT (Health), ECF (Economy and Finance), JUS (Justice), ARP (Agriculture), EDU (Education), TER (Territory), EMT (Business and Labour).

## `status` (type: `string`):

Return all provisions, only those still in force, or only repealed ones.

## `daysBack` (type: `integer`):

Return provisions published in the last N days. Ignored if a date range is set. Use 1 to 7 for a daily or weekly schedule.

## `startDate` (type: `string`):

Optional. Publication date from (YYYY-MM-DD). The archive goes back to 1977.

## `endDate` (type: `string`):

Optional. Publication date until (YYYY-MM-DD).

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

Stop after this many provisions.

## Actor input object example

```json
{
  "status": "all",
  "daysBack": 30,
  "maxItems": 50
}
```

# 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 = {
    "daysBack": 30,
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("spain-data/catalonia-dogc-legislation").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 = {
    "daysBack": 30,
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("spain-data/catalonia-dogc-legislation").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 '{
  "daysBack": 30,
  "maxItems": 50
}' |
apify call spain-data/catalonia-dogc-legislation --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spain-data/catalonia-dogc-legislation"
        }
    }
}
```

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/SItWQVGJ6tVH1yv7U/builds/xfHwY7Abjez5AgmZc/openapi.json
