{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain De Minimis & State Aid Scraper — BDNS by NIF",
    "description": "Scrape Spanish de minimis aid and notified state aid from the official National Subsidies Database (BDNS/SNPSAP): amounts, beneficiary NIF, EU regulation and SA case number. Built for due diligence. Ayudas de minimis y ayudas de Estado por NIF de beneficiario.",
    "version": "0.1",
    "x-build-id": "jdm4IQgrAYfE9skUi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/xamto1987~spain-de-minimis-aid/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-xamto1987-spain-de-minimis-aid",
        "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-de-minimis-aid/runs": {
      "post": {
        "operationId": "runs-sync-xamto1987-spain-de-minimis-aid",
        "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-de-minimis-aid/run-sync": {
      "post": {
        "operationId": "run-sync-xamto1987-spain-de-minimis-aid",
        "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": "Mode / Modo",
            "enum": [
              "minimis",
              "ayudas_estado"
            ],
            "type": "string",
            "description": "Which register to scrape. 'minimis' = de minimis aid (EU Reg. 2023/2831 and earlier), the most common instrument for SMEs. 'ayudas_estado' = state aid notified to the European Commission (includes the SA.xxxxx case number). / ES: ayudas de minimis o ayudas de Estado notificadas.",
            "default": "minimis"
          },
          "nifs": {
            "title": "Beneficiary tax IDs / NIF-CIF de beneficiarios",
            "type": "array",
            "description": "Spanish tax IDs to look for (e.g. \"B12345678\"). IMPORTANT: the official BDNS API does not allow server-side filtering by tax ID, so the filter is applied CLIENT-SIDE while walking recent pages (see \"maxPaginasEscaneadas\"). Combine it with \"keywords\" or \"fechaDesde\" to narrow the scan. Empty = no beneficiary filter. / ES: el filtro por NIF es en cliente; combínalo con keywords o fechaDesde.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords / Palabras clave",
            "type": "array",
            "description": "Terms to search for in the title of the originating grant call. One search per term, results deduplicated; each term is matched on ALL of its words. Empty = no text filter. / ES: una búsqueda por término; vacío = sin filtro de texto.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fechaDesde": {
            "title": "Date from / Fecha desde",
            "type": "string",
            "description": "Only awards granted on or after this date. ISO format 'YYYY-MM-DD'. Recommended for daily incremental runs and to bound tax-ID scans. / ES: fecha ISO; recomendada para ejecuciones incrementales y para acotar búsquedas por NIF."
          },
          "maxItems": {
            "title": "Max items / Máximo de resultados",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on the number of items saved to the dataset. The Actor stops cleanly when it is reached. / ES: tope de items del dataset.",
            "default": 200
          },
          "maxPaginasEscaneadas": {
            "title": "Pages to scan (tax-ID search only) / Páginas a escanear",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Only relevant when you use \"nifs\" without \"keywords\": caps how many pages (100 rows each) the Actor walks looking for matches before giving up, so it never scans the full pool (millions of rows). Raise it if your beneficiary has little recent activity. / ES: acota el escaneo en cliente cuando buscas solo por NIF.",
            "default": 50
          },
          "includePersonalData": {
            "title": "Include individual beneficiaries / Incluir beneficiarios persona física",
            "type": "boolean",
            "description": "OFF BY DEFAULT. While off, beneficiaries that are natural persons (DNI/NIE, or a tax ID masked by the source itself) are excluded and the dataset contains only companies, entities and public bodies. In a 100-row sample verified in phase 5, 32-42% of de minimis / state aid beneficiaries were masked natural persons. Turning it on makes the dataset include personal data: any further processing is your responsibility (GDPR / LOPDGDD). / ES: desactivado por defecto; activarlo incluye datos personales bajo tu responsabilidad (RGPD).",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}