{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Public Tenders API (PLACSP) Radar",
    "description": "Spanish public tenders (licitaciones) from PLACSP open data: only new since your last run, still open for bids, filtered by CPV code, region and budget, plus award statistics (bids, discount, top winners).",
    "version": "0.2",
    "x-build-id": "kIdhvvOjfMoikNO6r"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/oatpage~spain-public-tenders-placsp/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-oatpage-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/oatpage~spain-public-tenders-placsp/runs": {
      "post": {
        "operationId": "runs-sync-oatpage-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/oatpage~spain-public-tenders-placsp/run-sync": {
      "post": {
        "operationId": "run-sync-oatpage-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": {
          "keywords": {
            "title": "Keywords (title or authority)",
            "type": "array",
            "description": "Keep tenders whose title or contracting authority contains at least one keyword (case and accent insensitive). Empty = no filter.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cpvPrefixes": {
            "title": "CPV code prefixes",
            "type": "array",
            "description": "Keep tenders with a CPV code starting with any of these, e.g. 72 (IT services), 45 (works), 33 (medical). Empty = no filter.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "provinces": {
            "title": "Provinces or regions",
            "type": "array",
            "description": "Province or region name contains, e.g. Madrid, Galicia, Valencia. Empty = all Spain.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "authorityContains": {
            "title": "Contracting authority contains",
            "type": "string",
            "description": "Text in the authority name or its hierarchy, e.g. 'Ministerio', 'Diputacion'."
          },
          "statuses": {
            "title": "Status",
            "type": "array",
            "description": "PUB = open for bids, EV = under evaluation, ADJ = awarded, RES = resolved, ANUL = cancelled. Empty = all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "contractTypes": {
            "title": "Contract type",
            "type": "array",
            "description": "Supplies, Services, Works, etc. Empty = all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Min budget (EUR, without VAT)",
            "minimum": 0,
            "type": "integer",
            "description": "Only tenders with at least this budget."
          },
          "maxAmount": {
            "title": "Max budget (EUR, without VAT)",
            "minimum": 0,
            "type": "integer",
            "description": "Only tenders with at most this budget."
          },
          "updatedSince": {
            "title": "Updated since",
            "type": "string",
            "description": "ISO date or datetime (e.g. 2026-10-05). Stops reading older feed pages. Use it for daily alerts."
          },
          "maxPages": {
            "title": "Feed pages to read",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Each page holds about 500 recent updates (roughly the last few hours). Raise it to go further back.",
            "default": 3
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum tenders to output (and be charged for).",
            "default": 100
          },
          "onlyNewSinceLastRun": {
            "title": "Radar: only new since my last run",
            "type": "boolean",
            "description": "Remembers the newest entry it has seen (per 'Watch name') and returns only tenders new or changed after it. If more matches exist than 'Max items', the position is not advanced so nothing is lost.",
            "default": false
          },
          "watchName": {
            "title": "Watch name",
            "type": "string",
            "description": "Name of this radar. Use a different name for each search you follow (e.g. 'cleaning-andalucia') so each keeps its own position.",
            "default": "default"
          },
          "onlyOpenForBids": {
            "title": "Only tenders still open for bids",
            "type": "boolean",
            "description": "Keeps tenders whose submission deadline is today or later. Tenders without a readable deadline are dropped.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "updated",
              "deadline",
              "score",
              "amount"
            ],
            "type": "string",
            "description": "Order of the results. 'Relevance' needs keywords or CPV prefixes.",
            "default": "updated"
          },
          "includeMarketStats": {
            "title": "Include market statistics record",
            "type": "boolean",
            "description": "Adds one record (type 'market') computed from the awarded tenders that match your search: average bids received, discount versus budget (average and median) and the companies that win most. Not billed.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}