{
 "openapi": "3.1.0",
 "info": {
  "title": "Public contracts (Portal BASE): data.promptugal.news",
  "version": "v0.1.47",
  "description": "Public contracts of the câmaras municipais of Lisboa and the Algarve's 16 municipalities, as contracting entity: object, contractors that are companies, price, dates and procedure, for the last 90 days.\n\nPublisher: IMPIC, Instituto dos Mercados Públicos, do Imobiliário e da Construção (Portal BASE), through dados.gov.pt. Reuse terms: IMPIC publishes these contracts as open data on dados.gov.pt with the licence \"Outra (Domínio Público)\" (other-pd, public domain); we name IMPIC and the Portal BASE as the source and link each contract's page. Not a warning service: follow IPMA and ANEPC.\n\nCode: Apache-2.0. Text: CC BY 4.0. The data keeps the terms of its own source (see each source card); nothing here relaxes them.",
  "license": {
   "name": "Apache-2.0 for code; each source keeps its own data terms",
   "identifier": "Apache-2.0"
  },
  "contact": {
   "name": "PrompTugal.news data",
   "url": "https://github.com/PrompTugal/PrompTugal__News__Data"
  }
 },
 "servers": [
  {
   "url": "https://data.promptugal.news",
   "description": "Production"
  }
 ],
 "externalDocs": {
  "description": "How to use the API",
  "url": "https://data.promptugal.news/api/"
 },
 "paths": {
  "/api/v1/base-gov-pt/latest.json": {
   "get": {
    "operationId": "get_base_gov_pt_latest",
    "tags": [
     "base-gov-pt"
    ],
    "summary": "Public contracts (Portal BASE): the latest read",
    "description": "Public contracts published on the Portal BASE in the last 90 days (from 2026-08-20) where the contracting entity is the câmara municipal of Lisboa or of one of the Algarve's 16 municipalities (Quarteira is a parish of Loulé and has no câmara of its own). From IMPIC's open data, which is updated about weekly: a contract appears here some days after it is signed. object is cut to 200 characters. A contractor that is a company keeps its name and NIF; a contractor that looks like a natural person (its NIF, or none) is shown only as \"a natural person\", and the contract's object text is then left out. Our record, not an official one: each contract links its page on base.gov.pt.",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "shape": {
           "type": "string"
          },
          "source": {
           "type": "string"
          },
          "title": {
           "type": "string"
          },
          "read_at": {
           "type": "string"
          },
          "provenance": {
           "type": "object",
           "properties": {
            "source": {
             "type": "string"
            },
            "page": {
             "type": "string"
            },
            "read_at": {
             "type": "string"
            },
            "by": {
             "type": "string"
            },
            "terms": {
             "type": "string"
            },
            "dataset": {
             "type": "string"
            },
            "terms_page": {
             "type": "string"
            },
            "how": {
             "type": "string"
            }
           },
           "required": [
            "source",
            "page",
            "read_at",
            "by",
            "terms",
            "dataset",
            "terms_page",
            "how"
           ]
          },
          "about": {
           "type": "string"
          },
          "counts": {
           "type": "object",
           "properties": {
            "contracts": {
             "type": "integer"
            },
            "places": {
             "type": "integer"
            },
            "by_place": {
             "type": "object",
             "properties": {
              "lisboa": {
               "type": "integer"
              },
              "albufeira": {
               "type": "integer"
              },
              "alcoutim": {
               "type": "integer"
              },
              "aljezur": {
               "type": "integer"
              },
              "castro-marim": {
               "type": "integer"
              },
              "faro": {
               "type": "integer"
              },
              "lagoa": {
               "type": "integer"
              },
              "lagos": {
               "type": "integer"
              },
              "loule": {
               "type": "integer"
              },
              "monchique": {
               "type": "integer"
              },
              "olhao": {
               "type": "integer"
              },
              "portimao": {
               "type": "integer"
              },
              "sao-bras-de-alportel": {
               "type": "integer"
              },
              "silves": {
               "type": "integer"
              },
              "tavira": {
               "type": "integer"
              },
              "vila-do-bispo": {
               "type": "integer"
              },
              "vila-real-de-santo-antonio": {
               "type": "integer"
              }
             },
             "required": [
              "lisboa",
              "albufeira",
              "alcoutim",
              "aljezur",
              "castro-marim",
              "faro",
              "lagoa",
              "lagos",
              "loule",
              "monchique",
              "olhao",
              "portimao",
              "sao-bras-de-alportel",
              "silves",
              "tavira",
              "vila-do-bispo",
              "vila-real-de-santo-antonio"
             ]
            },
            "records_scanned": {
             "type": "null"
            },
            "window_days": {
             "type": "integer"
            },
            "objects_withheld": {
             "type": "integer"
            }
           },
           "required": [
            "contracts",
            "places",
            "by_place",
            "records_scanned",
            "window_days",
            "objects_withheld"
           ]
          },
          "note": {
           "type": "string"
          },
          "dataset": {
           "type": "object",
           "properties": {
            "name": {
             "type": "string"
            },
            "dataset": {
             "type": "string"
            },
            "licence": {
             "type": "string"
            },
            "files": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "year": {
                "type": "integer"
               },
               "file": {
                "type": "string"
               },
               "resource": {
                "type": "string"
               },
               "resource_modified": {
                "type": "string"
               },
               "bytes": {
                "type": "integer"
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "year",
               "file",
               "resource",
               "resource_modified",
               "bytes",
               "read_at"
              ]
             }
            }
           },
           "required": [
            "name",
            "dataset",
            "licence",
            "files"
           ]
          },
          "places": {
           "type": "object",
           "properties": {
            "faro": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 },
                 "council": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "portimao": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 },
                 "council": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "loule": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "object_withheld": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 },
                 "council": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "silves": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "olhao": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 },
                 "council": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "lagos": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 },
                 "council": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "lisboa": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": [
                 "number",
                 "null"
                ]
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "vila-real-de-santo-antonio": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "object_withheld": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 },
                 "council": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "albufeira": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "monchique": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "lagoa": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "castro-marim": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "aljezur": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "alcoutim": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "object_withheld": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "sao-bras-de-alportel": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "integer"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "tavira": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 },
                 "council": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            },
            "vila-do-bispo": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": "string"
               },
               "object_withheld": {
                "type": "null"
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind",
                  "nif",
                  "name",
                  "country"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            }
           },
           "required": [
            "faro",
            "portimao",
            "loule",
            "silves",
            "olhao",
            "lagos",
            "lisboa",
            "vila-real-de-santo-antonio",
            "albufeira",
            "monchique",
            "lagoa",
            "castro-marim",
            "aljezur",
            "alcoutim",
            "sao-bras-de-alportel",
            "tavira",
            "vila-do-bispo"
           ]
          }
         },
         "required": [
          "shape",
          "source",
          "title",
          "read_at",
          "provenance",
          "about",
          "counts",
          "note",
          "dataset",
          "places"
         ],
         "x-inferred": true
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/api/v1/base-gov-pt/reads.json": {
   "get": {
    "operationId": "get_base_gov_pt_reads",
    "tags": [
     "base-gov-pt"
    ],
    "summary": "Public contracts (Portal BASE): every read, newest first",
    "description": "Every run of sources/base-gov-pt/collect.mjs, newest first: each request's address, HTTP status, size, the first 16 hex of its sha256, and whether the bytes changed since the run before. The bytes and the full sha256 go to the source's vault (see card.json: latest/reads-full.json), never to git.",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "about": {
           "type": "string"
          },
          "source": {
           "type": "string"
          },
          "runs": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "at": {
              "type": "string"
             },
             "finished": {
              "type": "string"
             },
             "ok": {
              "type": "integer"
             },
             "failed": {
              "type": "integer"
             },
             "reads": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "name": {
                 "type": "string"
                },
                "url": {
                 "type": "string",
                 "format": "uri"
                },
                "at": {
                 "type": "string"
                },
                "status": {
                 "type": "integer"
                },
                "bytes": {
                 "type": "integer"
                },
                "sha256_prefix": {
                 "type": "string"
                },
                "changed": {
                 "type": [
                  "boolean",
                  "string"
                 ]
                }
               },
               "required": [
                "name",
                "url",
                "at",
                "status",
                "bytes",
                "sha256_prefix",
                "changed"
               ]
              }
             }
            },
            "required": [
             "at",
             "finished",
             "ok",
             "failed",
             "reads"
            ]
           }
          }
         },
         "required": [
          "about",
          "source",
          "runs"
         ],
         "x-inferred": true
        },
        "examples": {
         "example": {
          "summary": "A real file, cut to a readable size",
          "value": {
           "about": "Every run of sources/base-gov-pt/collect.mjs, newest first: each request's address, HTTP status, size, the first 16 hex of its sha256, and whether the bytes changed since the run before. The bytes and the full sha256 go to the source's vault (see card.json: latest/reads-full.json), never to git.",
           "source": "base-gov-pt",
           "runs": [
            {
             "at": "2026-11-18T19:14:25Z",
             "finished": "2026-11-18T19:14:28Z",
             "ok": 1,
             "failed": 0,
             "reads": [
              {
               "name": "dataset",
               "url": "https://dados.gov.pt/api/1/datasets/66d72d488ca4b7cb2de28712/",
               "at": "2026-11-18T19:14:27Z",
               "status": 200,
               "bytes": 45881,
               "sha256_prefix": "34e458c74591081c",
               "changed": false
              }
             ]
            },
            {
             "at": "2026-11-18T19:09:59Z",
             "finished": "2026-11-18T19:10:02Z",
             "ok": 1,
             "failed": 0,
             "reads": [
              {
               "name": "dataset",
               "url": "https://dados.gov.pt/api/1/datasets/66d72d488ca4b7cb2de28712/",
               "at": "2026-11-18T19:10:01Z",
               "status": 200,
               "bytes": 45881,
               "sha256_prefix": "34e458c74591081c",
               "changed": false
              }
             ]
            },
            {
             "at": "2026-11-18T19:06:27Z",
             "finished": "2026-11-18T19:06:29Z",
             "ok": 1,
             "failed": 0,
             "reads": [
              {
               "name": "dataset",
               "url": "https://dados.gov.pt/api/1/datasets/66d72d488ca4b7cb2de28712/",
               "at": "2026-11-18T19:06:29Z",
               "status": 200,
               "bytes": 45881,
               "sha256_prefix": "34e458c74591081c",
               "changed": false
              }
             ]
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/api/v1/base-gov-pt/card.json": {
   "get": {
    "operationId": "get_base_gov_pt_card",
    "tags": [
     "base-gov-pt"
    ],
    "summary": "Public contracts (Portal BASE): the card",
    "description": "Who publishes the source, its reuse terms, the schedule, who owns it, what runs by code, by agents and by people, and the vault.",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string"
          },
          "title": {
           "type": "string"
          },
          "what": {
           "type": "string"
          },
          "publisher": {
           "type": "string"
          },
          "owner": {
           "type": "string"
          },
          "collector": {
           "type": "string"
          },
          "source_home": {
           "type": "string"
          },
          "reader_page": {
           "type": "string"
          },
          "schedule": {
           "type": "object",
           "properties": {
            "cadence": {
             "type": "string"
            },
            "how": {
             "type": "string"
            }
           },
           "required": [
            "cadence",
            "how"
           ]
          },
          "terms": {
           "type": "object",
           "properties": {
            "summary": {
             "type": "string"
            },
            "page": {
             "type": "string"
            },
            "read_at": {
             "type": "string"
            },
            "quote": {
             "type": "string"
            },
            "quote_lang": {
             "type": "string"
            },
            "republish": {
             "type": "string"
            },
            "robots": {
             "type": "string"
            },
            "open_question": {
             "type": "string"
            }
           },
           "required": [
            "summary",
            "page",
            "read_at",
            "quote",
            "quote_lang",
            "republish",
            "robots",
            "open_question"
           ]
          },
          "api": {
           "type": "object",
           "properties": {
            "latest": {
             "type": "string"
            },
            "reads": {
             "type": "string"
            },
            "card": {
             "type": "string"
            },
            "openapi": {
             "type": "string"
            },
            "page": {
             "type": "string"
            }
           },
           "required": [
            "latest",
            "reads",
            "card",
            "openapi",
            "page"
           ]
          },
          "split": {
           "type": "object",
           "properties": {
            "code": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "agents": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "people": {
             "type": "array",
             "items": {
              "type": "string"
             }
            }
           },
           "required": [
            "code",
            "agents",
            "people"
           ]
          },
          "cost": {
           "type": "object",
           "properties": {
            "per_run_tokens": {
             "type": "integer"
            },
            "per_run_model_cost_usd": {
             "type": "integer"
            },
            "runner": {
             "type": "string"
            },
            "build_tokens": {
             "type": "string"
            },
            "note": {
             "type": "string"
            }
           },
           "required": [
            "per_run_tokens",
            "per_run_model_cost_usd",
            "runner",
            "build_tokens",
            "note"
           ]
          },
          "since": {
           "type": "string"
          }
         },
         "required": [
          "id",
          "title",
          "what",
          "publisher",
          "owner",
          "collector",
          "source_home",
          "reader_page",
          "schedule",
          "terms",
          "api",
          "split",
          "cost",
          "since"
         ],
         "x-inferred": true
        },
        "examples": {
         "example": {
          "summary": "A real file, cut to a readable size",
          "value": {
           "id": "base-gov-pt",
           "title": "Public contracts (Portal BASE)",
           "what": "Public contracts of the câmaras municipais of Lisboa and the Algarve's 16 municipalities, as contracting entity: object, contractors that are companies, price, dates and procedure, for the last 90 days.",
           "publisher": "IMPIC, Instituto dos Mercados Públicos, do Imobiliário e da Construção (Portal BASE), through dados.gov.pt",
           "owner": "data@PrompTugal.dinis",
           "collector": "sources/base-gov-pt/collect.mjs",
           "source_home": "https://dados.gov.pt/pt/datasets/66d72d488ca4b7cb2de28712/",
           "reader_page": "https://www.base.gov.pt/",
           "schedule": {
            "cadence": "every 6 hours",
            "how": "the Pages workflow, at 00, 06, 12 and 18 UTC and on every push to dev; IMPIC's file is updated about weekly, so a run whose file has not changed does not download it again"
           },
           "terms": {
            "summary": "IMPIC publishes these contracts as open data on dados.gov.pt with the licence \"Outra (Domínio Público)\" (other-pd, public domain); we name IMPIC and the Portal BASE as the source and link each contract's page.",
            "page": "https://dados.gov.pt/api/1/datasets/66d72d488ca4b7cb2de28712/",
            "read_at": "2026-11-18",
            "quote": "\"license\": \"other-pd\", \"license_title\": \"Outra (Domínio Público)\"; \"description\": \"Contratos de 2012 a 2026 integração registada no Portal Base em www.base.gov.pt pelas entidades adjudicantes\"; \"frequency\": \"weekly\"",
            "quote_lang": "pt",
            "republish": "yes: published by IMPIC as public domain on dados.gov.pt; we attribute IMPIC and keep the link to each contract on base.gov.pt",
            "robots": "dados.gov.pt/robots.txt answered with an HTML error page (HTTP 500) on 18 Nov 2026, so no rule was readable; we use only its documented public dataset API and the file link it gives. base.gov.pt has no robots.txt (404) and is not read: its own search answered civic.b@ with a firewall alert, treated ...",
            "open_question": "Personal data: contracts name sole traders. The licence is public domain, but data protection law still applies to what we republish. We keep no natural person's name or NIF (see docs/threat-models/base-gov-pt.md); Dinis to confirm that rule."
           },
           "api": {
            "latest": "https://data.promptugal.news/api/v1/base-gov-pt/latest.json",
            "reads": "https://data.promptugal.news/api/v1/base-gov-pt/reads.json",
            "card": "https://data.promptugal.news/api/v1/base-gov-pt/card.json",
            "openapi": "https://data.promptugal.news/api/v1/base-gov-pt/openapi.json",
            "page": "https://data.promptugal.news/sources/base-gov-pt/"
           },
           "split": {
            "code": [
             "the collector downloads IMPIC's yearly file from dados.gov.pt (when it changed), stream-parses it and writes latest.json and reads.json",
             "GitHub Actions runs it every 6 hours and deploys the site",
             "the build makes the API, the OpenAPI description and the pages"
            ],
            "agents": [
             "data.b.dev2@PrompTugal.dinis (Sonnet) wrote the collector and this card on 18 November 2026, reusing the approach of civic's tools/extract-base.mjs (civic.b@PrompTugal.dinis)"
            ],
            "people": [
             "Dinis Cruz instructs; no person has checked the values yet (not reviewed)"
            ]
           },
           "cost": {
            "per_run_tokens": 0,
            "per_run_model_cost_usd": 0,
            "runner": "GitHub Actions on a public repository: no charge; one 70 MB download only when IMPIC's file has changed (about weekly)",
            "build_tokens": "not measured",
            "note": "Code only: no model is called when the data is collected."
           },
           "since": "2026-11-18"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/api/v1/base-gov-pt/openapi.json": {
   "get": {
    "operationId": "get_base_gov_pt_openapi",
    "tags": [
     "base-gov-pt"
    ],
    "summary": "Public contracts (Portal BASE): this document",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/base-gov-pt/places/index.json": {
   "get": {
    "operationId": "get_base_gov_pt_places_index",
    "tags": [
     "base-gov-pt"
    ],
    "summary": "Public contracts (Portal BASE): the places that have a file",
    "description": "Public contracts (Portal BASE): one file per place, each the same shape as latest.json with only that place.",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "about": {
           "type": "string"
          },
          "read_at": {
           "type": "string"
          },
          "places": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "url": {
              "type": "string",
              "format": "uri"
             },
             "items": {
              "type": "integer"
             }
            },
            "required": [
             "id",
             "url",
             "items"
            ]
           }
          }
         },
         "required": [
          "about",
          "read_at",
          "places"
         ],
         "x-inferred": true
        },
        "examples": {
         "example": {
          "summary": "A real file, cut to a readable size",
          "value": {
           "about": "Public contracts (Portal BASE): one file per place, each the same shape as latest.json with only that place.",
           "read_at": "2026-11-18T19:14:25Z",
           "places": [
            {
             "id": "albufeira",
             "url": "https://data.promptugal.news/api/v1/base-gov-pt/places/albufeira.json",
             "items": 92
            },
            {
             "id": "alcoutim",
             "url": "https://data.promptugal.news/api/v1/base-gov-pt/places/alcoutim.json",
             "items": 15
            },
            {
             "id": "aljezur",
             "url": "https://data.promptugal.news/api/v1/base-gov-pt/places/aljezur.json",
             "items": 36
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/api/v1/base-gov-pt/places/{place}.json": {
   "get": {
    "operationId": "get_base_gov_pt_place",
    "tags": [
     "base-gov-pt"
    ],
    "summary": "Public contracts (Portal BASE): one place",
    "description": "The same shape as latest.json, with only this place in places.",
    "parameters": [
     {
      "name": "place",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "albufeira",
        "alcoutim",
        "aljezur",
        "castro-marim",
        "faro",
        "lagoa",
        "lagos",
        "lisboa",
        "loule",
        "monchique",
        "olhao",
        "portimao",
        "sao-bras-de-alportel",
        "silves",
        "tavira",
        "vila-do-bispo",
        "vila-real-de-santo-antonio"
       ]
      },
      "example": "albufeira"
     }
    ],
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "shape": {
           "type": "string"
          },
          "source": {
           "type": "string"
          },
          "title": {
           "type": "string"
          },
          "read_at": {
           "type": "string"
          },
          "provenance": {
           "type": "object",
           "properties": {
            "source": {
             "type": "string"
            },
            "page": {
             "type": "string"
            },
            "read_at": {
             "type": "string"
            },
            "by": {
             "type": "string"
            },
            "terms": {
             "type": "string"
            },
            "dataset": {
             "type": "string"
            },
            "terms_page": {
             "type": "string"
            },
            "how": {
             "type": "string"
            }
           },
           "required": [
            "source",
            "page",
            "read_at",
            "by",
            "terms",
            "dataset",
            "terms_page",
            "how"
           ]
          },
          "about": {
           "type": "string"
          },
          "counts": {
           "type": "object",
           "properties": {
            "contracts": {
             "type": "integer"
            },
            "places": {
             "type": "integer"
            },
            "by_place": {
             "type": "object",
             "properties": {
              "albufeira": {
               "type": "integer"
              }
             },
             "required": [
              "albufeira"
             ]
            },
            "records_scanned": {
             "type": "null"
            },
            "window_days": {
             "type": "integer"
            },
            "objects_withheld": {
             "type": "integer"
            }
           },
           "required": [
            "contracts",
            "places",
            "by_place",
            "records_scanned",
            "window_days",
            "objects_withheld"
           ]
          },
          "note": {
           "type": "string"
          },
          "dataset": {
           "type": "object",
           "properties": {
            "name": {
             "type": "string"
            },
            "dataset": {
             "type": "string"
            },
            "licence": {
             "type": "string"
            },
            "files": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "year": {
                "type": "integer"
               },
               "file": {
                "type": "string"
               },
               "resource": {
                "type": "string"
               },
               "resource_modified": {
                "type": "string"
               },
               "bytes": {
                "type": "integer"
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "year",
               "file",
               "resource",
               "resource_modified",
               "bytes",
               "read_at"
              ]
             }
            }
           },
           "required": [
            "name",
            "dataset",
            "licence",
            "files"
           ]
          },
          "places": {
           "type": "object",
           "properties": {
            "albufeira": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "place": {
                "type": "string"
               },
               "object": {
                "type": [
                 "string",
                 "null"
                ]
               },
               "object_withheld": {
                "type": [
                 "null",
                 "string"
                ]
               },
               "buyer_kind": {
                "type": "string"
               },
               "contracting_entity": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "nif": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "nif"
                ]
               },
               "contractors": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "kind": {
                   "type": "string"
                  },
                  "nif": {
                   "type": "string"
                  },
                  "name": {
                   "type": "string"
                  },
                  "country": {
                   "type": "string"
                  }
                 },
                 "required": [
                  "kind"
                 ]
                }
               },
               "price_eur": {
                "type": "number"
               },
               "base_price_eur": {
                "type": "number"
               },
               "published": {
                "type": "string",
                "format": "date"
               },
               "signed": {
                "type": "string",
                "format": "date"
               },
               "decision": {
                "type": "string",
                "format": "date"
               },
               "procedure": {
                "type": "string"
               },
               "contract_types": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "url": {
                "type": "string",
                "format": "uri"
               },
               "license": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string",
                  "format": "uri"
                 },
                 "id": {
                  "type": "string"
                 },
                 "holder": {
                  "type": "string"
                 },
                 "note": {
                  "type": "string"
                 }
                },
                "required": [
                 "name",
                 "url",
                 "id",
                 "holder",
                 "note"
                ]
               },
               "read_at": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "place",
               "object",
               "object_withheld",
               "buyer_kind",
               "contracting_entity",
               "contractors",
               "price_eur",
               "base_price_eur",
               "published",
               "signed",
               "decision",
               "procedure",
               "contract_types",
               "url",
               "license",
               "read_at"
              ]
             }
            }
           },
           "required": [
            "albufeira"
           ]
          }
         },
         "required": [
          "shape",
          "source",
          "title",
          "read_at",
          "provenance",
          "about",
          "counts",
          "note",
          "dataset",
          "places"
         ],
         "x-inferred": true
        },
        "examples": {
         "example": {
          "summary": "A real file, cut to a readable size",
          "value": {
           "shape": "2",
           "source": "base-gov-pt",
           "title": "Public contracts (Portal BASE)",
           "read_at": "2026-11-18T19:14:25Z",
           "provenance": {
            "source": "https://dados.gov.pt/pt/datasets/66d72d488ca4b7cb2de28712/",
            "page": "https://www.base.gov.pt/",
            "read_at": "2026-11-18T19:14:25Z",
            "by": "sources/base-gov-pt/collect.mjs (code, no model; run by data@PrompTugal.dinis)",
            "terms": "IMPIC publishes these contracts as open data on dados.gov.pt with the licence \"Outra (Domínio Público)\" (other-pd, public domain); we name IMPIC and the Portal BASE as the source and link each contract's page.",
            "dataset": "https://dados.gov.pt/pt/datasets/66d72d488ca4b7cb2de28712/",
            "terms_page": "https://dados.gov.pt/pt/datasets/66d72d488ca4b7cb2de28712/",
            "how": "IMPIC's yearly file on dados.gov.pt (contratos2026.zip), stream-parsed in memory, the approach of PrompTugal__News__Civic tools/extract-base.mjs"
           },
           "about": "Public contracts published on the Portal BASE in the last 90 days (from 2026-08-20) where the contracting entity is the câmara municipal of Lisboa or of one of the Algarve's 16 municipalities (Quarteira is a parish of Loulé and has no câmara of its own). From IMPIC's open data, which is updated abou...",
           "counts": {
            "contracts": 92,
            "places": 1,
            "by_place": {
             "albufeira": 92
            },
            "records_scanned": null,
            "window_days": 90,
            "objects_withheld": 186
           },
           "note": "The dataset file had not changed since the last read, so it was not downloaded again; each contract keeps the time of the read that found it.",
           "dataset": {
            "name": "Contratos Públicos - Portal Base - IMPIC (open data on dados.gov.pt)",
            "dataset": "https://dados.gov.pt/pt/datasets/66d72d488ca4b7cb2de28712/",
            "licence": "other-pd",
            "files": [
             {
              "year": 2026,
              "file": "contratos2026.zip",
              "resource": "https://dados.gov.pt/s/resources/contratos-publicos-portal-base-impic-contratos-de-2012-a-2026/20261115-100642-624650f6/contratos2026.zip",
              "resource_modified": "2026-11-15T10:06:42.704000+00:00",
              "bytes": 69765818,
              "read_at": "2026-11-18T15:50:50Z"
             }
            ]
           },
           "places": {
            "albufeira": [
             {
              "id": "15927119",
              "place": "albufeira",
              "object": "Empreitada de construção de salas, instalações sanitárias e gabinetes em monobloco para a EBSA e EB 2,3 Francisco Cabrita, incluindo infraestruturas.",
              "object_withheld": null,
              "buyer_kind": "council",
              "contracting_entity": {
               "name": "Município de Albufeira",
               "nif": "503539473"
              },
              "contractors": [
               {
                "kind": "company",
                "nif": "514110686",
                "name": "RENATO ARANTES UNIPESSOAL",
                "country": "PRT"
               }
              ],
              "price_eur": 476791.45,
              "base_price_eur": 562613.91,
              "published": "2026-11-12",
              "signed": "2026-11-11",
              "decision": "2026-10-22",
              "procedure": "Concurso público",
              "contract_types": [
               "Empreitadas de obras públicas"
              ],
              "url": "https://www.base.gov.pt/Base4/pt/detalhe/?type=contratos&id=15927119",
              "license": {
               "name": "Outra (Domínio Público)",
               "url": "https://dados.gov.pt/pt/datasets/66d72d488ca4b7cb2de28712/",
               "id": "other-pd",
               "holder": "IMPIC, Instituto dos Mercados Públicos, do Imobiliário e da Construção",
               "note": "As dados.gov.pt publishes the dataset. Our record of it is CC BY 4.0."
              },
              "read_at": "2026-11-18T15:50:50Z"
             },
             {
              "id": "15919124",
              "place": "albufeira",
              "object": "Participação do Município de Albufeira no Travel Summit 2026 como parceiro nível Platina",
              "object_withheld": null,
              "buyer_kind": "council",
              "contracting_entity": {
               "name": "Município de Albufeira",
               "nif": "503539473"
              },
              "contractors": [
               {
                "kind": "company",
                "nif": "506529517",
                "name": "REPRESENTAÇÕES TURÍSTICAS GEA PORTUGAL LDA",
                "country": "PRT"
               }
              ],
              "price_eur": 24390.24,
              "base_price_eur": 24390.24,
              "published": "2026-11-10",
              "signed": "2026-11-10",
              "decision": "2026-11-05",
              "procedure": "Ajuste Direto Regime Geral",
              "contract_types": [
               "Aquisição de serviços"
              ],
              "url": "https://www.base.gov.pt/Base4/pt/detalhe/?type=contratos&id=15919124",
              "license": {
               "name": "Outra (Domínio Público)",
               "url": "https://dados.gov.pt/pt/datasets/66d72d488ca4b7cb2de28712/",
               "id": "other-pd",
               "holder": "IMPIC, Instituto dos Mercados Públicos, do Imobiliário e da Construção",
               "note": "As dados.gov.pt publishes the dataset. Our record of it is CC BY 4.0."
              },
              "read_at": "2026-11-18T15:50:50Z"
             },
             {
              "id": "15910248",
              "place": "albufeira",
              "object": "AQUISIÇÃO DE ESPETÁCULO DE ANO NOVO",
              "object_withheld": null,
              "buyer_kind": "council",
              "contracting_entity": {
               "name": "Município de Albufeira",
               "nif": "503539473"
              },
              "contractors": [
               {
                "kind": "company",
                "nif": "509921434",
                "name": "Impossible World – Worldwide Entertainment Productions S.A,",
                "country": "PRT"
               }
              ],
              "price_eur": 337000,
              "base_price_eur": 337000,
              "published": "2026-11-09",
              "signed": "2026-11-02",
              "decision": "2026-09-21",
              "procedure": "Ajuste Direto Regime Geral",
              "contract_types": [
               "Aquisição de serviços"
              ],
              "url": "https://www.base.gov.pt/Base4/pt/detalhe/?type=contratos&id=15910248",
              "license": {
               "name": "Outra (Domínio Público)",
               "url": "https://dados.gov.pt/pt/datasets/66d72d488ca4b7cb2de28712/",
               "id": "other-pd",
               "holder": "IMPIC, Instituto dos Mercados Públicos, do Imobiliário e da Construção",
               "note": "As dados.gov.pt publishes the dataset. Our record of it is CC BY 4.0."
              },
              "read_at": "2026-11-18T15:50:50Z"
             }
            ]
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  }
 },
 "tags": [
  {
   "name": "base-gov-pt",
   "description": "Public contracts of the câmaras municipais of Lisboa and the Algarve's 16 municipalities, as contracting entity: object, contractors that are companies, price, dates and procedure, for the last 90 days."
  }
 ],
 "x-source": {
  "id": "base-gov-pt",
  "card": "https://data.promptugal.news/api/v1/base-gov-pt/card.json",
  "page": "https://data.promptugal.news/sources/base-gov-pt/"
 }
}
