# Spain Collective Agreements (Convenios Colectivos, BOE) (`innovito/convenios-colectivos-boe`) Actor

Official labour collective agreements (convenios colectivos) published in Spain's Boletín Oficial del Estado. Structured rows from the BOE Open Data API: title, department, dates and official PDF/HTML links. No personal data, no HTML scraping.

- **URL**: https://apify.com/innovito/convenios-colectivos-boe.md
- **Developed by:** [Asier Sanchez](https://apify.com/innovito) (community)
- **Categories:** Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 collective agreements

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

## Spain Collective Agreements (Convenios Colectivos, BOE)

Get official **labour collective agreements** (convenios colectivos) published in Spain’s Official State Gazette as clean JSON or CSV rows.

The Actor reads the **official BOE Open Data API**. No HTML scraping and no login. It keeps labour-agreement notices, redacts honourifics and personal names in titles when they appear, and returns official PDF/HTML links.

Ideal for HR and payroll software, gestorías, labour consultants and AI/MCP or n8n agents that need the official convenio.

### What you get

| Field | Description |
|---|---|
| `agreementId` | Official BOE identifier (`BOE-A-…`) |
| `publicationDate`, `gazetteNumber` | Gazette date and issue number |
| `department`, `epigraph` | Issuing body and heading |
| `title` | Official title (honourifics + names replaced with `[nombre omitido]` when detected) |
| `personalDataRedacted` | `true` when a name pattern was replaced |
| `htmlUrl`, `pdfUrl` | Official links on boe.es (the Actor does not fetch disallowed `xml.php` routes) |
| `sourceAttribution` | Required credit line |

### Input example

```json
{
  "dateFrom": "2026-11-18",
  "dateTo": "2026-11-21",
  "keywords": ["metal", "hostelería", "Madrid"],
  "maxItems": 20
}
```

If `dateFrom` is empty, `lookbackDays` (default 14, maximum 62) is counted back from `dateTo` or today. Days without a BOE issue are skipped.

### Output example

```json
{
  "agreementId": "BOE-A-2026-24110",
  "controlNumber": "24110",
  "publicationDate": "2026-11-21",
  "gazetteNumber": "280",
  "section": "3",
  "sectionName": "III. Otras disposiciones",
  "department": "Ministerio de Trabajo y Economía Social",
  "epigraph": "Convenios colectivos de trabajo",
  "title": "Resolución de 10 de noviembre de 2026, por la que se registra y publica el Convenio colectivo de un sector estatal",
  "personalDataRedacted": false,
  "htmlUrl": "https://www.boe.es/diario_boe/txt.php?id=BOE-A-2026-24110",
  "pdfUrl": "https://www.boe.es/boe/dias/2026/11/21/pdfs/BOE-A-2026-24110.pdf",
  "xmlUrl": null,
  "source": "boe",
  "sourceAttribution": "Fuente: Boletín Oficial del Estado (AEBOE). https://www.boe.es",
  "scrapedAt": "2026-11-23T21:00:00+00:00"
}
```

### Python example (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("innovito/convenios-colectivos-boe").call(
    run_input={
        "dateFrom": "2026-11-18",
        "dateTo": "2026-11-21",
        "keywords": ["metal", "hostelería", "Madrid"],
        "maxItems": 20,
    }
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["publicationDate"], item["agreementId"], item["title"])
```

### Pricing

Pay-per-event: $2.50 per 1,000 agreements written to the dataset, plus $0.00005 per Actor start. You are not charged for platform compute.

### Data source and terms

- API: `https://www.boe.es/datosabiertos/api/boe/sumario/{YYYYMMDD}` ([Open Data portal](https://www.boe.es/datosabiertos/)).
- Reuse is subject to the [AEBOE legal notice](https://www.boe.es/informacion/aviso_legal/index.php#reutilizacion). Credit the Agencia Estatal Boletín Oficial del Estado. Do not present this Actor as an official BOE product.
- The Actor only calls the Open Data API. It does not request `/diario_boe/xml.php` (disallowed by `robots.txt`).

***

## Convenios colectivos de España (BOE)

Extrae los **convenios colectivos** publicados en el Boletín Oficial del Estado en filas JSON o CSV.

Usa la **API oficial de datos abiertos del BOE**. Sin scraping HTML ni inicio de sesión. Conserva las disposiciones de convenios laborales, redacta tratamientos y nombres en el título cuando aparecen, y devuelve los enlaces oficiales a PDF y HTML.

Ideal para software de RR. HH. y nóminas, gestorías, asesorías laborales y agentes de IA, MCP o n8n que necesitan el convenio oficial.

### Qué devuelve

| Campo | Descripción |
|---|---|
| `agreementId` | Identificador oficial del BOE (`BOE-A-…`) |
| `publicationDate`, `gazetteNumber` | Fecha y número del boletín |
| `department`, `epigraph` | Órgano emisor y epígrafe |
| `title` | Título oficial (tratamientos y nombres sustituidos por `[nombre omitido]` si se detectan) |
| `personalDataRedacted` | `true` si se sustituyó un patrón de nombre |
| `htmlUrl`, `pdfUrl` | Enlaces oficiales en boe.es (el Actor no llama a `xml.php`) |
| `sourceAttribution` | Línea de atribución obligatoria |

### Ejemplo de entrada

```json
{
  "dateFrom": "2026-11-18",
  "dateTo": "2026-11-21",
  "keywords": ["metal", "hostelería", "Madrid"],
  "maxItems": 20
}
```

Si no hay `dateFrom`, se usan `lookbackDays` (14 por defecto, máximo 62) hasta `dateTo` o hoy. Los días sin boletín se omiten.

### Ejemplo de salida

```json
{
  "agreementId": "BOE-A-2026-24110",
  "publicationDate": "2026-11-21",
  "department": "Ministerio de Trabajo y Economía Social",
  "epigraph": "Convenios colectivos de trabajo",
  "title": "Resolución de 10 de noviembre de 2026, por la que se registra y publica el Convenio colectivo de un sector estatal",
  "pdfUrl": "https://www.boe.es/boe/dias/2026/11/21/pdfs/BOE-A-2026-24110.pdf",
  "sourceAttribution": "Fuente: Boletín Oficial del Estado (AEBOE). https://www.boe.es"
}
```

### Ejemplo en Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("innovito/convenios-colectivos-boe").call(
    run_input={
        "dateFrom": "2026-11-18",
        "dateTo": "2026-11-21",
        "keywords": ["metal", "hostelería", "Madrid"],
        "maxItems": 20,
    }
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["publicationDate"], item["agreementId"], item["title"])
```

### Precio

Pago por uso: 2,50 $ por cada 1.000 convenios escritos en el dataset, más 0,00005 $ por arranque. No se cobra el cómputo de la plataforma.

### Origen y condiciones

- API: `https://www.boe.es/datosabiertos/api/boe/sumario/{YYYYMMDD}` ([portal de datos abiertos](https://www.boe.es/datosabiertos/)).
- Reutilización sujeta al [aviso legal de la AEBOE](https://www.boe.es/informacion/aviso_legal/index.php#reutilizacion). Hay que citar al Boletín Oficial del Estado. Este Actor no es un producto oficial del BOE.
- Solo llama a la API de datos abiertos. No solicita `/diario_boe/xml.php` (lo prohíbe `robots.txt`).

# Actor input Schema

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

First publication date to include (YYYY-MM-DD). If empty, the Actor looks back <code>lookbackDays</code> from the end date.

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

Last publication date to include (YYYY-MM-DD). Defaults to today (UTC). Days with no BOE issue (Sundays and some holidays) are skipped.

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

When <code>dateFrom</code> is empty, how many days to request ending at <code>dateTo</code>. Capped at 62.

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

Keep only agreements whose title, department or epigraph contains one of these words (case-insensitive), e.g. <code>metal</code>, <code>hostelería</code>, <code>Madrid</code>. Empty = all labour collective agreements. Also useful: <code>Cataluña</code>, <code>comercio</code>, <code>construcción</code>.

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

Stop after this many agreements. 0 = no limit.

## Actor input object example

```json
{
  "lookbackDays": 14,
  "maxItems": 0
}
```

# Actor output Schema

## `agreements` (type: `string`):

Dataset of official Spanish convenios colectivos from the BOE Open Data API (one row per agreement).

## `runStats` (type: `string`):

RUN_STATS record: days requested, agreements found and pushed, days without a BOE issue.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("innovito/convenios-colectivos-boe").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("innovito/convenios-colectivos-boe").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 '{}' |
apify call innovito/convenios-colectivos-boe --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,innovito/convenios-colectivos-boe"
        }
    }
}
```

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/rTl2qsai8Zqka8m83/builds/tNX4q6ckO1vhcQt7B/openapi.json
