{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Public Procurement Scraper — PLACSP Tenders & Awards",
    "description": "Scrape Spanish public tenders from contrataciondelsectorpublico.gob.es. Extract procurement data with CPV codes, budgets, award details, winner NIF, and bid counts. Filter by region, status, and contract type. No browser needed.",
    "version": "0.1",
    "x-build-id": "BPkLJulGJCSpfUNR0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rastriq~placsp-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rastriq-placsp-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/rastriq~placsp-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rastriq-placsp-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/rastriq~placsp-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rastriq-placsp-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",
        "properties": {
          "monthsBack": {
            "title": "📅 Months back",
            "minimum": 1,
            "type": "integer",
            "description": "<b>How many calendar months to download, counting back from the current month.</b> Each month is a ~100-300 MB ZIP file. Ignored when <code>fromMonth</code> is set.",
            "default": 1
          },
          "fromMonth": {
            "title": "📅 From month (YYYYMM)",
            "pattern": "^(\\d{4}(0[1-9]|1[0-2]))?$",
            "type": "string",
            "description": "<b>First month to download, e.g. 202509.</b> Overrides monthsBack. Leave toMonth empty to download up to the current month. For long periods, run one month or quarter per run and merge datasets (dedup by <code>expediente</code>)."
          },
          "toMonth": {
            "title": "📅 To month (YYYYMM)",
            "pattern": "^(\\d{4}(0[1-9]|1[0-2]))?$",
            "type": "string",
            "description": "<b>Last month to download, inclusive, e.g. 202509.</b> Requires fromMonth. Use the same value as fromMonth to download a single month."
          },
          "feedType": {
            "title": "⚙️ Feed type",
            "enum": [
              "perfiles",
              "menores"
            ],
            "type": "string",
            "description": "Type of procurement feed to download.",
            "default": "perfiles"
          },
          "cpvFilter": {
            "title": "🏷️ CPV filter",
            "type": "string",
            "description": "<b>Filter by CPV code prefix (e.g.</b> 45 for construction, 72 for IT). Leave empty for all."
          },
          "cpvMatchAll": {
            "title": "🏷️ Match secondary CPVs too",
            "type": "boolean",
            "description": "<b>Off (default):</b> the CPV filter only checks the main CPV (<code>cpv_principal</code>). <b>On:</b> a tender matches if <i>any</i> of its CPVs (main, additional or per lot, see <code>cpv_all</code>) starts with the filter. Returns more tenders, e.g. works contracts whose electrical equipment is listed as a secondary CPV.",
            "default": false
          },
          "ccaaFilter": {
            "title": "📍 CCAA / region filter",
            "type": "string",
            "description": "<b>Filter by region keyword in organo_contratante or NUTS code.</b> Leave empty for all."
          },
          "importeMin": {
            "title": "💰 Minimum budget",
            "type": "number",
            "description": "<b>Minimum importe_sin_iva in EUR.</b> Set 0 for no minimum."
          },
          "estadoFilter": {
            "title": "🏷️ Status filter",
            "enum": [
              "",
              "publicada",
              "adjudicada",
              "formalizada",
              "resuelta",
              "anulada"
            ],
            "type": "string",
            "description": "Filter by tender status.",
            "default": ""
          },
          "maxItems": {
            "title": "🔢 Max items",
            "minimum": 0,
            "type": "integer",
            "description": "<b>Maximum items to return.</b> Set 0 for unlimited.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy configuration",
            "type": "object",
            "description": "<b>Select proxies to be used.</b> PLACSP works without proxy from datacenter IPs."
          },
          "desde": {
            "title": "Legacy: desde",
            "pattern": "^(\\d{4}(0[1-9]|1[0-2]))?$",
            "type": "string",
            "description": "Deprecated alias of fromMonth, kept for backward compatibility."
          },
          "hasta": {
            "title": "Legacy: hasta",
            "pattern": "^(\\d{4}(0[1-9]|1[0-2]))?$",
            "type": "string",
            "description": "Deprecated alias of toMonth, kept for backward compatibility."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}