# Spain Grants & Subsidies Scraper (BDNS) (`xamto1987/spain-grants-bdns`) Actor

Convocatorias y concesiones de subvenciones publicas espanolas desde la Base de Datos Nacional de Subvenciones (BDNS/SNPSAP). Spanish public grants, subsidies and grant beneficiaries.

- **URL**: https://apify.com/xamto1987/spain-grants-bdns.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 & Subsidies Scraper (BDNS) · Subvenciones y ayudas públicas de España

Extrae **convocatorias de subvenciones** y **concesiones ya otorgadas** de la
**Base de Datos Nacional de Subvenciones (BDNS / SNPSAP)**, el registro oficial
del Ministerio de Hacienda (IGAE) donde por ley se publica *toda* subvención
pública española: estatal, autonómica y local.

Scrapes **Spanish public grants, subsidies and grant beneficiaries** from
Spain's official **National Subsidies Database (BDNS)** — every state, regional
and municipal grant call and every awarded grant, with amounts and recipients.

***

### 🇪🇸 Español

#### Qué obtienes

**Modo `convocatorias`** — la pregunta de negocio: *«¿a qué ayudas puede optar
mi empresa este mes?»*. Un ítem por convocatoria, con la ficha oficial completa:

| Campo | Qué es |
|---|---|
| `codigoBDNS` | Identificador oficial de la convocatoria |
| `titulo` / `tituloLenguaCooficial` | Título en castellano y en lengua cooficial |
| `administracion`, `organoNivel1/2/3` | Quién convoca, por niveles (ESTATAL / AUTONÓMICA / LOCAL → CCAA u organismo → órgano concreto) |
| `presupuestoTotal` | Dotación en euros, **como número** (no como texto) |
| `tipoConvocatoria` | Concurrencia competitiva, concesión directa… |
| `instrumentos`, `tiposBeneficiarios` | Tipo de ayuda y a quién va dirigida |
| `sectores`, `sectoresCnae` | Sectores económicos con **código CNAE** |
| `regiones` | Ámbito territorial con código **NUTS** |
| `fechaInicioSolicitud`, `fechaFinSolicitud`, `abierta` | Plazo de solicitud y si sigue abierta |
| `descripcionBasesReguladoras`, `urlBasesReguladoras` | Bases reguladoras y su enlace oficial |
| `documentos[]` | PDFs oficiales de la convocatoria, con URL de descarga |
| `financiadoMrr`, `fondos`, `ayudaEstado` | Fondos europeos / Plan de Recuperación / ayuda de Estado |
| `urlFicha`, `urlApi` | Enlace a la ficha pública y al registro de origen |

**Modo `concesiones`** — la pregunta de negocio: *«¿quién ha cobrado subvenciones
y cuánto?»*. Un ítem por concesión:

| Campo | Qué es |
|---|---|
| `nif`, `razonSocial` | Beneficiario **ya separado** en NIF/CIF y denominación |
| `tipoBeneficiario` | `juridica` / `fisica` / `desconocido` |
| `importe`, `ayudaEquivalente` | Cuantía concedida en euros, como número |
| `fechaConcesion` | Fecha de la concesión |
| `codigoBDNSConvocatoria`, `tituloConvocatoria` | Convocatoria de la que procede |
| `administracion`, `organoNivel1/2/3` | Órgano concedente |
| `urlBasesReguladoras` | Bases reguladoras (BOE, boletín autonómico…) |

#### Para qué se usa

- **Alertas comerciales**: detectar cada mañana las ayudas nuevas de tu sector
  (CNAE) y tu comunidad autónoma antes que la competencia.
- **Consultoría de subvenciones**: alimentar un buscador propio de convocatorias
  abiertas con presupuesto, plazo y bases reguladoras.
- **Inteligencia competitiva**: ver qué empresas de tu sector han cobrado ayudas
  públicas, de qué organismo y por cuánto.
- **Enriquecimiento de CRM**: cruzar el `nif` de las concesiones con tu base de
  clientes o de leads.
- **Investigación y periodismo de datos**: seguimiento del gasto público en
  subvenciones por órgano, territorio y sector.

#### Parámetros de entrada

| Parámetro | Tipo | Por defecto | Descripción |
|---|---|---|---|
| `mode` | `convocatorias` | `concesiones` | `convocatorias` | Qué se extrae |
| `keywords` | lista de textos | `[]` | Una búsqueda por término, sobre el título. Vacío = sin filtro |
| `soloAbiertas` | booleano | `true` | Solo convocatorias con plazo abierto (solo modo `convocatorias`) |
| `fechaDesde` | fecha `AAAA-MM-DD` | — | Solo registros a partir de esa fecha. **Es la forma de hacer ejecuciones incrementales diarias** |
| `maxItems` | entero | `200` | Tope de ítems; el actor para limpiamente al alcanzarlo |
| `includePersonalData` | booleano | `false` | Ver más abajo |

