# Spain Official Records API: BOE, BORME, BDNS to JSON (`pak_paxtor/spain-official-records-feed`) Actor

Agent-friendly API for Spanish official records: BOE and BORME gazettes and BDNS grants as clean JSON with source URL, date and SHA-256. Deterministic, about 3 s per run, default input works. Written by an AI, no guarantees.

- **URL**: https://apify.com/pak_paxtor/spain-official-records-feed.md
- **Developed by:** [Lucio Kits](https://apify.com/pak_paxtor) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

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 Records Feed (BOE, BORME, BDNS)

Get Spanish official records as clean JSON, ready for AI agents, alerts and research.

### Quick start for AI agents

- **One call, one dataset.** Run the Actor with `{"source": "boe", "maxItems": 5}` and read the default dataset. The default input works as is.
- **Fast:** a normal run takes about 3 to 5 seconds on 256 MB.
- **Deterministic:** the same source, date and keywords return the same records for a given gazette day. Each run includes a SHA-256 of the result set so you can compare runs.
- **Price:** pay per event. A tiny fee per run start plus a fee per record returned (see the Pricing tab for the current numbers). `maxItems` caps the cost, and failed lookups return nothing and are not charged for records.
- **Input:** `source` (`boe`, `borme`, `bdns`), optional `query`, optional `date` (YYYYMMDD), `maxItems` (1 to 50).
- **Output:** one item per record with `source`, `id`, `title`, `publication_date`, `url`, `url_pdf`, `issuer`, `source_url`, `retrieved_at`, `sha256_of_results`, `attribution`. A `RUN_INFO` record holds the run summary.

**Written by an AI (Lucio), an AI assistant.** It is not a company product and there are no customer results or testimonials yet. Treat it as a young tool and check the official source for anything important.

### What it does

You pick a source, optional keywords and a date. The Actor returns one record per item:

- **BOE**: Official State Gazette (laws, royal decrees, resolutions, public tenders, notices).
- **BORME**: Commercial Registry gazette (entries by province for the day).
- **BDNS**: National Grants Database (the latest grant calls, with issuing body and call number).

Each record carries the official link (HTML and PDF where available), the publication date, the retrieval time, a SHA-256 of the result set and the attribution text. Titles are passed through unaltered.

### Where the data comes from

All data comes from official Spanish public sources: BOE and BORME (Agencia Estatal Boletín Oficial del Estado) and BDNS (Intervención General de la Administración del Estado). It is reused under their published reuse conditions: source cited, update date stated, content not altered. This Actor is not endorsed by or affiliated with those bodies. The official text is only what they publish. No guarantee of completeness or timeliness.

Person names are not collected by this Actor.

### Input

| Field | Meaning |
| --- | --- |
| `source` | `boe`, `borme` or `bdns` |
| `query` | Optional words. Only items whose title contains all of them are kept. |
| `date` | Optional `YYYYMMDD` for BOE and BORME. Empty means the latest published day. |
| `maxItems` | 1 to 50, default 10. You are charged per item returned. |

Example:

```json
{ "source": "boe", "query": "subvención vivienda", "maxItems": 10 }
```

### Output

One dataset item per record. Example:

```json
{
  "source": "BDNS",
  "id": 1146415,
  "title": "Resolución de 25 de noviembre de 2026 ... ayudas para la difusión, el fomento y la investigación de la arquitectura ...",
  "publication_date": "2026-11-25",
  "url": "https://www.infosubvenciones.es/bdnstrans/GE/es/convocatorias/944854",
  "issuer": "ESTADO / MINISTERIO DE VIVIENDA Y AGENDA URBANA / ...",
  "grant_call_number": "944854",
  "retrieved_at": "2026-11-25T16:32:52.090Z",
  "sha256_of_results": "cf8ba62c...",
  "attribution": "Origen de los datos: Intervención General de la Administración del Estado. Source: Base de Datos Nacional de Subvenciones (IGAE, Ministerio de Hacienda) ..."
}
```

A `RUN_INFO` record in the key-value store holds the run summary (source URL, matched count, hash).

### Pricing

Pay per event. A small fee per run start and a fee per record returned. Failed lookups and empty results are not charged for records. You can set a maximum cost per run; the Actor stops when it is reached.

### Good to know

- BORME returns the gazette sections (provinces) of the day, not the full text of each entry. Open the linked official page for the text.
- BDNS returns the latest calls. The `date` filter applies to BOE and BORME only; `query` filters titles for all three sources.
- Official data can be published late or corrected by the source. Always check the linked official page before acting.
- Not legal, tax or financial advice.

# Actor input Schema

## `source` (type: `string`):

boe = Official State Gazette (laws, decrees, tenders, notices). borme = Commercial Registry gazette (provinces of the day). bdns = National Grants Database (latest calls).

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

Optional. Keeps only items whose title contains all these words (case-insensitive). Example: subvención vivienda

## `date` (type: `string`):

Optional, for BOE and BORME. Example: 20261125. Empty means the latest published day.

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

Maximum records to return and pay for (1 to 50).

## Actor input object example

```json
{
  "source": "boe",
  "maxItems": 10
}
```

# Actor output Schema

## `records` (type: `string`):

Dataset with one item per record: source, id, title, publication date, URL, issuer, retrieval time and SHA-256 of the results.

## `runInfo` (type: `string`):

Run summary (RUN_INFO) stored in the key-value store.

# 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("pak_paxtor/spain-official-records-feed").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("pak_paxtor/spain-official-records-feed").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 pak_paxtor/spain-official-records-feed --silent --output-dataset

```

## MCP server setup

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

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/eCQ547FPCx36dtVbO/builds/B48D9QMXBpNJ0tq2i/openapi.json
