# Spain Official Gazette (BOE) to JSON — grants, tax, public jobs (`lif_manager/spain-boe-official-gazette-json`) Actor

Every item of Spain's Official State Gazette (BOE) as clean JSON for AI agents, RAG and alerts: title, legal rank, ministry, section, PDF/HTML/XML links and topic tags (grants, tax, public jobs, procurement, housing, labour, energy). Official open-data API, no login, one day or a date range.

- **URL**: https://apify.com/lif_manager/spain-boe-official-gazette-json.md
- **Developed by:** [LIF](https://apify.com/lif_manager) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 item delivereds

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 Official Gazette (BOE) to JSON — grants, tax, public jobs

> 🇪🇸 **En español:** [ir a la versión en español](#-en-español) · *English below.*

Every item published in **Spain's Official State Gazette (Boletín Oficial del Estado, BOE)** as clean, flat JSON that AI agents, RAG pipelines, spreadsheets and alert workflows can use directly:

- 🗂️ **One record per item**: BOE id, publication date, section, ministry or body, heading, title, **legal rank** (Ley, Real Decreto, Orden, Resolución, Extracto…), page range and PDF / HTML / XML links.
- 🏷️ **Topic tags** so you only get what matters: **grants & subsidies** (`ayudas_subvenciones`), **tax** (`fiscal`), **public jobs / civil-service exams** (`empleo_publico`), **public procurement** (`contratacion_publica`), **housing & accessibility** (`vivienda_accesibilidad`), **labour & social security** (`laboral`) and **energy** (`energia`).
- 📄 **Optional full text for RAG**: the official XML turned into clean paragraphs, plus the BOE's own subject tags (*materias*), ELI link and dates.
- 📅 **One day or a date range** (up to 31 days per run). Sundays and days without an issue are skipped.
- 🔎 **Filters**: topics, keyword, section and ministry.

Source: the BOE's **official open-data API** ([documentation](https://www.boe.es/datosabiertos/documentos/APIsumarioBOE.pdf)). Public data, no login, no scraping of web pages, no third-party AI.

### Who it is for

- **AI agents and assistants** that need to answer "what was published today about X?" with official links.
- **Grant consultants, gestorías and property managers** watching for new calls for grants (accessibility, housing, energy, employment).
- **Tax advisors and accountants** tracking new orders, forms (*modelos*) and resolutions.
- **Civil-service exam academies** tracking new calls (*oposiciones*).
- **Legal-tech and RAG builders** that need the daily BOE as structured data.

### 🔒 What happens to your data

| What | Where it goes |
|---|---|
| **Your input** | Dates, topics and filters only. Nothing personal is needed. |
| **Network** | Only `www.boe.es` (official open-data API and the official XML of each item) and `api.apify.com`. |
| **Results** | Stay in the run's dataset in your own Apify account, with your plan's retention. |
| **Third parties** | None. No AI API, no analytics, no telemetry. |
| **Us (LIF)** | We don't see your runs or results, unless you turn on *Share run data with developers* or attach a run link when reporting an issue ([how it works](https://docs.apify.com/platform/collaboration/general-resource-access)). |

### How to use it

1. Pick **From date** and **To date** (or just From date for one day).
2. Optionally choose **Topics** — for example only *Grants & subsidies* — and a **Keyword**.
3. Turn on **Include full text** if you are feeding a RAG or an LLM.
4. Run it. **Leave the input empty for a free demo** with 10 items of the latest issue.

From an AI agent (Apify MCP server or API):

```json
{"dateFrom": "2026-11-02", "dateTo": "2026-11-06", "topics": ["ayudas_subvenciones"], "fullText": true}
```

Daily alert (schedule it every morning, Monday to Saturday):

```json
{"latest": true, "topics": ["fiscal"], "keyword": "IVA"}
```

### Input

| Field | Default | What it does |
|---|---|---|
| `dateFrom` | — | First day (YYYY-MM-DD). Both dates empty = free demo. |
| `dateTo` | = `dateFrom` | Last day. Up to 31 days per run. |
| `latest` | false | With no dates: the whole latest issue (charged) instead of the demo. |
| `topics` | all | Keep items with any of these tags. |
| `keyword` | — | Text that must appear in the title or body name. |
| `sections` | all | BOE section codes: `1`, `2A`, `2B`, `3`, `4`, `5A`, `5B`, `5C`, `T`. |
| `departments` | all | Part of the ministry or body name, e.g. `HACIENDA`. |
| `fullText` | false | Adds `texto`, `materias`, `eli`, `fecha_disposicion`, `fecha_vigencia`, `numero_oficial`. |
| `maxItems` | 1000 | Stop after this many items. |

### Output

```json
{
  "id": "BOE-A-2026-23269",
  "fecha_publicacion": "2026-11-06",
  "seccion_codigo": "1",
  "seccion": "I. Disposiciones generales",
  "departamento": "MINISTERIO DE TRANSPORTES Y MOVILIDAD SOSTENIBLE",
  "epigrafe": "Subvenciones",
  "titulo": "Real Decreto 955/2026, de 5 de noviembre, por el que se regula la concesión directa de subvenciones a la Real Sociedad Geográfica y al Observatorio del Ebro durante el ejercicio presupuestario 2026.",
  "rango": "Real Decreto",
  "temas": ["ayudas_subvenciones"],
  "url_pdf": "https://www.boe.es/boe/dias/2026/11/06/pdfs/BOE-A-2026-23269.pdf",
  "url_html": "https://www.boe.es/diario_boe/txt.php?id=BOE-A-2026-23269",
  "url_xml": "https://www.boe.es/diario_boe/xml.php?id=BOE-A-2026-23269",
  "paginas": "149255-149269",
  "fuente": "BOE",
  "status": "ok"
}
```

A typical issue has about **200 items**; on an average day 3–6 are grants and subsidies, around 25 are public jobs and around 10 are tax-related.

### Pricing

Pay per event, no subscription:

| Event | Price |
|---|---|
| Item delivered | **USD 0.001** |
| Item delivered with full text | **USD 0.002** |

A whole day of the BOE costs about USD 0.20 (USD 0.40 with full text). A daily grants alert costs a few cents a month. The demo is free. Set a maximum cost per run in Apify and the Actor stops when it is reached.

### Limitations

- **Topic tags are keyword-based**: they can miss items or over-match (e.g. "1,500 places" in a training course tagged as public jobs). Use the keyword filter or the BOE's own *materias* (full text mode) when precision matters.
- Only the BOE for now: regional gazettes (BOJA, DOGC, BOCM…) and the national grants database (BDNS) are not included yet. Tell us which one you need.
- This is not legal advice. Always check the official PDF.

### Support

Open an issue in the Actor's **Issues** tab. Spanish and English welcome.

### 🇪🇸 En español

**El BOE de cada día, o de un rango de fechas, en JSON limpio**, listo para agentes de IA, RAG, hojas de cálculo y alertas. Usa la API oficial de datos abiertos del BOE: sin login y sin raspar páginas.

- **Un registro por disposición:** identificador, fecha, sección, ministerio u organismo, epígrafe, título, **rango** (Ley, Real Decreto, Orden, Resolución, Extracto…), páginas y enlaces al PDF, HTML y XML.
- **Etiquetas de tema** para quedarte con lo que te importa: **ayudas y subvenciones**, **fiscal**, **empleo público y oposiciones**, **contratación pública**, **vivienda y accesibilidad**, **laboral y Seguridad Social** y **energía**.
- **Texto completo opcional** para RAG: el XML oficial convertido en párrafos limpios, con las *materias* del propio BOE, enlace ELI y fechas.
- **Filtros:** temas, palabra clave, sección y departamento. Hasta 31 días por ejecución; los domingos se saltan solos.

**Para quién:** gestorías y consultoras de subvenciones, asesores fiscales y contables, academias de oposiciones, administradores de fincas, legaltech y equipos que arman RAG con normativa española.

**Ejemplos de entrada**

Ayudas y subvenciones de una semana, con texto completo:

```json
{"dateFrom": "2026-11-02", "dateTo": "2026-11-06", "topics": ["ayudas_subvenciones"], "fullText": true}
```

Alerta diaria de novedades sobre el IVA (prográmala de lunes a sábado):

```json
{"latest": true, "topics": ["fiscal"], "keyword": "IVA"}
```

**Precio:** USD 0,001 por disposición entregada (USD 0,002 con texto completo), sin suscripción. Un BOE entero cuesta unos USD 0,20; una alerta diaria de ayudas, unos centavos al mes. **Con la entrada vacía corre una demo gratis** con 10 disposiciones del último BOE.

**Límites:** las etiquetas se asignan por palabras clave y pueden fallar; para precisión, usa el filtro de texto o las *materias* del modo texto completo. Por ahora solo el BOE (sin boletines autonómicos ni BDNS: dinos cuál necesitas). No es asesoramiento jurídico: verifica siempre en el PDF oficial.

**Soporte:** abre una *issue* en la pestaña **Issues**, en español o en inglés.

# Actor input Schema

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

First day (YYYY-MM-DD). Leave both dates empty for a free demo with the latest issue.

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

Last day (YYYY-MM-DD). Up to 31 days per run. Empty = same as From date.

## `latest` (type: `boolean`):

With no dates: deliver the whole latest issue instead of the 10-item demo.

## `topics` (type: `array`):

Keep only items with any of these tags (keyword-based, may miss or over-match).

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

Case-insensitive text that must appear in the title or ministry, e.g. 'IVA' or 'Madrid'.

## `sections` (type: `array`):

BOE section codes: 1, 2A, 2B, 3, 4, 5A, 5B, 5C, T.

## `departments` (type: `array`):

Part of the ministry or body name, e.g. 'HACIENDA'.

## `fullText` (type: `boolean`):

Also download each item's official XML and add the full text as clean paragraphs, the BOE's own subject tags (materias), ELI link and dates. Charged as 'Item with full text' instead of 'Item'.

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

Stop after this many items.

## Actor input object example

```json
{
  "latest": false,
  "fullText": false,
  "maxItems": 1000
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("lif_manager/spain-boe-official-gazette-json").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("lif_manager/spain-boe-official-gazette-json").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 lif_manager/spain-boe-official-gazette-json --silent --output-dataset

```

## MCP server setup

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

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/4OGe9HLmG5JaXcs45/builds/VUwHIRgq7VZxto8lu/openapi.json
