{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Grants & Subsidies Scraper (BDNS)",
    "description": "Convocatorias y concesiones de subvenciones publicas espanolas desde la Base de Datos Nacional de Subvenciones (BDNS/SNPSAP). Spanish public grants, subsidies and grant beneficiaries.",
    "version": "0.1",
    "x-build-id": "6yhBOJsvwaQ0x1yNb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/xamto1987~spain-grants-bdns/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-xamto1987-spain-grants-bdns",
        "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/xamto1987~spain-grants-bdns/runs": {
      "post": {
        "operationId": "runs-sync-xamto1987-spain-grants-bdns",
        "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/xamto1987~spain-grants-bdns/run-sync": {
      "post": {
        "operationId": "run-sync-xamto1987-spain-grants-bdns",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Modo / Mode",
            "enum": [
              "convocatorias",
              "concesiones"
            ],
            "type": "string",
            "description": "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.",
            "default": "convocatorias"
          },
          "keywords": {
            "title": "Palabras clave / Keywords",
            "type": "array",
            "description": "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.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "soloAbiertas": {
            "title": "Solo convocatorias abiertas / Open calls only",
            "type": "boolean",
            "description": "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.",
            "default": true
          },
          "fechaDesde": {
            "title": "Fecha desde / Date from",
            "type": "string",
            "description": "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": {
            "title": "Maximo de resultados / Max items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "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.",
            "default": 200
          },
          "includePersonalData": {
            "title": "Incluir beneficiarios persona fisica / Include individual beneficiaries",
            "type": "boolean",
            "description": "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.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}