# Portugal Public Contracts (Portal BASE) (`fluxopronto/portugal-public-contracts`) Actor

Search and export Portuguese public contracts from the official Portal BASE open data (IMPIC, dados.gov.pt). Filter by contracting authority or supplier (name or NIF), CPV, procedure type, dates, value and year. Clean JSON/CSV/Excel with ISO dates, euro amounts and separate NIFs.

- **URL**: https://apify.com/fluxopronto/portugal-public-contracts.md
- **Developed by:** [João Ferreira](https://apify.com/fluxopronto) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 contract results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Portugal Public Contracts (Portal BASE)

Search and export **Portuguese public contracts** from the official **Portal BASE** open data, published weekly by IMPIC on [dados.gov.pt](https://dados.gov.pt/pt/datasets/contratos-publicos-portal-base-impic-contratos-de-2012-a-2026/). Filter by contracting authority, winning company (name or NIF), CPV code, procedure type, dates, contract value and year, and get clean, ready-to-use records in JSON, CSV or Excel.

- **Coverage:** contracts from 2012 to the current year (one official file per year, about 180,000 contracts in 2026 up to September).
- **Clean output:** English field names, ISO dates (`2026-07-08`), amounts as numbers in euros, NIF and name in separate fields, CPV and NUTS split into code and description.
- **Official open data only:** the Actor downloads the files IMPIC publishes on dados.gov.pt. It does not scrape base.gov.pt and does not use the restricted Portal BASE API.
- **Source attribution in every record.**

### Who is it for

- **Journalists and researchers:** which companies win contracts from a given municipality or ministry, how much was awarded by direct award, contracts above a value in a period.
- **Companies that bid for public contracts:** see who wins in your CPV sector, at what prices, which authorities buy what, and who the competing bidders were.
- **Compliance and due diligence:** list every public contract awarded to a supplier NIF.
- **Data teams and AI agents:** a structured, documented feed of Portuguese procurement data without parsing 300 MB files yourself.

### How to use

1. Choose the **years** to scan (or a date range). Without either, the most recent year is used.
2. Add any filters. All filters are combined with AND; several values inside one filter are combined with OR.
3. Set **Maximum results** and run. Download the results from the Output tab in JSON, CSV, Excel or via the API.

#### Input fields

| Field | What it does |
|---|---|
| `years` | Year files to scan, e.g. `["2025", "2026"]`. Files are grouped by the Portal BASE contract year (normally the signing year). |
| `contractingAuthorities` | Public body: 9-digit NIF (most reliable) or part of the name. Case and accents are ignored. |
| `suppliers` | Winning company: 9-digit NIF or part of the name. |
| `cpvCodes` | CPV prefix: `"72"` = all IT services, `"45"` = all construction work, `"72210000-0"` = that code and its sub-codes. |
| `procedureTypes` | Part of the procedure name in Portuguese, e.g. `"Ajuste Direto"`, `"Consulta Prévia"`, `"Concurso público"`. |
| `contractTypes` | Part of the contract type, e.g. `"Aquisição de serviços"`, `"Empreitadas de obras públicas"`. |
| `keywords` | Words in the contract title or description (Portuguese). |
| `dateFrom`, `dateTo`, `dateField` | Date range (YYYY-MM-DD) on the publication date (default) or the signing date. |
| `minPrice`, `maxPrice` | Contract price range in euros. |
| `maxResults` | The run stops after this many saved contracts (default 1,000). |

Tip: the same authority is often written in several ways. In our test sample, NIF 506361438 matched 30 contracts, while the name fragment "oncologia de coimbra" matched only 25 of them. Use NIFs when you can.

### Examples from real test runs

Both runs below were made on 2026-10-03 against the real 2026 file (published 2026-09-27), on a local PC with the Node.js heap limited to 200 MB. Times on the Apify platform may differ.

#### 1. All IT services contracts of 2026

```json
{ "years": ["2026"], "cpvCodes": ["72"], "maxResults": 1000000 }
```

Result: 180,386 contracts read, **6,329 saved**. 60 seconds in total, including the 42 MB download. Peak memory 122 MB.

#### 2. Large construction tenders published in July 2026

```json
{
  "years": ["2026"],
  "cpvCodes": ["45"],
  "procedureTypes": ["Concurso público"],
  "minPrice": 1000000,
  "dateFrom": "2026-07-01",
  "dateTo": "2026-07-31",
  "maxResults": 20
}
```

Result: 20 contracts saved, after reading 127,320 records (the run stops as soon as `maxResults` is reached). First rows:

| contractId | Published | Contracting authority | Supplier | Price (EUR) |
|---|---|---|---|---|
| 15227015 | 2026-07-01 | Município das Caldas da Rainha | Sunever Engenharia, Lda. | 1,748,980.07 |
| 15231469 | 2026-07-02 | Município de Oliveira de Azeméis | MANUEL FRANCISCO DE ALMEIDA,SA | 2,929,068.00 |
| 15253476 | 2026-07-07 | Infraestruturas de Portugal | Teixeira Duarte - Engenharia e Construções… | 75,996,030.36 |

#### Output record (real, from example 2, shortened)

```json
{
  "contractId": "15253951",
  "procedureId": "9274750",
  "year": 2026,
  "title": "Centro de Educação Especial de Bragança do Centro Distrital de Bragança",
  "contractTypes": ["Empreitadas de obras públicas"],
  "procedureType": "Concurso público",
  "contractingAuthorities": [{ "nif": "505305500", "name": "Instituto da Segurança Social, IP" }],
  "suppliers": [{ "nif": "500006334", "name": "Abel Luís Nogueiro & Irmãos Lda", "isSme": true }],
  "competitors": [
    { "nif": "500006334", "name": "Abel Luís Nogueiro & Irmãos Lda" },
    { "nif": "507689127", "name": "Samuel Augusto, lda." }
  ],
  "cpv": [{ "code": "45113000-2", "description": "Obras no local" }],
  "publicationDate": "2026-07-08",
  "signingDate": "2026-07-07",
  "awardDecisionDate": "2026-06-11",
  "contractPrice": 1439616.86,
  "basePrice": 1500000,
  "currency": "EUR",
  "executionDeadlineDays": 240,
  "executionPlaces": ["Portugal, Braganca, Bragança"],
  "nuts": [{ "code": "PT11E", "name": "Terras de Trás-os-Montes" }],
  "legalBasis": "Artigo 19.º, alínea b) do Código dos Contratos Públicos",
  "announcementNumber": "5015/2026",
  "tenderDocumentsUrl": "https://www.acingov.pt/acingovprod/2/zonaPublica/zona_publica_c/donwloadProcedurePiece/MTA1MDUwOA",
  "source": "IMPIC – Portal BASE (Contratos Públicos), via dados.gov.pt",
  "sourceFile": "https://dados.gov.pt/s/resources/contratos-publicos-portal-base-impic-contratos-de-2012-a-2026/20260927-090427-eb50032c/contratos2026.zip",
  "license": "Outra (Domínio Público) — as declared on dados.gov.pt"
}
```

### Output fields

| Group | Fields |
|---|---|
| Identification | `contractId`, `procedureId`, `year`, `announcementNumber`, `announcementType`, `incmId` |
| What | `title`, `description`, `contractTypes`, `procedureType`, `cpv` (code + description), `cpvCodes`, `lots` |
| Who | `contractingAuthorities` (nif, name), `contractingAuthorityNifs`, `contractingAuthorityNames`, `suppliers` (nif, name, isSme), `supplierNifs`, `supplierNames`, `competitors` (nif, name) |
| When | `publicationDate`, `signingDate`, `awardDecisionDate`, `closeDate` (ISO 8601 or null), `executionDeadlineDays` |
| How much | `contractPrice`, `basePrice`, `effectiveTotalPrice` (numbers, EUR), `currency` |
| Where | `executionPlaces`, `nuts` (code, name) |
| Legal | `legalBasis`, `directAwardGrounds`, `legalRegime`, `awardCriterion`, `centralizedProcedure`, `frameworkAgreementNumber`, `frameworkAgreementDescription`, `greenContract`, `materialCriteria`, `contractEndReason`, `writtenContractExemptionReasons` |
| Links and notes | `tenderDocumentsUrl` (e-procurement platform, when published), `notes` |
| Source | `source`, `sourceDatasetUrl`, `sourceFile`, `license`, `attribution` |

Each run also saves a summary in the key-value store (`OUTPUT`): years scanned, records read, matches, saved results, duration, peak memory and the exact source files used.

### Ready-made searches

Copy one of these into the JSON input and change the values.

| Question | Input |
|---|---|
| Every contract a company won (by NIF) | `{ "years": ["2025", "2026"], "suppliers": ["500006334"], "maxResults": 5000 }` |
| Direct awards by one municipality | `{ "years": ["2026"], "contractingAuthorities": ["Município de Coimbra"], "procedureTypes": ["Ajuste Direto"] }` |
| Who wins IT services contracts above 100,000 € | `{ "years": ["2026"], "cpvCodes": ["72"], "minPrice": 100000 }` |
| Cleaning or security services contracts signed last quarter | `{ "years": ["2026"], "cpvCodes": ["90910000", "79710000"], "dateField": "signingDate", "dateFrom": "2026-07-01", "dateTo": "2026-09-30" }` |
| Contracts that mention a word in the title | `{ "years": ["2026"], "keywords": ["software"], "maxResults": 500 }` |

### Use it from n8n, Make, Python or the API

- **API:** run the Actor and get the results in one call with Apify's `run-sync-get-dataset-items` endpoint: `POST https://api.apify.com/v2/acts/fluxopronto~portugal-public-contracts/run-sync-get-dataset-items` with your Apify token and the input as the JSON body. See the API tab of this Actor for ready-made code.
- **Python or JavaScript:** use the official `apify-client` package: call the Actor `fluxopronto/portugal-public-contracts` with your input and read the items of its default dataset.
- **n8n, Make, Zapier:** use Apify's official integration for your tool, choose this Actor and map the output fields.
- **AI agents:** the Actor can be used as a tool through Apify's MCP server.

A weekly scheduled run (Apify Schedules) with a supplier NIF or a CPV prefix gives you a simple alert for new contracts in your sector.

### FAQ

**Is this data public and legal to use?**
Yes. It is the open data IMPIC publishes on dados.gov.pt with the licence «Outra (Domínio Público)». Every record says where it came from. Check the GDPR if you process records about individuals (see Limitations).

**Does it include contracts that are still open for bids?**
No. This Actor covers contracts that were already awarded and published. Tender announcements are a different dataset.

**How current is the data?**
IMPIC updates the files weekly. The Actor always downloads the newest file, so a run gives you the latest published week.

**Why does a search by name find fewer contracts than a search by NIF?**
The same body is often written in several ways in the source. The NIF is the same in every record.

**How much does a run cost?**
You pay per saved contract and a tiny fee per run start (see the Pricing tab), nothing for the contracts that are read and filtered out. Set `maxResults` or a maximum cost per run to cap it.

### Pricing

Pay per result: you pay for each contract saved to the dataset, not for the contracts that are read and filtered out. The current price is shown in the Pricing tab of this Actor. You can cap the cost of a run with the Apify "maximum cost per run" setting; the Actor stops when the cap is reached.

### Limitations (please read)

- **Data is as published by IMPIC.** Names are not standardised (one authority can appear under several spellings), some fields are empty, and `basePrice` / `effectiveTotalPrice` are often `0` when they were not filled in. The Actor does not correct or enrich the data.
- **Update frequency:** the source files are updated weekly by IMPIC; the newest contracts can take days to appear.
- **Year files:** files are grouped by the Portal BASE contract year (normally the signing year). A date filter on the publication date also scans the following year's file to catch late publications; contracts outside that window are not found.
- **Speed:** each year file must be read in full unless `maxResults` is reached first. One year takes about one minute in our local test; scanning many years takes proportionally longer.
- **No sorting:** results come in the order of the source file, newest year first.
- **Personal data:** IMPIC publishes some suppliers that are individuals by name only, without NIF. The Actor never outputs a NIF in the ranges reserved for natural persons. If you process records about individuals, the GDPR applies to you.
- **Only contracts:** tender announcements and contract modifications (also published by IMPIC) are not included yet.

### Source and licence

Data: **IMPIC – Instituto dos Mercados Públicos, do Imobiliário e da Construção**, dataset «Contratos Públicos - Portal Base - IMPIC - Contratos de 2012 a 2026» on dados.gov.pt, licence declared as «Outra (Domínio Público)». Every record carries the source, the exact source file and the licence. This Actor is not affiliated with or endorsed by IMPIC, the Portal BASE or dados.gov.pt.

### Em português

Este Actor pesquisa os contratos públicos portugueses registados no Portal BASE, a partir dos dados abertos que o IMPIC publica todas as semanas no dados.gov.pt (licença «Outra (Domínio Público)»). Pode filtrar por entidade adjudicante ou adjudicatária (nome ou NIF), código CPV, tipo de procedimento, tipo de contrato, palavras do objeto, datas, preço contratual e ano. Os resultados saem com datas ISO, valores em euros e NIF separado do nome, e podem ser descarregados em JSON, CSV ou Excel. Não usa a API do Portal BASE nem o site base.gov.pt. Os nomes das entidades aparecem escritos de várias formas: pesquise pelo NIF sempre que puder.

# Actor input Schema

## `years` (type: `array`):

Portal BASE year files to scan (2012 to the current year). Files are grouped by contract year (normally the signing year). Leave empty to use the date range, or the latest year if there is no date range.

## `contractingAuthorities` (type: `array`):

Public body that awarded the contract. Enter a 9-digit NIF (most reliable, names are spelled in several ways) or part of the name; case and accents are ignored.

## `suppliers` (type: `array`):

Company that won the contract (adjudicatário). 9-digit NIF or part of the name.

## `cpvCodes` (type: `array`):

Common Procurement Vocabulary codes. Prefix match: "72" = all IT services, "45" = all construction work, "72210000-0" = programming services and sub-codes.

## `procedureTypes` (type: `array`):

Part of the procedure type name as published in Portuguese, e.g. "Ajuste Direto", "Consulta Prévia", "Concurso público", "acordo-quadro".

## `contractTypes` (type: `array`):

Part of the contract type in Portuguese, e.g. "Aquisição de serviços", "Aquisição de bens móveis", "Empreitadas de obras públicas".

## `keywords` (type: `array`):

Any of these words or phrases (Portuguese text), case and accents ignored.

## `dateFrom` (type: `string`):

Inclusive, YYYY-MM-DD. Applies to the field chosen in "Date field".

## `dateTo` (type: `string`):

Inclusive, YYYY-MM-DD.

## `dateField` (type: `string`):

Which date the date range applies to.

## `minPrice` (type: `number`):

Contract price (preço contratual), in euros, exactly as published on Portal BASE.

## `maxPrice` (type: `number`):

Contract price, in euros.

## `maxResults` (type: `integer`):

The run stops when this many contracts have been saved. You are charged per saved contract.

## Actor input object example

```json
{
  "years": [
    "2026"
  ],
  "cpvCodes": [
    "72"
  ],
  "dateField": "publicationDate",
  "maxResults": 100
}
```

# Actor output Schema

## `contracts` (type: `string`):

Public contracts that matched your filters (JSON, CSV or Excel).

## `summary` (type: `string`):

Years scanned, contracts read, contracts saved and why the run stopped.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "years": [
        "2026"
    ],
    "cpvCodes": [
        "72"
    ],
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("fluxopronto/portugal-public-contracts").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "years": ["2026"],
    "cpvCodes": ["72"],
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("fluxopronto/portugal-public-contracts").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "years": [
    "2026"
  ],
  "cpvCodes": [
    "72"
  ],
  "maxResults": 100
}' |
apify call fluxopronto/portugal-public-contracts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fluxopronto/portugal-public-contracts"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/oUEjIogmK2ZRB37Hg/builds/qX8se8CEShihPKbSo/openapi.json
