{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Tenders Scraper: PLACSP Licitaciones to Excel",
    "description": "Scrape Spanish public tenders (licitaciones) from PLACSP, the Plataforma de Contratación del Sector Público, via the official open-data ATOM/CODICE feeds, no key. Filter by keyword, CPV, region/NUTS, contract type, value, open deadline. Excel, CSV, JSON.",
    "version": "1.0",
    "x-build-id": "ecRCniCmWxoBb14GF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tenderfeed~spain-placsp-tenders/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tenderfeed-spain-placsp-tenders",
        "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/tenderfeed~spain-placsp-tenders/runs": {
      "post": {
        "operationId": "runs-sync-tenderfeed-spain-placsp-tenders",
        "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/tenderfeed~spain-placsp-tenders/run-sync": {
      "post": {
        "operationId": "run-sync-tenderfeed-spain-placsp-tenders",
        "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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words to look for in the title, summary and file number (accent-insensitive), e.g. [\"software\", \"limpieza\", \"mantenimiento\"]. Most notices are in Spanish (some in Catalan, Basque or Galician). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "keywordMode": {
            "title": "Keyword match",
            "enum": [
              "any",
              "all"
            ],
            "type": "string",
            "description": "Match ANY or ALL keywords.",
            "default": "any"
          },
          "cpvCodes": {
            "title": "CPV codes",
            "type": "array",
            "description": "CPV prefixes, e.g. [\"72\"] for IT services, [\"45\"] for construction works, [\"90910000\"] for cleaning. Matches any CPV of the contract or its lots.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Regions (NUTS code or name)",
            "type": "array",
            "description": "Place of performance. NUTS prefixes like [\"ES30\"] (Madrid), [\"ES51\"] (Catalonia), [\"ES61\"] (Andalusia), [\"ES21\"] (Basque Country), or names (accent-insensitive, also matched against the buyer hierarchy and city), e.g. [\"Valencia\", \"Sevilla\"].",
            "items": {
              "type": "string"
            }
          },
          "contractTypes": {
            "title": "Contract types",
            "type": "array",
            "description": "Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "goods",
                "services",
                "works",
                "concesion",
                "privado",
                "administrativo especial",
                "patrimonial"
              ],
              "enumTitles": [
                "Goods (Suministros)",
                "Services (Servicios, incl. service concessions)",
                "Works (Obras, incl. works concessions)",
                "Concessions only",
                "Private contracts",
                "Special administrative",
                "Patrimonial"
              ]
            }
          },
          "procedureTypes": {
            "title": "Procedure types",
            "type": "array",
            "description": "Contains match on the procedure label (Spanish + English), e.g. [\"abierto\"] (open + simplified open), [\"negociado\"], [\"acuerdo marco\"], [\"restricted\"]. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "buyerName": {
            "title": "Buyer name contains",
            "type": "string",
            "description": "Contracting authority name or hierarchy contains (accent-insensitive), e.g. \"Ayuntamiento de Madrid\", \"Universidad\", \"Ministerio de Defensa\"."
          },
          "minValue": {
            "title": "Min estimated value (EUR, excl. VAT)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep tenders with an estimated value at or above this amount."
          },
          "maxValue": {
            "title": "Max estimated value (EUR, excl. VAT)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep tenders with an estimated value at or below this amount."
          },
          "publishedFrom": {
            "title": "Published from",
            "type": "string",
            "description": "YYYY-MM-DD or relative (\"7 days\", \"7days\", \"2 weeks\"). Default: last 7 days. Feeds are read newest-first and stop once updates are older than this date.",
            "default": "7 days"
          },
          "publishedTo": {
            "title": "Published to",
            "type": "string",
            "description": "YYYY-MM-DD. Default: no upper bound."
          },
          "onlyOpen": {
            "title": "Only open for offers",
            "type": "boolean",
            "description": "Keep only folders in status PUB (en plazo) whose submission deadline is today or later. Ignored when you pick explicit statuses below.",
            "default": true
          },
          "statuses": {
            "title": "Statuses",
            "type": "array",
            "description": "Optional. Pick e.g. ADJ + RES to export recent awards with winners and awarded amounts. Overrides 'Only open'.",
            "items": {
              "type": "string",
              "enum": [
                "PRE",
                "PUB",
                "EV",
                "ADJ",
                "RES",
                "ANUL"
              ],
              "enumTitles": [
                "PRE - prior information",
                "PUB - open (en plazo)",
                "EV - under evaluation",
                "ADJ - awarded",
                "RES - resolved / formalised",
                "ANUL - cancelled"
              ]
            }
          },
          "feeds": {
            "title": "PLACSP feeds",
            "type": "array",
            "description": "Both official open-data feeds exclude minor contracts (contratos menores).",
            "items": {
              "type": "string",
              "enum": [
                "profiles",
                "aggregated"
              ],
              "enumTitles": [
                "Buyer profiles hosted on PLACSP (sindicación 643)",
                "Regional platforms aggregated into PLACSP (sindicación 1044: Catalonia, Madrid, Basque Country, Andalusia, Galicia, Navarre, La Rioja...)"
              ]
            },
            "default": [
              "profiles",
              "aggregated"
            ]
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no limit. Default 50.",
            "default": 50
          },
          "maxPagesPerFeed": {
            "title": "Max feed pages per feed",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety cap. Each ATOM page holds ~150-500 updates (5-15 MB); a busy weekday is roughly 5-10 pages on the main feed. Raise it for long date ranges with narrow filters.",
            "default": 40
          },
          "includeBuyerContacts": {
            "title": "Include buyer contacts",
            "type": "boolean",
            "description": "Adds the contracting authority's contact name, email and phone (buyerContactName / Email / Phone) and the names of natural-person awardees (self-employed winners identified by a personal NIF/NIE). Off by default (GDPR).",
            "default": false
          },
          "onlyNew": {
            "title": "Only new tenders (monitoring mode)",
            "type": "boolean",
            "description": "Remember what earlier runs delivered and return (and charge for) only tenders you have not received yet. Ideal for scheduled daily alerts.",
            "default": false
          },
          "monitoringId": {
            "title": "Monitoring ID",
            "type": "string",
            "description": "Name of the watch-list memory used by 'Only new'. Use a different ID per saved search/schedule."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}