{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Public Tenders & BOE Auctions Scraper",
    "description": "Extracts official government procurement contracts, tenders, and judicial auctions from Spain (PLACSP & BOE) with budgets, deadlines, and direct bidding links.",
    "version": "2.0",
    "x-build-id": "XnFtJZBe1odwZT5XC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/super_vegetable~spain-tenders-auctions-boe-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-super_vegetable-spain-tenders-auctions-boe-scraper",
        "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/super_vegetable~spain-tenders-auctions-boe-scraper/runs": {
      "post": {
        "operationId": "runs-sync-super_vegetable-spain-tenders-auctions-boe-scraper",
        "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/super_vegetable~spain-tenders-auctions-boe-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-super_vegetable-spain-tenders-auctions-boe-scraper",
        "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": [
          "recordTypes"
        ],
        "properties": {
          "recordTypes": {
            "title": "Record Types to Scrape",
            "type": "array",
            "description": "Select the types of records to extract: TENDERS (open procurement bids), AWARDS (won contracts with winning company NIF and amounts), AUCTIONS (judicial and public property auctions).",
            "default": [
              "TENDERS",
              "AWARDS",
              "AUCTIONS"
            ],
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Publication Start Date (YYYY-MM-DD)",
            "type": "string",
            "description": "Start date for BOE issues. If omitted, automatically defaults to the latest published BOE date."
          },
          "dateTo": {
            "title": "Publication End Date (YYYY-MM-DD)",
            "type": "string",
            "description": "End date for scraping date ranges. If omitted, only dateFrom or latest BOE is scraped."
          },
          "provinces": {
            "title": "Provinces / Regions Filter",
            "type": "array",
            "description": "Filter records by Spanish province or autonomous community (e.g. Madrid, Barcelona, Valencia, Sevilla, Asturias, Cadiz). Case and accent insensitive.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchKeywords": {
            "title": "Search Keywords or CPV Codes",
            "type": "array",
            "description": "Keywords or CPV codes to filter (e.g. software, ciberseguridad, limpieza, obras, vivienda, 72000000). Leave empty to fetch all published records.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minAmountEur": {
            "title": "Minimum Amount (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Filter records with contract budget or auction valuation greater than or equal to this amount in EUR.",
            "default": 0
          },
          "maxAmountEur": {
            "title": "Maximum Amount (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Filter records with contract budget or auction valuation less than or equal to this amount in EUR (0 for unlimited).",
            "default": 0
          },
          "enrichWithCatastro": {
            "title": "Live Spanish Cadastre Enrichment (Catastro m², Year, €/m²)",
            "type": "boolean",
            "description": "Automatically cross-queries Spain's official Sede Electrónica del Catastro API for every 20-digit cadastral reference to extract built surface area (m²), construction year, primary use, and compute €/m² valuation and debt metrics.",
            "default": true
          },
          "onlyWithCadastralRef": {
            "title": "Only Auctions with Verified 20-Digit Cadastral Reference",
            "type": "boolean",
            "description": "When scraping AUCTIONS, only return properties that include a valid 20-character Cadastral Reference.",
            "default": false
          },
          "maxDebtToValuePct": {
            "title": "Max Claimed Debt-to-Valuation Ratio % (Auctions)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Filter distressed property auctions where claimed debt is at most X% of the auction valuation (e.g. set to 70 for high-equity opportunities). Leave 0 for all.",
            "default": 0
          },
          "minDiscountPct": {
            "title": "Min Estimated Discount vs Open Market % (Auctions)",
            "minimum": 0,
            "maximum": 95,
            "type": "integer",
            "description": "Filter real estate auctions offering at least X% discount compared to the official average market price per m² in the province (e.g. set to 30 for 30%+ below-market bargains).",
            "default": 0
          },
          "maskPersonalNif": {
            "title": "RGPD / LOPD Compliance (Mask Natural Person NIFs)",
            "type": "boolean",
            "description": "Automatically classifies Spanish Tax IDs into Corporate CIFs (Personas Jurídicas: S.L., S.A.) vs Natural Persons (Autónomos/Particulares) and masks personal DNIs/NIEs for GDPR compliance.",
            "default": true
          },
          "webhookUrl": {
            "title": "Alert Webhook URL (Optional — Make / n8n / Slack / Custom)",
            "type": "string",
            "description": "Optional HTTP POST Webhook URL to receive instant JSON alert notifications whenever matching auctions, tenders, or awards are found."
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of records to return. Scraper stops immediately when reached.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}