{
  "openapi": "3.0.1",
  "info": {
    "title": "Catalonia Public Tenders Scraper (PSCP)",
    "description": "Licitaciones publicas de Cataluna desde el dataset Socrata de la Plataforma de serveis de contractacio publica (PSCP), con enriquecimiento opcional del expediente completo. Catalonia public procurement tenders and awards.",
    "version": "0.1",
    "x-build-id": "hvBXXm7TUpCSt1Zug"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/xamto1987~catalonia-tenders/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-xamto1987-catalonia-tenders",
        "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/xamto1987~catalonia-tenders/runs": {
      "post": {
        "operationId": "runs-sync-xamto1987-catalonia-tenders",
        "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/xamto1987~catalonia-tenders/run-sync": {
      "post": {
        "operationId": "run-sync-xamto1987-catalonia-tenders",
        "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": "Palabras clave / Keywords",
            "type": "array",
            "description": "Lista de terminos a buscar en el objeto del contrato (`objecte_contracte`) y en el titulo de la publicacion (`denominacio`). Se lanza UNA consulta al servidor con todos los terminos combinados por OR; cualquier termino coincide. Vacio = sin filtro de texto (se pagina el dataset completo, ordenado por fecha). / Server-side search across the contract object and the publication title; empty = no text filter.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tipoContrato": {
            "title": "Tipo de contrato / Contract type",
            "enum": [
              "",
              "Serveis",
              "Subministraments",
              "Obres",
              "Concessió de serveis",
              "Concessió d'obres",
              "Administratiu especial",
              "Altra legislació sectorial",
              "Contracte de serveis especials (annex IV)",
              "Privat d'Administració Pública",
              "Concessió de serveis especials (annex IV)",
              "Col·laboració Públic-Privat"
            ],
            "type": "string",
            "description": "Filtra por `tipus_contracte`, tal cual lo publica el dataset (valores reales verificados con `$group`, en catalan). Vacio = todos los tipos. / Filters by the dataset's real `tipus_contracte` value (Catalan). Empty = all types.",
            "default": ""
          },
          "estado": {
            "title": "Estado / Status",
            "enum": [
              "",
              "anuncio",
              "adjudicacion",
              "formalizacion"
            ],
            "type": "string",
            "description": "Fase de publicacion del expediente (`fase_publicacio` del dataset). `anuncio` = en plazo de presentacion de ofertas; `adjudicacion` = ya adjudicado; `formalizacion` = contrato formalizado. Vacio = todas las fases (incluye tambien ejecucion, anulaciones y publicaciones agregadas trimestrales). / Real dataset phase, exposed with Spanish aliases; empty = all phases.",
            "default": ""
          },
          "importeMinimo": {
            "title": "Importe minimo (EUR) / Minimum amount",
            "type": "integer",
            "description": "Filtra en servidor por el presupuesto de licitacion sin IVA (o, si no existe, el importe de adjudicacion sin IVA). / Server-side filter on tender budget (or, failing that, award amount), both VAT-excl."
          },
          "importeMaximo": {
            "title": "Importe maximo (EUR) / Maximum amount",
            "type": "integer",
            "description": "Igual que `importeMinimo` pero como cota superior. / Same field, upper bound."
          },
          "fechaDesde": {
            "title": "Fecha desde / Date from",
            "type": "string",
            "description": "Solo expedientes publicados a partir de esta fecha. Se aplica sobre la fecha de publicacion de la fase elegida en `estado` (anuncio/adjudicacion/formalizacion); sin `estado`, se aplica sobre la fecha de anuncio. Formato ISO `AAAA-MM-DD`. Recomendado para ejecuciones incrementales diarias (el dataset se actualiza a diario). / ISO date; applies to the publication date of the chosen `estado` phase (announcement date by default). Recommended for daily incremental runs."
          },
          "conDetalle": {
            "title": "Con detalle del expediente / With full tender detail",
            "type": "boolean",
            "description": "DESACTIVADO POR DEFECTO. Al activarlo, por cada licitacion guardada el actor hace UNA PETICION ADICIONAL al JSON completo del expediente en el portal (`contractaciopublica.cat/portal-api/...`), con datos del organo de contratacion, lotes y adjudicatarios por lote. ⚠️ Esto MULTIPLICA el numero de peticiones HTTP (aprox. x2) y, por tanto, el tiempo de ejecucion, ya que el actor respeta ~1 peticion/segundo. / OFF by default. Chains one extra request per saved item to the full tender record — roughly doubles HTTP requests and run time given the 1 req/s rate limit.",
            "default": false
          },
          "incluirContactosNominales": {
            "title": "Incluir datos nominales de personas fisicas / Include named individuals' data",
            "type": "boolean",
            "description": "DESACTIVADO POR DEFECTO. Protege DOS cosas distintas bajo el mismo flag, porque son la misma categoria de dato (identificacion nominal de una persona fisica concreta): (1) SIEMPRE, en el listado base: si el adjudicatario de un contrato es un AUTONOMO (persona fisica) en vez de una empresa, su NIF ya llega enmascarado por la propia fuente pero su NOMBRE COMPLETO no — con esta opcion desactivada, `adjudicatario.nif` y `.razonSocial` se anulan y solo queda `adjudicatario.tipoPersona`. (2) Solo si `conDetalle` esta activado: el JSON de detalle incluye, para cada organo de contratacion, una lista de personas de contacto CON NOMBRE, APELLIDOS, CARGO, TELEFONO Y EMAIL (personal publico) — con esta opcion desactivada, esos campos no aparecen en el dataset. Activarla incluye datos personales: su tratamiento y redifusion quedan bajo tu responsabilidad (RGPD / LOPDGDD). / OFF by default. Guards two things under one flag — same data category (a named natural person's identity): (1) always, in the base listing: sole-trader (persona fisica) awardees have their name published unmasked even though their tax ID is source-masked — disabling this nulls out `adjudicatario.nif`/`.razonSocial`; (2) only with `conDetalle`: strips named contact-person fields from the contracting body's detail.",
            "default": false
          },
          "maxItems": {
            "title": "Maximo de resultados / Max items",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Numero maximo de licitaciones a guardar en el dataset. El actor para limpiamente al alcanzarlo. / Hard cap on dataset items.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}