Ejemplo:

```json
{
  "mode": "convocatorias",
  "keywords": ["innovación", "digitalización"],
  "soloAbiertas": true,
  "fechaDesde": "2026-08-01",
  "maxItems": 200
}
```

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

Las concesiones de la BDNS incluyen beneficiarios que son **personas físicas**
(la fuente publica su nombre y su DNI parcialmente enmascarado). Con
`includePersonalData: false` — **el valor por defecto** — el actor los **excluye
por completo**: el dataset contiene solo empresas, asociaciones, comunidades de
propietarios y administraciones.

La clasificación usa la letra inicial del NIF según las reglas de la AEAT
(dígito = DNI, `X/Y/Z` = NIE, `K/L/M` = otros supuestos de persona física,
`*` = NIF enmascarado por la propia fuente) y es *fail-closed*: si un
identificador no se puede clasificar con certeza, se descarta.

Si activas `includePersonalData`, el dataset incluirá datos personales y pasas a
ser tú quien responde de su tratamiento conforme al **RGPD** y la **LOPDGDD**.

#### Cuánto tarda

El actor respeta un máximo de **~1 petición por segundo** contra la API oficial.

- `concesiones`: 100 ítems por petición → ~1 s por cada 100 ítems.
- `convocatorias`: el listado no trae la ficha completa, así que hay **una
  petición de detalle por convocatoria** → ~1 s por ítem. Con
  `soloAbiertas: true` se descargan también las fichas de las cerradas para poder
  descartarlas (la API oficial no ofrece filtro de estado), así que cuenta con
  varias peticiones por ítem guardado.

#### Fuente y aviso legal

- **Fuente oficial**: Sistema Nacional de Publicidad de Subvenciones y Ayudas
  Públicas (BDNS), Intervención General de la Administración del Estado (IGAE),
  Ministerio de Hacienda — `https://www.pap.hacienda.gob.es/bdnstrans/api/`.
- Este actor **solo lee datos públicos**, sin login, sin cookies, sin token y
  sin saltarse ninguna medida técnica. No es un producto oficial ni está
  afiliado, respaldado ni verificado por la IGAE ni por el Ministerio de
  Hacienda.
