{
  "openapi": "3.0.1",
  "info": {
    "title": "Public Contract Awards & Winners: Portugal & Spain",
    "description": "🏆 See who wins public contracts in Portugal and Spain, at what price and against whom. Winner, price, discount on the base price, number of bids and competitors for every award, plus rankings of top winners and biggest buyers. Official open data for bid strategy and sales targeting.",
    "version": "0.1",
    "x-build-id": "GctsJ7zwyAYRATOiV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yodeling_november~public-contract-awards-pt-es/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yodeling_november-public-contract-awards-pt-es",
        "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/yodeling_november~public-contract-awards-pt-es/runs": {
      "post": {
        "operationId": "runs-sync-yodeling_november-public-contract-awards-pt-es",
        "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/yodeling_november~public-contract-awards-pt-es/run-sync": {
      "post": {
        "operationId": "run-sync-yodeling_november-public-contract-awards-pt-es",
        "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": {
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Portugal: every contract in Portal BASE since 2012 (files refreshed weekly). Spain: award results from PLACSP and the regional platforms it aggregates; one run reads the last 1.5 to 3 days, so schedule daily runs in New mode for complete Spanish data.",
            "items": {
              "type": "string",
              "enum": [
                "PT",
                "ES"
              ],
              "enumTitles": [
                "Portugal (Portal BASE)",
                "Spain (PLACSP)"
              ]
            },
            "default": [
              "PT",
              "ES"
            ]
          },
          "publishedWithinDays": {
            "title": "Published within (days)",
            "minimum": 1,
            "maximum": 1500,
            "type": "integer",
            "description": "How far back to look. For Portugal you can go back years (or use the dates below).",
            "default": 30
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Optional (YYYY-MM-DD). Replaces 'Published within'."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Optional (YYYY-MM-DD)."
          },
          "cpvPrefixes": {
            "title": "CPV codes (prefixes)",
            "type": "array",
            "description": "Optional, e.g. 45 (construction), 72 (IT services), 33 (medical equipment).",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords in the title",
            "type": "array",
            "description": "Optional. Case and accents are ignored.",
            "items": {
              "type": "string"
            }
          },
          "buyers": {
            "title": "Buyers",
            "type": "array",
            "description": "Optional. Buyer name or tax id (part of it), e.g. 'Câmara Municipal do Porto', '501306099'.",
            "items": {
              "type": "string"
            }
          },
          "winners": {
            "title": "Winners",
            "type": "array",
            "description": "Optional. Winner company name or tax id (part of it), e.g. 'Claranet', 'B61172219'.",
            "items": {
              "type": "string"
            }
          },
          "procedureTypes": {
            "title": "Procedure types",
            "type": "array",
            "description": "Optional, partial match, e.g. 'Concurso público', 'Ajuste Direto', 'open'.",
            "items": {
              "type": "string"
            }
          },
          "contractTypes": {
            "title": "Contract types",
            "type": "array",
            "description": "Optional.",
            "items": {
              "type": "string",
              "enum": [
                "works",
                "supplies",
                "services",
                "other"
              ],
              "enumTitles": [
                "Works",
                "Supplies",
                "Services",
                "Other"
              ]
            }
          },
          "minValue": {
            "title": "Minimum awarded value (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional."
          },
          "maxValue": {
            "title": "Maximum awarded value (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional."
          },
          "includeAwards": {
            "title": "Include awards",
            "type": "boolean",
            "description": "One row per contract (Portugal) or awarded lot (Spain).",
            "default": true
          },
          "summaries": {
            "title": "Summaries",
            "type": "array",
            "description": "Optional. By winner: awards, total value, average discount, main buyers. By buyer: spend, average bids, share of single-bid awards, main suppliers.",
            "items": {
              "type": "string",
              "enum": [
                "winner",
                "buyer"
              ],
              "enumTitles": [
                "By winner",
                "By buyer"
              ]
            }
          },
          "maxResults": {
            "title": "Max award rows",
            "minimum": 0,
            "type": "integer",
            "description": "Newest first. 0 means no cap.",
            "default": 1000
          },
          "maxSummaryRows": {
            "title": "Max summary rows (each)",
            "minimum": 0,
            "type": "integer",
            "description": "Largest first. 0 means no cap.",
            "default": 100
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "snapshot",
              "new"
            ],
            "type": "string",
            "description": "New returns only awards not delivered before for the same Monitor ID (summaries always cover the whole window).",
            "default": "snapshot"
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Name for the saved state in New mode.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}