# BOE Scraper — Spain Official Gazette (`rastriq/boe-scraper`) Actor

Scrape publications from the Boletín Oficial del Estado (BOE), Spain's official government gazette. Extract laws, regulations, public contracts, appointments, and legal notices. Filter by date, section, and department. Essential for legal compliance, public procurement, and regulatory monitoring.

- **URL**: https://apify.com/rastriq/boe-scraper.md
- **Developed by:** [Rastriq — Structured data from the world](https://apify.com/rastriq) (community)
- **Categories:** News, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## BOE Scraper — Spain Official Gazette

Extract publications from the Boletín Oficial del Estado (BOE), Spain's official government gazette. BOE Scraper collects laws, regulations, public contracts, appointments, and legal notices — structured and ready for compliance monitoring, procurement intelligence, and regulatory analysis.

> 🚀 **Try it free** — your first $5 of usage is on Apify. No credit card required.

### 📌 What is BOE Scraper?

**BOE Scraper** is an automated extractor for Spain's Boletín Oficial del Estado (boe.es), the country's official publication where all laws, royal decrees, public tenders, civil servant appointments, and legal notices are published daily. Instead of manually browsing the BOE website or building your own parser, this scraper delivers structured data from the BOE's open data API — filtered by date, section, and keyword.

Use BOE Scraper to:

- ⚖️ **Monitor regulatory changes** — track new laws, decrees, and ministerial orders that affect your industry
- 📋 **Track public procurement** — capture tenders and contract awards (Section V-A) for competitive intelligence
- 👤 **Follow appointments** — monitor civil servant changes in specific departments or agencies
- 🔍 **Search by keyword** — filter the entire gazette for terms relevant to your compliance needs
- 🔄 **Automate daily compliance feeds** — schedule runs to receive fresh BOE data every morning

### 📋 What data does BOE Scraper extract?

BOE Scraper returns structured records with the following fields:

| Field | Type | Description |
|-------|------|-------------|
| `boe_id` | string | Official BOE item identifier (e.g. `BOE-A-2026-12345`) |
| `date` | string | Publication date (YYYY-MM-DD) |
| `section` | string | BOE section code (1, 2A, 2B, 3, 4, 5A, 5B, 5C, T) |
| `section_name` | string | Section name in Spanish |
| `department` | string | Issuing government department or body |
| `title` | string | Full title of the publication |
| `url_html` | string | Direct link to the HTML version on boe.es |
| `url_pdf` | string | Direct link to the official PDF |
| `epigraph` | string | Sub-classification within the section |
| `is_premium` | boolean | Whether the item requires paid access (rare) |

> 💡 BOE does not publish on Sundays or public holidays — those days are skipped automatically.

### 🚀 How to use BOE Scraper

Extracting BOE data takes under a minute:

1. **Create a free Apify account** at [apify.com](https://apify.com) — your first $5 is free
2. **Open BOE Scraper** in Apify Console or click **Try for free** on this page
3. **Set a date range** — use "Days back" (default: 7) or set specific start/end dates
4. **Select sections** (optional) — filter by legal category (laws, tenders, appointments, etc.)
5. **Add a keyword** (optional) — only include items matching your search term
6. **Click Start** — results arrive in seconds
7. **Download your data** in JSON, CSV, Excel, or XML — or access via API

### ⚙️ Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `daysBack` | integer | ❌ | `7` | Number of past days to fetch (1–365). Ignored if dates are set |
| `desde` | string | ❌ | — | Start date (inclusive), overrides daysBack |
| `hasta` | string | ❌ | — | End date (inclusive). Required when `desde` is set |
| `keyword` | string | ❌ | — | Filter items by title keyword (case-insensitive) |
| `maxItems` | integer | ❌ | `0` | Maximum items to return. `0` = unlimited |
| `seccion1` | boolean | ❌ | `false` | Include Section I — General provisions (laws, decrees) |
| `seccion2A` | boolean | ❌ | `false` | Include Section II-A — Appointments and status changes |
| `seccion2B` | boolean | ❌ | `false` | Include Section II-B — Public employment calls |
| `seccion3` | boolean | ❌ | `false` | Include Section III — Grants, subsidies, resolutions |
| `seccion4` | boolean | ❌ | `false` | Include Section IV — Justice administration |
| `seccion5A` | boolean | ❌ | `false` | Include Section V-A — Public procurement tenders |
| `seccion5B` | boolean | ❌ | `false` | Include Section V-B — Other official announcements |

> 💡 If no sections are selected, all sections are fetched.

**Example input:**

```json
{
  "daysBack": 30,
  "keyword": "licitación",
  "seccion5A": true,
  "maxItems": 100
}
```

### 📦 Output example

Each item is a structured JSON object. Here's a sample:

```json
{
  "boe_id": "BOE-B-2026-31542",
  "date": "2026-09-05",
  "section": "5A",
  "section_name": "V-A. Anuncios de licitaciones públicas y adjudicaciones",
  "department": "Ministerio de Transportes y Movilidad Sostenible",
  "title": "Anuncio de licitación de: Subsecretaría. Objeto: Servicio de mantenimiento integral de las instalaciones...",
  "url_html": "https://www.boe.es/diario_boe/txt.php?id=BOE-B-2026-31542",
  "url_pdf": "https://www.boe.es/boe/dias/2026/09/05/pdfs/BOE-B-2026-31542.pdf",
  "epigraph": "Servicios",
  "is_premium": false
}
```

Download results in **JSON, CSV, Excel, XML, or HTML** from the Output tab, or pull them programmatically using the Apify API.

### 💰 How much does it cost to use BOE Scraper?

BOE Scraper runs on Apify's standard **Compute Unit (CU) pricing**. Runs are extremely fast and lightweight — a typical 30-day extraction finishes in under 30 seconds and consumes less than 0.01 CUs.

| Plan | Monthly Credit | Estimated capacity |
|------|---------------|-------------------|
| Free | $5 (one-time) | Thousands of BOE items |
| Starter ($49/mo) | $49 | Unlimited daily monitoring |

> 💡 **Tip**: Leave defaults and click Start — you'll get the last 7 days of all sections in seconds, well within the free tier.

Is scraping the BOE free? Your first $5 of usage is covered by Apify's free trial credit — and BOE Scraper is so lightweight that the free tier covers extensive use.

### 🔗 Related Rastriq Actors

Explore the full [Rastriq intelligence portfolio](https://apify.com/rastriq) on Apify Store:

| Actor | Description |
|-------|-------------|
| [Google Ads Transparency Scraper](https://apify.com/rastriq/google-ads-scraper) | Ad campaigns from Google's Transparency Center |
| [Amazon Reviews Scraper](https://apify.com/rastriq/amazon-reviews-scraper) | Amazon reviews, ratings & product data |
| [TikTok Ad Library Scraper](https://apify.com/rastriq/tiktok-ad-library-scraper) | Ad creatives and performance data from TikTok |

### ❓ Frequently Asked Questions

#### Is scraping the BOE legal?

The Boletín Oficial del Estado is **public domain data** published by the Spanish government for universal access. BOE Scraper accesses the BOE's own open data API (`boe.es/datosabiertos`), which is explicitly designed for programmatic consumption. There are no legal restrictions on accessing or redistributing BOE content.

#### Does BOE Scraper require an account or API key?

No. BOE Scraper works entirely with the BOE's **public open data API** and does not require any account, login, or API credentials.

#### How far back can I scrape?

BOE Scraper supports up to **365 days back** using the `daysBack` parameter, or any custom date range using the `desde`/`hasta` fields. The BOE's online archive goes back decades, but the open data API has practical limits.

#### What are the BOE sections?

The BOE is organized into sections: **I** (laws and decrees), **II-A** (appointments), **II-B** (public employment), **III** (grants and resolutions), **IV** (justice), **V-A** (public procurement), **V-B** (other announcements). You can filter by one or more sections.

#### How do I integrate BOE Scraper with my workflow?

BOE Scraper integrates natively with **Make (Integromat)**, **Zapier**, **Google Sheets**, **webhooks**, and the **Apify API**. A common pattern is scheduling a daily run at 9am and sending new items to Slack or email via webhook.

#### I found a bug or my run failed. Where do I report it?

Open an issue in the **Issues tab** on this page. Include your input configuration and the run ID so we can investigate quickly.

***

### 🇪🇸 Versión en español

> Esta sección es un resumen en español del README anterior.

#### ¿Qué es BOE Scraper?

**BOE Scraper** extrae publicaciones del Boletín Oficial del Estado (boe.es) de forma automatizada. Recoge leyes, reales decretos, licitaciones públicas, nombramientos y anuncios oficiales — estructurados y listos para análisis de cumplimiento normativo, inteligencia de contratación pública e investigación regulatoria.

#### ¿Qué datos extrae BOE Scraper?

Cada registro incluye: identificador BOE, fecha de publicación, sección, departamento emisor, título completo, enlaces al HTML y PDF oficial, y epígrafe de clasificación.

#### ¿Cómo usar BOE Scraper?

1. Crea una cuenta gratuita en [apify.com](https://apify.com)
2. Abre BOE Scraper y configura el rango de fechas
3. Filtra por sección (leyes, oposiciones, licitaciones, etc.) y/o palabra clave
4. Haz clic en **Start** — los resultados llegan en segundos
5. Descarga en JSON, CSV, Excel o XML

#### ¿Cuánto cuesta usar BOE Scraper?

BOE Scraper usa el modelo de **Compute Units (CU)** de Apify. Las ejecuciones son extremadamente rápidas y ligeras — una extracción típica de 30 días termina en menos de 30 segundos. El crédito gratuito de $5 de Apify cubre un uso extensivo.

# Actor input Schema

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

Number of past days to fetch. Ignored if <b>From date</b> is set.<br>BOE does not publish on Sundays or public holidays — those days are skipped automatically.

## `desde` (type: `string`):

Start date (inclusive). Overrides <b>Days back</b>.

## `hasta` (type: `string`):

End date (inclusive). Required when <b>From date</b> is set.

## `keyword` (type: `string`):

Only include items whose title contains this keyword (case-insensitive). Leave empty for no filtering.

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

Maximum number of items to return. Set to <code>0</code> for unlimited.

## `seccion1` (type: `boolean`):

Laws, royal decrees, ministerial orders, and other general provisions.

## `seccion2A` (type: `boolean`):

Appointments, transfers, retirements, and status changes of civil servants.

## `seccion2B` (type: `boolean`):

Public employment calls, competitive exams, and job postings.

## `seccion3` (type: `boolean`):

Grants, subsidies, resolutions, and other administrative acts.

## `seccion4` (type: `boolean`):

Judicial appointments, court edicts, and justice administration notices.

## `seccion5A` (type: `boolean`):

Public procurement tenders, contract awards, and procurement notices.

## `seccion5B` (type: `boolean`):

Other official announcements and public notices.

## `proxyConfiguration` (type: `object`):

BOE's open data API works fine without proxy from datacenter IPs. Enable only if you experience blocks.

## Actor input object example

```json
{
  "daysBack": 7,
  "maxItems": 50,
  "seccion1": false,
  "seccion2A": false,
  "seccion2B": false,
  "seccion3": false,
  "seccion4": false,
  "seccion5A": false,
  "seccion5B": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rastriq/boe-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 = {
    "maxItems": 50,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("rastriq/boe-scraper").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 '{
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call rastriq/boe-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/E9Ml7YfFJ6ozlm4Gi/builds/s0DeQjVxYrVPdzW97/openapi.json
