# Spain Grants Registries Scraper (BDNS) (`xamto1987/spain-grants-registries`) Actor

Registros especiales de la Base de Datos Nacional de Subvenciones: grandes beneficiarios, sanciones por fraude en subvenciones y ayudas a partidos politicos. Spanish big grant recipients, subsidy fraud sanctions and political party grants.

- **URL**: https://apify.com/xamto1987/spain-grants-registries.md
- **Developed by:** [Santi Belloso Lopez](https://apify.com/xamto1987) (community)
- **Categories:** Lead generation, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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?

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

## Spain Grants Registries Scraper (BDNS) · Registros especiales de subvenciones

Extrae tres **registros especiales** de la **Base de Datos Nacional de
Subvenciones (BDNS / SNPSAP)**, el registro oficial del Ministerio de
Hacienda (IGAE): **grandes beneficiarios**, **sanciones por fraude en
subvenciones** y **ayudas a partidos políticos**.

Scrapes three **special BDNS registers**: **top grant recipients**,
**subsidy-fraud sanctions**, and **political party grants** — public,
official, and otherwise scattered across individual PDF reports.

***

### 🇪🇸 Español

#### Qué obtienes

**`grandes_beneficiarios`** — el ranking oficial de mayores perceptores de
ayuda pública, **agregado por año** (un beneficiario puede tener una fila por
ejercicio). Ordenado de mayor a menor ayuda total por defecto:

| Campo | Qué es |
|---|---|
| `nif`, `razonSocial` | Beneficiario ya separado |
| `ejercicio` | Año del agregado |
| `ayudaETotal` | Ayuda total recibida ese año, en euros |

**`sanciones`** — empresas y personas sancionadas por fraude en subvenciones
(art. 58 de la Ley General de Subvenciones y similares), con la multa y el
periodo de inhabilitación para recibir nuevas ayudas:

| Campo | Qué es |
|---|---|
| `nif`, `razonSocial` | Sancionado |
| `infraccion` | Artículo/motivo de la sanción |
| `importe` | Importe de la subvención de origen |
| `importeMulta` | Cuantía de la multa |
| `inicioInhabilitacion`, `finInhabilitacion` | Periodo sin poder recibir ayudas públicas |

**`partidos_politicos`** — subvenciones a partidos, federaciones y grupos
municipales/autonómicos (misma forma que `concesiones` de
`spain-grants-bdns`, pero acotado a este colectivo):

| Campo | Qué es |
|---|---|
| `nif`, `razonSocial` | Partido o grupo |
| `importe`, `ayudaEquivalente` | Cuantía en euros |
| `fechaConcesion` | Fecha de la concesión |
| `administracion`, `organoNivel3` | Quién concede |

#### Para qué se usa

- **Screening de contraparte / due diligence**: comprobar si una empresa está
  en el registro de sanciones antes de firmar un contrato o una operación.
- **Inteligencia competitiva**: quiénes son los mayores perceptores de ayuda
  pública en España, año a año.
- **Transparencia y periodismo de datos**: financiación pública de partidos
  políticos por administración y ejercicio.

#### Parámetros de entrada

| Parámetro | Tipo | Por defecto | Descripción |
|---|---|---|---|
| `registro` | `grandes_beneficiarios` | `sanciones` | `partidos_politicos` | `grandes_beneficiarios` | Qué registro se extrae |
| `keywords` | lista de textos | `[]` | Ver soporte por registro más abajo |
| `fechaDesde` | fecha `AAAA-MM-DD` | — | Solo `sanciones` y `partidos_politicos` |
| `maxItems` | entero | `200` | Tope de ítems |
| `includePersonalData` | booleano | `false` | Ver protección de datos, más abajo |

#### Soporte de filtros: desigual entre registros (verificado en fase 5)

La API de BDNS **no** ofrece los mismos filtros en los tres registros:

| Registro | `keywords` (texto) | `fechaDesde` |
|---|---|---|
| `grandes_beneficiarios` | **En cliente** (el servidor lo ignora — verificado: `totalElements` no cambia) | No aplica (agregado anual, sin fecha de concesión) |
| `sanciones` | En servidor | En servidor |
| `partidos_politicos` | En servidor | En servidor |

Para `grandes_beneficiarios` el actor recorre las páginas (ordenadas por
`ayudaETotal` descendente) y filtra por nombre/NIF **en local**: puede tardar
algo más si buscas un término poco frecuente.

#### Un aviso honesto sobre `sanciones`

El registro nacional de sanciones por fraude en subvenciones es **muy
pequeño**: en la verificación de fase 5 (23-ago-2026) contenía **4 filas en
total** en toda España (2 empresas sancionadas, con 2 infracciones cada una).
Es un dato real, no un fallo del actor — la Ley General de Subvenciones
reserva esta sanción a un supuesto concreto (falsear las condiciones para
obtener la subvención) y son pocos los casos que llegan a esa vía. Si tu caso
de uso necesita volumen garantizado, usa `grandes_beneficiarios` o
`partidos_politicos`, que tienen decenas de miles de filas.

#### Protección de datos: personas físicas fuera por defecto

Igual que en el resto del lote: con `includePersonalData: false` (el valor
por defecto) se excluyen los beneficiarios/sancionados que son personas
físicas. La clasificación es *fail-closed*: en `grandes_beneficiarios` esto
también excluye, por precaución, a algunas entidades internacionales cuyo
código no sigue el formato NIF español (se pierden aunque no sean realmente
personas físicas, porque no se pueden confirmar como persona jurídica con
certeza).

#### Fuente y aviso legal

- **Fuente oficial**: BDNS / SNPSAP, IGAE, Ministerio de Hacienda —
  `https://www.pap.hacienda.gob.es/bdnstrans/api/`.
- Solo lectura de datos públicos, sin login ni token, ~1 petición/segundo,
  User-Agent identificado. No es un producto oficial ni está afiliado con
  IGAE ni con el Ministerio de Hacienda.
- Marco: Ley 38/2003 General de Subvenciones y Ley 37/2007 de reutilización
  de la información del sector público. Reutilización sujeta al
  [aviso legal del SNPSAP](https://www.infosubvenciones.es/bdnstrans/GE/es/avisolegal).
- Los datos son dinámicos y pueden corregirse tras la extracción.

***

### 🇬🇧 English

#### What it does

`spain-grants-registries` scrapes three **special BDNS registers**:

- **`grandes_beneficiarios`** — the official ranking of top public-aid
  recipients, aggregated **per year**, sorted by total aid descending.
- **`sanciones`** — companies/individuals sanctioned for **subsidy fraud**,
  with the fine amount and disqualification period.
- **`partidos_politicos`** — grants to political parties and municipal/
  regional party groups.

#### Filter support differs by register (verified in phase 5)

| Register | `keywords` | `fechaDesde` |
|---|---|---|
| `grandes_beneficiarios` | Client-side (server ignores it) | Not applicable (annual aggregate) |
| `sanciones` | Server-side | Server-side |
| `partidos_politicos` | Server-side | Server-side |

#### An honest note on `sanciones`

The national subsidy-fraud sanctions register is **very small**: at
verification time (2026-08-23) it held **4 rows nationwide** (2 sanctioned
companies). That's real data, not a bug — the underlying legal provision
covers one specific fraud scenario. Use `grandes_beneficiarios` or
`partidos_politicos` if you need guaranteed volume.

#### GDPR: individual beneficiaries excluded by default

`includePersonalData: false` (default) removes individual/natural-person
beneficiaries, fail-closed. In `grandes_beneficiarios` this also drops some
foreign entities whose ID doesn't follow the Spanish NIF format, since they
can't be confirmed as legal entities with certainty.

#### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `registro` | enum | `grandes_beneficiarios` | Which register |
| `keywords` | string list | `[]` | Server-side for sanciones/partidos\_politicos, client-side for grandes\_beneficiarios |
| `fechaDesde` | ISO date | — | sanciones/partidos\_politicos only |
| `maxItems` | integer | `200` | Hard cap |
| `includePersonalData` | boolean | `false` | See GDPR section |

#### Disclaimer

Data from the official BDNS/SNPSAP API (IGAE, Spanish Ministry of Finance).
Not an official product, not affiliated with or endorsed by IGAE.
Rate-limited to ~1 request/second with an identifying User-Agent. Reuse
subject to the
[SNPSAP legal notice](https://www.infosubvenciones.es/bdnstrans/GE/es/avisolegal)
and Spanish Law 37/2007.

***

**Palabras clave / Keywords**: grandes beneficiarios, sanciones subvenciones,
partidos políticos financiación, BDNS, due diligence, fraude en subvenciones,
inhabilitación ayudas públicas, top grant recipients Spain, subsidy fraud
sanctions, political party funding Spain, compliance, screening de
contraparte, transparencia, datos abiertos España.

# Actor input Schema

## `registro` (type: `string`):

Que registro especial de la BDNS se extrae. `grandes_beneficiarios` = perceptores de mas ayuda publica acumulada por ano (agregado anual, ordenado de mayor a menor). `sanciones` = empresas sancionadas por fraude en subvenciones (registro MUY pequeno a nivel nacional: unas pocas decenas de filas en total). `partidos_politicos` = subvenciones a partidos y grupos municipales. / Which BDNS special register to scrape.

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

Filtra por nombre/NIF del beneficiario. En `sanciones` y `partidos_politicos` se busca en servidor sobre el titulo de la convocatoria de origen (una consulta por termino). En `grandes_beneficiarios` el servidor IGNORA este filtro (verificado en fase 5) y se aplica EN CLIENTE sobre nombre/NIF del beneficiario, lo que implica recorrer mas paginas. Vacio = sin filtro. / Server-side for sanciones/partidos\_politicos; client-side for grandes\_beneficiarios.

## `fechaDesde` (type: `string`):

Solo aplica a `sanciones` y `partidos_politicos` (fecha de sancion / de concesion). `grandes_beneficiarios` es un agregado ANUAL sin fecha de concesion: este filtro se ignora para ese registro. / Only applies to sanciones and partidos\_politicos.

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

Numero maximo de items a guardar en el dataset. El actor para limpiamente al alcanzarlo. / Hard cap on dataset items.

## `includePersonalData` (type: `boolean`):

DESACTIVADO POR DEFECTO. Con esta opcion desactivada se excluyen los beneficiarios que son personas fisicas (DNI/NIE, o NIF enmascarado) y el dataset contiene unicamente empresas, entidades y administraciones. En `grandes_beneficiarios` esto tambien excluye por precaucion algunas entidades internacionales cuyo codigo no sigue el formato NIF espanol (no se pueden clasificar con certeza como persona juridica). Activarlo hace que el dataset pueda incluir datos personales: su tratamiento posterior es responsabilidad tuya (RGPD / LOPDGDD). / OFF by default: individual (natural person) beneficiaries are excluded.

## Actor input object example

```json
{
  "registro": "grandes_beneficiarios",
  "keywords": [],
  "maxItems": 50,
  "includePersonalData": false
}
```

# Actor output Schema

## `results` (type: `string`):

Items normalizados en el dataset por defecto (JSON, CSV, Excel).

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

// Run the Actor and wait for it to finish
const run = await client.actor("xamto1987/spain-grants-registries").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 }

# Run the Actor and wait for it to finish
run = client.actor("xamto1987/spain-grants-registries").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
}' |
apify call xamto1987/spain-grants-registries --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xamto1987/spain-grants-registries"
        }
    }
}

```

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/4S7bUpOYNzbExqXvF/builds/Zcy0nqFdgo24lFmHQ/openapi.json
