{
  "openapi": "3.0.1",
  "info": {
    "title": "Subvenciones BDNS (España) — convocatorias oficiales",
    "description": "Convierte la Base de Datos Nacional de Subvenciones (BDNS) en un dataset filtrable: convocatorias con presupuesto, plazos, sectores CNAE, bases reguladoras y ayudas concedidas (cruces tolerantes a fallos). Datos oficiales, actualizados a diario.",
    "version": "1.0",
    "x-build-id": "Wy5Ow8L83ifiGU682"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/daniizarsan~bdns-subsidios/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-daniizarsan-bdns-subsidios",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/daniizarsan~bdns-subsidios/runs": {
      "post": {
        "operationId": "runs-sync-daniizarsan-bdns-subsidios",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/daniizarsan~bdns-subsidios/run-sync": {
      "post": {
        "operationId": "run-sync-daniizarsan-bdns-subsidios",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "textoBusqueda": {
            "title": "Texto en el título",
            "type": "string",
            "description": "Palabra clave en el título de la convocatoria, p. ej. \"digitalización\". Vacío = todas."
          },
          "modoTexto": {
            "title": "Tipo de búsqueda del texto",
            "enum": [
              "0",
              "1",
              "2"
            ],
            "type": "string",
            "description": "Cómo interpretar el texto buscado.",
            "default": "1"
          },
          "numeroConvocatoria": {
            "title": "Código BDNS concreto",
            "type": "string",
            "description": "Si lo pones (p. ej. 939617), extrae solo esa convocatoria."
          },
          "fechaDesde": {
            "title": "Recibidas desde (AAAA-MM-DD)",
            "type": "string",
            "description": "Fecha de recepción en la BDNS. Formato AAAA-MM-DD. Vacío = sin filtro."
          },
          "fechaHasta": {
            "title": "Recibidas hasta (AAAA-MM-DD)",
            "type": "string",
            "description": "Formato AAAA-MM-DD. Vacío = sin filtro."
          },
          "tipoAdministracion": {
            "title": "Tipo de administración",
            "enum": [
              "C",
              "A",
              "L",
              "O"
            ],
            "type": "string",
            "description": "Vacío = todas."
          },
          "regiones": {
            "title": "Regiones (IDs BDNS, separados por comas)",
            "type": "string",
            "description": "IDs del catálogo de regiones de la BDNS (endpoint /regiones). Vacío = todas."
          },
          "organos": {
            "title": "Órganos convocantes (IDs BDNS, separados por comas)",
            "type": "string",
            "description": "IDs del catálogo de órganos (endpoint /organos). Vacío = todos."
          },
          "instrumentos": {
            "title": "Instrumentos de ayuda (IDs BDNS, separados por comas)",
            "type": "string",
            "description": "IDs del catálogo de instrumentos (endpoint /instrumentos). Vacío = todos."
          },
          "tiposBeneficiario": {
            "title": "Tipos de beneficiario (IDs BDNS, separados por comas)",
            "type": "string",
            "description": "IDs del catálogo de tipos de beneficiario (endpoint /beneficiarios). Vacío = todos."
          },
          "finalidad": {
            "title": "Finalidad (política de gasto, ID BDNS)",
            "type": "integer",
            "description": "ID del catálogo de finalidades (endpoint /finalidades). Vacío = todas."
          },
          "mrr": {
            "title": "Solo fondos MRR (Next Generation EU)",
            "type": "boolean",
            "description": "Marca para limitar a convocatorias del Mecanismo de Recuperación y Resiliencia.",
            "default": false
          },
          "pageSize": {
            "title": "Resultados por página (máx. 10.000)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "La API admite hasta 10.000 registros por petición.",
            "default": 500
          },
          "maxItems": {
            "title": "Máximo de convocatorias a guardar",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cada convocatoria con cruces cuesta 1-3 peticiones extra (límite fuente: 10/seg).",
            "default": 500
          },
          "cruceDetalle": {
            "title": "Cruce 1: ficha completa de cada convocatoria",
            "type": "boolean",
            "description": "Añade tipo, presupuesto, plazos de solicitud, bases reguladoras y URL. Si falla, el item sale sin esos campos y no aborta.",
            "default": true
          },
          "cruceConcesiones": {
            "title": "Cruce 2: ayudas concedidas de cada convocatoria",
            "type": "boolean",
            "description": "Añade nº de concesiones, importe sumado muestreado y fecha de la última. Si falla, el item sale sin esos campos y no aborta.",
            "default": true
          },
          "maxConcesionesMuestra": {
            "title": "Máximo de concesiones a muestrear por convocatoria",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "El nº total de concesiones (concesionesTotal) siempre es exacto; el importe sumado se calcula sobre esta muestra. 0 = solo el total, sin muestreo (1 petición por convocatoria).",
            "default": 200
          },
          "incluirBeneficiarios": {
            "title": "Incluir beneficiarios por nombre (RGPD)",
            "type": "boolean",
            "description": "ATENCIÓN: el campo beneficiario de la fuente puede contener NIF y nombre de personas físicas. Activado, se copia tal cual; su reutilización es responsabilidad del usuario (RGPD y RD 130/2019).",
            "default": false
          },
          "cruceBOE": {
            "title": "Cruce 3: metadatos del BOE (bases reguladoras)",
            "type": "boolean",
            "description": "Si las bases reguladoras son un documento del BOE, cruza con sus datos abiertos: título oficial, rango normativo, departamento y materias. Fuente externa gratuita; si falla, no aborta.",
            "default": true
          },
          "continuarDespues": {
            "title": "Reanudar ejecuciones interrumpidas",
            "type": "boolean",
            "description": "Guarda un checkpoint por página: si la ejecución se cae, la siguiente reanuda desde la última página completa (con los mismos filtros).",
            "default": true
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}