{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Public Tenders & Awards Scraper (PLACSP)",
    "description": "Every Spanish public tender, award and minor contract from the Ministerio de Hacienda's official monthly open-data bundles (PLACSP plus the regional platforms it aggregates), back to 2012. Daily alerts or historical backfills; filter by keyword, CPV, region (NUTS), budget, status and deadline.",
    "version": "1.1",
    "x-build-id": "sxgRTzKrtj0nas0kf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/exeterhope~spain-public-tenders-placsp/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-exeterhope-spain-public-tenders-placsp",
        "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/exeterhope~spain-public-tenders-placsp/runs": {
      "post": {
        "operationId": "runs-sync-exeterhope-spain-public-tenders-placsp",
        "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/exeterhope~spain-public-tenders-placsp/run-sync": {
      "post": {
        "operationId": "run-sync-exeterhope-spain-public-tenders-placsp",
        "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": {
          "source": {
            "title": "Data source",
            "enum": [
              "zip",
              "atom"
            ],
            "type": "string",
            "description": "zip = the monthly ZIP bundles the Ministerio de Hacienda lists on its open-data pages for reuse (the current month's bundle is refreshed daily around 05:00 CET). One download per month and feed, no page crawling.",
            "default": "zip"
          },
          "months": {
            "title": "Months (YYYY-MM)",
            "type": "array",
            "description": "Which monthly bundles to read, e.g. [\"2026-10\", \"2026-11\"]. Empty = the current month, plus earlier months back to 'Updated since' if you set it. Bundles back to 2012 are published.",
            "items": {
              "type": "string"
            }
          },
          "feeds": {
            "title": "Sources",
            "type": "array",
            "description": "Which official feeds to read. 'tenders' = PLACSP buyer profiles (all procedures except minor contracts); 'aggregated' = regional platforms published through PLACSP (Catalonia, Madrid, Basque Country, Andalusia, Galicia, Navarre, La Rioja…); 'minor' = minor contracts (contratos menores).",
            "items": {
              "type": "string",
              "enum": [
                "tenders",
                "aggregated",
                "minor"
              ],
              "enumTitles": [
                "Tenders (PLACSP)",
                "Regional platforms (aggregated)",
                "Minor contracts"
              ]
            },
            "default": [
              "tenders",
              "aggregated"
            ]
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep records whose title, lot names or buyer contain ANY of these words (accent- and case-insensitive). Spanish works best, e.g. 'limpieza', 'software', 'mantenimiento'.",
            "items": {
              "type": "string"
            }
          },
          "cpvPrefixes": {
            "title": "CPV code prefixes",
            "type": "array",
            "description": "Keep records with at least one CPV code starting with any of these, e.g. '72' (IT services), '909' (cleaning), '45' (construction works).",
            "items": {
              "type": "string"
            }
          },
          "statuses": {
            "title": "Status",
            "type": "array",
            "description": "Leave empty for all. PUB = open for bids.",
            "items": {
              "type": "string",
              "enum": [
                "PRE",
                "PUB",
                "EV",
                "ADJ",
                "RES",
                "ANUL"
              ],
              "enumTitles": [
                "Prior notice",
                "Open for bids",
                "Pending award",
                "Awarded",
                "Resolved / contract signed",
                "Cancelled"
              ]
            }
          },
          "contractTypes": {
            "title": "Contract type",
            "type": "array",
            "description": "Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "21",
                "22",
                "31",
                "32",
                "40",
                "7",
                "8",
                "50"
              ],
              "enumTitles": [
                "Supplies",
                "Services",
                "Works",
                "Public service management",
                "Service concession",
                "Public works concession",
                "Works concession",
                "Public-private partnership",
                "Special administrative",
                "Private",
                "Patrimonial"
              ]
            }
          },
          "nutsPrefixes": {
            "title": "Region (NUTS code prefixes)",
            "type": "array",
            "description": "Place of execution, e.g. 'ES30' (Madrid), 'ES51' (Catalonia), 'ES61' (Andalusia), 'ES52' (Valencian Community).",
            "items": {
              "type": "string"
            }
          },
          "minBudget": {
            "title": "Minimum budget (EUR, excl. VAT)",
            "minimum": 0,
            "type": "integer",
            "description": "Only tenders whose budget excluding VAT is at least this amount (EUR). Leave empty for no minimum."
          },
          "maxBudget": {
            "title": "Maximum budget (EUR, excl. VAT)",
            "minimum": 0,
            "type": "integer",
            "description": "Only tenders whose budget excluding VAT is at most this amount (EUR). Leave empty for no maximum."
          },
          "deadlineAfter": {
            "title": "Bid deadline on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Only records whose submission deadline is on/after this date. Use today's date to get tenders you can still bid on."
          },
          "buyerContains": {
            "title": "Buyer name contains",
            "type": "string",
            "description": "e.g. 'Ayuntamiento de Madrid', 'Ministerio de Defensa'."
          },
          "updatedSince": {
            "title": "Updated since (YYYY-MM-DD)",
            "type": "string",
            "description": "Only records published or updated on/after this date. With the bundle source and no Months set, the run reads every month from this date to today. Ideal for daily/weekly scheduled runs (set it to yesterday)."
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many matching records (you pay per result).",
            "default": 100
          },
          "maxPagesPerFeed": {
            "title": "Max feed pages to scan per source",
            "minimum": 1,
            "type": "integer",
            "description": "Each page holds up to 500 updates. With narrow filters, raise this or set 'Updated since'. Live Atom source only.",
            "default": 200
          },
          "includeBuyerContacts": {
            "title": "Include buyer office email/phone",
            "type": "boolean",
            "description": "Adds the contracting office's published contact email and phone.",
            "default": false
          },
          "requestDelaySecs": {
            "title": "Delay between page requests (seconds)",
            "minimum": 0.5,
            "type": "number",
            "description": "Politeness delay between page requests (live Atom source only). Keep ≥ 1.",
            "default": 1.5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}