{
  "openapi": "3.0.1",
  "info": {
    "title": "Catalonia Public Tenders & Contract Awards (PSCP)",
    "description": "Get public tenders (licitacions, licitaciones), awards, winners and minor contracts from Catalonia's official procurement platform (PSCP): Generalitat, councils, hospitals, universities. Filter by CPV, keyword, province, value. Official open data.",
    "version": "0.1",
    "x-build-id": "0ZfIWTMbeJMsUMGQ6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hispanodata~catalonia-public-tenders-pscp/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hispanodata-catalonia-public-tenders-pscp",
        "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/hispanodata~catalonia-public-tenders-pscp/runs": {
      "post": {
        "operationId": "runs-sync-hispanodata-catalonia-public-tenders-pscp",
        "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/hispanodata~catalonia-public-tenders-pscp/run-sync": {
      "post": {
        "operationId": "run-sync-hispanodata-catalonia-public-tenders-pscp",
        "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": {
          "phases": {
            "title": "Publication phases",
            "type": "array",
            "description": "Which publications to return. 'open' = calls for tenders (anuncis de licitació). 'award' and 'formalization' include winners and amounts. 'minorContract' = aggregated minor contracts (contractes menors).",
            "items": {
              "type": "string",
              "enum": [
                "open",
                "award",
                "formalization",
                "minorContract",
                "priorNotice",
                "futureAlert",
                "marketConsultation",
                "evaluation",
                "cancellation"
              ],
              "enumTitles": [
                "Open calls for tenders (licitació)",
                "Awards (adjudicació)",
                "Formalised contracts (formalització)",
                "Minor contracts (contractes menors)",
                "Prior information notices (anunci previ)",
                "Future alerts (alerta futura)",
                "Preliminary market consultations",
                "Under evaluation",
                "Cancellations / void (anul·lació)"
              ]
            },
            "default": [
              "open"
            ]
          },
          "keywords": {
            "title": "Keywords (any)",
            "type": "array",
            "description": "Match any word in the title, object or lot description (case-insensitive; Catalan or Spanish as published, e.g. 'neteja', 'software', 'enllumenat').",
            "items": {
              "type": "string"
            }
          },
          "cpvPrefixes": {
            "title": "CPV code prefixes",
            "type": "array",
            "description": "Keep contracts whose CPV starts with any of these digits, e.g. '72' (IT services), '45' (construction), '79' (business services), '3312' (medical equipment).",
            "items": {
              "type": "string"
            }
          },
          "contractTypes": {
            "title": "Contract types",
            "type": "array",
            "description": "Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "works",
                "services",
                "supplies",
                "specialServices",
                "servicesConcession",
                "specialServicesConcession",
                "worksConcession",
                "administrativeSpecial",
                "private",
                "publicPrivate",
                "other"
              ],
              "enumTitles": [
                "Works (obres)",
                "Services (serveis)",
                "Supplies (subministraments)",
                "Special services (annex IV)",
                "Services concession",
                "Special services concession",
                "Works concession",
                "Special administrative",
                "Private",
                "Public-private collaboration",
                "Other sectoral law"
              ]
            }
          },
          "provinces": {
            "title": "Provinces",
            "type": "array",
            "description": "Place of execution (NUTS3). Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "barcelona",
                "girona",
                "lleida",
                "tarragona"
              ],
              "enumTitles": [
                "Barcelona",
                "Girona",
                "Lleida",
                "Tarragona"
              ]
            }
          },
          "contractingBodies": {
            "title": "Contracting bodies (contains)",
            "type": "array",
            "description": "Keep only bodies whose name contains any of these texts, e.g. 'Ajuntament de Barcelona', 'Institut Català de la Salut', 'Badalona'.",
            "items": {
              "type": "string"
            }
          },
          "minValue": {
            "title": "Min estimated value (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum estimated contract value, without VAT."
          },
          "maxValue": {
            "title": "Max estimated value (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum estimated contract value, without VAT."
          },
          "onlyOpenForSubmission": {
            "title": "Only tenders still open",
            "type": "boolean",
            "description": "For 'open' phase: keep only tenders whose submission deadline has not passed.",
            "default": false
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Publications from the last N days. Ignored if 'Date from' is set.",
            "default": 30
          },
          "dateFrom": {
            "title": "Date from (optional)",
            "type": "string",
            "description": "Publication date from, YYYY-MM-DD."
          },
          "dateTo": {
            "title": "Date to (optional)",
            "type": "string",
            "description": "Publication date to (inclusive), YYYY-MM-DD."
          },
          "onlyNew": {
            "title": "Only new publications (incremental)",
            "type": "boolean",
            "description": "Remember what earlier runs with the same filters returned and skip it. Ideal for a daily schedule: you only pay for new tenders.",
            "default": false
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of records to save (you only pay for saved records). Hard limit 5,000 per run.",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}