{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Public Tenders Scraper (PLACSP)",
    "description": "Scrape Spanish public procurement tenders from PLACSP: buyer, CPV code, budget, deadline and region. Get new tenders daily as JSON for B2B lead generation.",
    "version": "0.1",
    "x-build-id": "nyIiijHMaTsxATODJ"
  },
  "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",
        "required": [
          "urlFeed"
        ],
        "properties": {
          "urlFeed": {
            "title": "URL del feed",
            "type": "string",
            "description": "Direccion publica del feed de licitaciones.",
            "default": "https://contrataciondelestado.es/sindicacion/sindicacion_643/licitacionesPerfilesContratanteCompleto3.atom"
          },
          "cpv": {
            "title": "Codigos CPV",
            "type": "array",
            "description": "Prefijos de CPV que deben coincidir con algun codigo de la licitacion.",
            "items": {
              "type": "string"
            }
          },
          "provincias": {
            "title": "Provincias",
            "type": "array",
            "description": "Nombres de provincia que deben coincidir con la ubicacion de la licitacion.",
            "items": {
              "type": "string"
            }
          },
          "comunidades": {
            "title": "Comunidades autonomas",
            "type": "array",
            "description": "Nombres de comunidad autonoma derivados del codigo NUTS de la licitacion.",
            "items": {
              "type": "string"
            }
          },
          "importeMin": {
            "title": "Importe minimo",
            "minimum": 0,
            "type": "number",
            "description": "Importe sin IVA minimo en euros. Se excluyen las licitaciones sin importe."
          },
          "importeMax": {
            "title": "Importe maximo",
            "minimum": 0,
            "type": "number",
            "description": "Importe sin IVA maximo en euros. Se excluyen las licitaciones sin importe."
          },
          "estados": {
            "title": "Estados",
            "uniqueItems": true,
            "type": "array",
            "description": "Estados de la licitacion que se admiten.",
            "items": {
              "type": "string",
              "enum": [
                "PUB",
                "EV",
                "ADJ",
                "RES",
                "ANUL"
              ]
            }
          },
          "plazoDesde": {
            "title": "Plazo desde",
            "type": "string",
            "description": "Fecha minima de presentacion en formato ISO (AAAA-MM-DD)."
          },
          "plazoHasta": {
            "title": "Plazo hasta",
            "type": "string",
            "description": "Fecha maxima de presentacion en formato ISO (AAAA-MM-DD)."
          },
          "maxResultados": {
            "title": "Maximo de resultados",
            "minimum": 1,
            "type": "integer",
            "description": "Numero maximo de licitaciones que se recuperaran.",
            "default": 20
          },
          "soloAbiertas": {
            "title": "Solo abiertas",
            "type": "boolean",
            "description": "Si se activa, se descartan las licitaciones ya cerradas.",
            "default": true
          },
          "soloNuevas": {
            "title": "Solo nuevas",
            "type": "boolean",
            "description": "Si se activa, solo se emiten las licitaciones nuevas o modificadas desde la ultima ejecucion.",
            "default": false
          },
          "diasRetencion": {
            "title": "Dias de retencion",
            "minimum": 1,
            "type": "integer",
            "description": "Numero de dias que se conservan los identificadores vistos antes de podarlos.",
            "default": 90
          },
          "maxPaginas": {
            "title": "Maximo de paginas",
            "minimum": 1,
            "type": "integer",
            "description": "Numero maximo de paginas del feed que se descargaran.",
            "default": 1
          },
          "pausaMs": {
            "title": "Pausa entre peticiones",
            "minimum": 0,
            "type": "integer",
            "description": "Milisegundos de espera entre peticiones a la fuente.",
            "default": 500
          },
          "resumenIA": {
            "title": "Resumen con IA",
            "type": "boolean",
            "description": "Anade un resumen y un encaje 0-100 a cada licitacion. Desactivado por defecto.",
            "default": false
          },
          "perfilEmpresa": {
            "title": "Perfil de empresa",
            "type": "string",
            "description": "Descripcion libre de la empresa para calcular el encaje de cada licitacion."
          },
          "gatewayUrl": {
            "title": "URL del gateway de IA",
            "type": "string",
            "description": "URL base del gateway de IA; por defecto GATEWAY_URL del entorno."
          },
          "gatewayApiKey": {
            "title": "Clave API",
            "type": "string",
            "description": "Clave de API del gateway de IA. Campo secreto: solo por input, nunca en el repo."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}