{
  "openapi": "3.0.1",
  "info": {
    "title": "Licitaciones España (PLACSP) - Spain Public Tenders API",
    "description": "Spanish public tenders (licitaciones) from the official PLACSP feed, filtered by CPV, province, budget and deadline, with a new-only alert mode. For Spain + EU + UK in one format use public-tenders-spain-eu-uk.",
    "version": "0.3",
    "x-build-id": "djgM6eaenPw9ai4yy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/flets_sv~licitaciones-placsp/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-flets_sv-licitaciones-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/flets_sv~licitaciones-placsp/runs": {
      "post": {
        "operationId": "runs-sync-flets_sv-licitaciones-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/flets_sv~licitaciones-placsp/run-sync": {
      "post": {
        "operationId": "run-sync-flets_sv-licitaciones-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": {
          "cpv": {
            "title": "CPV code prefixes",
            "type": "array",
            "description": "CPV code prefixes; a tender matches if any of its codes starts with any prefix. Example: [\"72\", \"48\"] for IT, [\"45\"] for construction. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "provincias": {
            "title": "Provinces",
            "type": "array",
            "description": "Province names where the tender is located, as written by PLACSP. Example: [\"Madrid\", \"Barcelona\"]. Empty = all provinces.",
            "items": {
              "type": "string"
            }
          },
          "comunidades": {
            "title": "Autonomous communities",
            "type": "array",
            "description": "Autonomous community names derived from the NUTS code. Example: [\"Comunidad de Madrid\", \"Andalucia\"]. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "importeMin": {
            "title": "Minimum budget (EUR)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum budget without VAT in euros. Tenders without a declared budget are excluded when this is set. Example: 50000."
          },
          "importeMax": {
            "title": "Maximum budget (EUR)",
            "minimum": 0,
            "type": "number",
            "description": "Maximum budget without VAT in euros. Tenders without a declared budget are excluded when this is set. Example: 5000000."
          },
          "estados": {
            "title": "Tender status",
            "uniqueItems": true,
            "type": "array",
            "description": "Tender status codes to keep: PUB = published, EV = under evaluation, ADJ = awarded, RES = resolved, ANUL = cancelled. Example: [\"PUB\"] for open tenders.",
            "items": {
              "type": "string",
              "enum": [
                "PUB",
                "EV",
                "ADJ",
                "RES",
                "ANUL"
              ]
            }
          },
          "plazoDesde": {
            "title": "Deadline from",
            "type": "string",
            "description": "Earliest submission deadline, YYYY-MM-DD. Example: \"2026-12-01\"."
          },
          "plazoHasta": {
            "title": "Deadline to",
            "type": "string",
            "description": "Latest submission deadline, YYYY-MM-DD. Example: \"2026-12-31\"."
          },
          "soloAbiertas": {
            "title": "Only open tenders",
            "type": "boolean",
            "description": "If true, keeps only tenders in status PUB (published) or EV (under evaluation) and drops awarded, resolved and cancelled ones. It does not compare the submission deadline with today's date: use plazoDesde for that. Default true.",
            "default": true
          },
          "maxResultados": {
            "title": "Maximum tenders",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of tenders returned. It is also the spend cap: one charge per tender. Example: 20.",
            "default": 20
          },
          "soloNuevas": {
            "title": "Only new or modified tenders",
            "type": "boolean",
            "description": "Alert mode: if true, emits only tenders new or modified since the previous run. Schedule daily. Default false.",
            "default": false
          },
          "diasRetencion": {
            "title": "Days to remember seen tenders",
            "minimum": 1,
            "type": "integer",
            "description": "Days the Actor remembers seen tender ids for soloNuevas. Example: 90.",
            "default": 90
          },
          "maxPaginas": {
            "title": "Feed pages to read",
            "minimum": 1,
            "type": "integer",
            "description": "How many feed pages (about 500 entries each, newest first) to download. Raise to reach older tenders when filters are narrow. Example: 5.",
            "default": 1
          },
          "pausaMs": {
            "title": "Pause between requests (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Milliseconds between page requests to PLACSP. Example: 500.",
            "default": 500
          },
          "resumenIA": {
            "title": "AI summary (experimental)",
            "type": "boolean",
            "description": "If true, adds an AI summary and a 0-100 fit score to each tender (extra charge per summary). Experimental and needs an AI gateway; keep false for normal use. Default false.",
            "default": false
          },
          "perfilEmpresa": {
            "title": "Company profile",
            "type": "string",
            "description": "Free-text description of your company, used to score the fit of each tender when resumenIA is true. Example: \"Software house with public sector experience\"."
          },
          "gatewayUrl": {
            "title": "AI gateway URL",
            "type": "string",
            "description": "Advanced and optional. Base URL of an AI gateway, only used when resumenIA is true. Leave empty otherwise."
          },
          "gatewayApiKey": {
            "title": "AI gateway API key",
            "type": "string",
            "description": "Advanced and optional. API key of your AI gateway, only used when resumenIA is true. Secret field; leave empty otherwise."
          },
          "urlFeed": {
            "title": "Feed URL (advanced)",
            "type": "string",
            "description": "URL of the PLACSP ATOM feed. Leave the default (national platform, all contracting profiles). Only change it to read another PLACSP syndication feed.",
            "default": "https://contrataciondelestado.es/sindicacion/sindicacion_643/licitacionesPerfilesContratanteCompleto3.atom"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}