- Marco: **Ley 38/2003** General de Subvenciones (art. 20, publicidad) y **Ley
  37/2007** de reutilización de la información del sector público. La
  reutilización está sujeta al [aviso legal del SNPSAP](https://www.infosubvenciones.es/bdnstrans/GE/es/avisolegal).
- La propia API advierte de que **los datos son dinámicos** y pueden corregirse
  o eliminarse después de la extracción: para decisiones con efectos jurídicos,
  consulta siempre la ficha oficial (`urlFicha`).
- La Administración se reserva restringir el acceso a la API «ante situaciones
  de manifiesto abuso». Por eso este actor limita su ritmo a ~1 req/s y se
  identifica con un User-Agent propio. **No modifiques ese comportamiento.**
- Comprueba que tu caso de uso cumple la normativa aplicable antes de
  redifundir los datos.

***

### 🇬🇧 English

#### What it does

`spain-grants-bdns` is a **Spain grants scraper** for the official **BDNS**
(*Base de Datos Nacional de Subvenciones*), the national register where every
Spanish public subsidy must legally be published.

Two modes:

- **`convocatorias` (grant calls)** — open and past **grant calls / funding
  opportunities**: awarding body, total budget in EUR, application window,
  eligible beneficiary types, **CNAE** economic sectors, **NUTS** regions,
  regulatory basis URL and official PDFs.
- **`concesiones` (awarded grants)** — **grant beneficiaries**: tax ID (NIF/CIF),
  legal name, amount awarded, award date, awarding body and source grant call.

#### Typical use cases

- **Grant intelligence / funding alerts**: daily monitoring of new Spanish
  public subsidies by keyword, sector and region.
- **Subsidy consultancies**: powering a searchable database of open calls.
- **Competitive intelligence**: which companies received public money, from
  whom, and how much.
- **B2B data enrichment**: matching `nif` (Spanish company tax ID) against your
  CRM.
- **Data journalism and public-spending research.**

#### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `mode` | enum | `convocatorias` | `convocatorias` or `concesiones` |
| `keywords` | string list | `[]` | One search per term (title match) |
| `soloAbiertas` | boolean | `true` | Open calls only (`convocatorias` mode) |
| `fechaDesde` | ISO date | — | Records from this date on; use it for **incremental daily runs** |
| `maxItems` | integer | `200` | Hard cap; the actor stops cleanly |
| `includePersonalData` | boolean | `false` | See below |

#### GDPR: individual beneficiaries excluded by default

Spanish grant awards include **natural persons**. With the default
`includePersonalData: false`, the actor **removes every individual
beneficiary**, keeping only companies, associations and public bodies.
Classification follows Spanish tax-ID rules and is fail-closed: anything that
cannot be confirmed as a legal entity is dropped. Enabling the flag means you
become responsible for the personal data under **GDPR**.

#### Politeness & compliance

The actor is rate-limited to **~1 request/second**, sends an identifying
User-Agent that contains no personal data, retries with exponential backoff, and
never bypasses any authentication or technical protection measure. It only reads
**openly published public-sector data**.

#### Disclaimer

Data comes from the official BDNS/SNPSAP API operated by IGAE (Spanish Ministry
of Finance). This actor is **not** an official product and is not affiliated
with or endorsed by IGAE or the Ministry. Data is dynamic and may be corrected
or removed after extraction — for legally binding decisions, always check the
official record linked in `urlFicha`. Reuse is subject to the
[SNPSAP legal notice](https://www.infosubvenciones.es/bdnstrans/GE/es/avisolegal)
and to Spanish Law 37/2007 on the re-use of public sector information. Make sure
your use case complies with applicable law before redistributing the data.

***

**Palabras clave / Keywords**: subvenciones, ayudas públicas, BDNS, convocatorias
de subvenciones, concesiones, beneficiarios de subvenciones, SNPSAP,
infosubvenciones, ayudas a empresas, subvenciones España, Spain grants,
Spanish subsidies, public grants Spain, grant beneficiaries, subsidy database,
government funding Spain, open data Spain, CNAE, NUTS, NIF.

# Actor input Schema

## `mode` (type: `string`):

Que se extrae. `convocatorias` = convocatorias de subvenciones y ayudas (quien ofrece dinero, cuanto y hasta cuando). `concesiones` = concesiones ya otorgadas (quien ha cobrado y cuanto). / What to scrape: grant calls or awarded grants.

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

Lista de terminos a buscar en el titulo de la convocatoria. Se lanza una busqueda por termino y se deduplican los resultados; cada termino se busca por TODAS sus palabras. Vacio = sin filtro de texto. / One search per term; empty = no text filter.

## `soloAbiertas` (type: `boolean`):

Solo aplica al modo `convocatorias`. Descarta las convocatorias cuyo plazo de solicitud ya esta cerrado (campo `abierto` de la ficha oficial). Nota: activarlo multiplica el tiempo de ejecucion (~10 fichas leidas por convocatoria abierta encontrada). / Only applies to `convocatorias` mode; slows the run ~10x.

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

Solo registros a partir de esta fecha (fecha de recepcion en convocatorias, fecha de concesion en concesiones). Formato ISO `AAAA-MM-DD`. Es la forma recomendada de hacer ejecuciones incrementales diarias. / ISO date; recommended for incremental daily runs.

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

Numero maximo de items a guardar en el dataset. El actor para limpiamente al alcanzarlo. Ten en cuenta que respeta ~1 peticion/segundo con la API oficial. / Hard cap on dataset items.

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

DESACTIVADO POR DEFECTO. Solo aplica al modo `concesiones`. Con esta opcion desactivada se excluyen los beneficiarios que son personas fisicas (DNI/NIE, o NIF enmascarado por la propia fuente) y el dataset contiene unicamente empresas, entidades y administraciones. Activarlo hace que el dataset incluya datos personales: su tratamiento posterior es responsabilidad tuya (RGPD / LOPDGDD). / OFF by default: individual (natural person) beneficiaries are excluded.

## Actor input object example

```json
{
  "mode": "convocatorias",
  "keywords": [
    "innovacion",
    "digitalizacion"
  ],
  "soloAbiertas": true,
  "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 = {
    "keywords": [
        "innovacion",
        "digitalizacion"
    ],
    "soloAbiertas": false,
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("xamto1987/spain-grants-bdns").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 = {
    "keywords": [
        "innovacion",
        "digitalizacion",
    ],
    "soloAbiertas": False,
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("xamto1987/spain-grants-bdns").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 '{
  "keywords": [
    "innovacion",
    "digitalizacion"
  ],
  "soloAbiertas": false,
  "maxItems": 50
}' |
apify call xamto1987/spain-grants-bdns --silent --output-dataset

```

## MCP server setup

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

```

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/gvvY7izEKpk3KztDo/builds/6yhBOJsvwaQ0x1yNb/openapi.json
