# BASE.gov.pt Scraper — Portuguese Public Procurement Contracts (`studio-amba/base-gov-pt-scraper`) Actor

Search and extract Portuguese public procurement contracts from base.gov.pt, Portugal's official public contracts database. Filter by keyword, contract type, CPV, price, or date. Returns buyer, supplier, price, CPV codes, and execution place. No API key, no login required.

- **URL**: https://apify.com/studio-amba/base-gov-pt-scraper.md
- **Developed by:** [Studio Amba](https://apify.com/studio-amba) (community)
- **Categories:** Business, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 result scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## BASE.gov.pt Scraper — Portuguese Public Procurement Contracts

Search and extract Portuguese public procurement contracts from base.gov.pt (Portal BASE — Contratos Públicos Online), Portugal's official public contracts database, run by IMPIC. Filter by keyword, contract type, CPV code, price range, or publication date. Returns buyer, supplier, contract price, CPV classification codes, execution place, and legal regime. No API key, no cookies, no login required.

### How to scrape Base.gov.pt data

This actor reads contract data straight from base.gov.pt's own search API — the same JSON endpoint the site's search page calls in the browser. Every public entity in Portugal (mainland and the Açores/Madeira autonomous regions) is legally required to disclose awarded contracts here, making it the single most complete source for Portuguese government spending data.

Enter your search keywords, pick optional filters, and run. The actor fetches the search results list, then calls each contract's detail endpoint to pull CPV classification codes, execution place, full description, and legal regime that aren't returned in the list view.

#### Who benefits from this data?

- **Government contractors** — Monitor who is winning contracts in your industry across Portuguese ministries, municipalities, hospitals, and state agencies.
- **Market researchers** — Analyze Portuguese public spending patterns, contract volumes, and award trends across sectors and regions.
- **B2B sales teams** — Identify which Portuguese public bodies buy what you sell, and which suppliers already serve them. Build targeted prospect lists across the Portuguese public sector.
- **Consultancies and advisory firms** — Track contract activity by CPV category, district, or buyer to advise clients on Portuguese market entry and bidding strategy.
- **Compliance and legal teams** — Monitor competitor contract awards, verify supplier NIF (tax ID) details, and check procedural transparency.
- **Journalists and researchers** — Investigate public spending on a topic, ministry, or municipality.

#### Search by keyword

Enter any keyword to find relevant contracts. The search matches against "Objeto do contrato" (the contract subject). Examples: "informática", "construção", "limpeza", "consultoria", "software".

#### Filter by contract type

Portugal's law classifies public contracts into eight types: Aquisição de bens móveis (movable goods), Aquisição de serviços (services), Concessão de obras públicas (public works concession), Concessão de serviços públicos (public services concession), Empreitadas de obras públicas (public works), Locação de bens móveis (movable goods lease), Sociedade (company formation), and Outros (other).

#### Filter by CPV code

CPV (Common Procurement Vocabulary) is the EU-wide classification used on every contract. Examples: `72000000` (IT services), `45000000` (construction), `79000000` (business services).

#### Filter by date and price

Use `publishedAfter`/`publishedBefore` to monitor new disclosures within a date window, and `priceMin`/`priceMax` to filter by contract value.

### Input parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `searchQuery` | String | `informática` | Keyword matched against the contract subject |
| `contractType` | Enum | `all` | `all`, `movableGoods`, `services`, `publicWorksConcession`, `publicServicesConcession`, `publicWorks`, `movableGoodsLease`, `society`, `other` |
| `cpv` | String | — | CPV code or description (e.g. `72000000`) |
| `publishedAfter` / `publishedBefore` | String | — | Publication date range, YYYY-MM-DD |
| `priceMin` / `priceMax` | Integer | — | Contract price range, EUR |
| `maxResults` | Integer | `50` | Maximum number of contracts to return (1–5,000) |
| `proxyConfiguration` | Object | Apify proxy | Apify proxy settings |

### What data does this scraper extract?

| Field | Type | Description |
|-------|------|--------------|
| `itemTitle` | String | Contract subject ("Objeto do contrato") |
| `referenceNumber` | String | base.gov.pt internal contract ID |
| `organization` | String | Contracting entity / buyer ("Adjudicante") |
| `status` | String | `Contrato celebrado` (signed) unless flagged under revision |
| `publicationDate` | String | Date the contract was disclosed on the portal |
| `deadline` | String | Execution deadline ("Prazo de execução", e.g. "365 dias") |
| `estimatedValue` | String | Contractual price |
| `currency` | String | Always `EUR` |
| `category` | String | Contract type (e.g. "Aquisição de serviços") |
| `cpvCodes` | Array | CPV classification code(s) with descriptions |
| `region` | String | Execution place ("Portugal, District, Municipality") |
| `itemDescription` | String | Full contract description |
| `contactInfo` | Object | Buyer and supplier names |
| `url` | String | Direct link to the contract on base.gov.pt |
| `scrapedAt` | String | ISO timestamp of when the data was scraped |
| `procedure` | String | Procurement procedure (e.g. "Concurso público", "Ajuste Direto Regime Geral") |
| `signingDate` | String | Date the contract was signed |
| `contractingNif` | String | Buyer's Portuguese tax ID (NIF) |
| `contractedNif` | String | Supplier's Portuguese tax ID (NIF) |
| `regime` | String | Legal regime / basis for the contract |
| `centralizedProcedure` | Boolean | Whether this was a centralized procurement procedure |

### Example output

```json
{
    "itemTitle": "Aquisição de serviços de desenvolvimento aplicacional e de manutenção das aplicações e ferramentas informáticas que suportam os Sistemas de Informação associados à atividade do COMPETE 2030 e dos Sistemas de Incentivos dos Programas do PT2030",
    "referenceNumber": "15522492",
    "organization": "Secretaria-Geral do Governo",
    "status": "Contrato celebrado",
    "publicationDate": "2026-08-24",
    "deadline": "508 dias",
    "estimatedValue": "132158.00",
    "currency": "EUR",
    "category": "Aquisição de serviços",
    "cpvCodes": [
        { "code": "79610000-3", "description": "Serviços de colocação de pessoal" }
    ],
    "region": "Portugal, Lisboa, Lisboa",
    "itemDescription": "Aquisição de serviços de desenvolvimento aplicacional e de manutenção das aplicações e ferramentas informáticas que suportam os Sistemas de Informação associados à atividade do COMPETE 2030 e dos Sistemas de Incentivos dos Programas do PT2030",
    "contactInfo": {
        "Adjudicante (Buyer)": "Secretaria-Geral do Governo",
        "Adjudicatário (Supplier)": "AXIANSEU II DIGITAL CONSULTING, S.A"
    },
    "url": "https://www.base.gov.pt/Base4/pt/detalhe/?type=contratos&id=15522492",
    "scrapedAt": "2026-08-31T14:08:58.360Z",
    "procedure": "Concurso público",
    "signingDate": "2026-08-10",
    "contractingNif": "600088103",
    "contractedNif": "501774360",
    "regime": "Código dos Contratos Públicos (DL111-B/2017) e Lei n.º 30/2021, de 21.05",
    "centralizedProcedure": false
}
```

### Tips for best results

- **Daily monitoring**: Run on a schedule to catch newly disclosed contracts. Set `publishedAfter` to yesterday's date for fresh disclosures only.
- **CPV targeting**: After an initial broad search, note the CPV codes most relevant to your business and filter precisely with `cpv`.
- **Competitor intelligence**: Search for a supplier's name in `searchQuery` won't match (search covers the contract subject, not party names) — instead run a category/CPV search and check the `contactInfo`/`contractedNif` fields for the suppliers you're tracking.
- **NIF lookups**: `contractingNif` and `contractedNif` are Portuguese tax IDs — pair with a company registry lookup to enrich buyer/supplier records.

### How much does it cost to run?

The base.gov.pt data source is free and requires no login. Your only cost is Apify compute time and proxy usage. Each contract requires one extra request to the detail endpoint for CPV codes, execution place, and full description, so run time scales roughly linearly with `maxResults`.

| Search size | Estimated time | Estimated cost |
|-------------|---------------|----------------|
| 20 contracts | ~1 minute | ~$0.02 (~$0.001 per result) |
| 100 contracts | ~4 minutes | ~$0.08 (~$0.001 per result) |
| 500 contracts | ~18 minutes | ~$0.30 (~$0.001 per result) |

Actual cost depends on Apify plan and proxy usage; a run's final usage cost only settles after the run reports SUCCEEDED — reading the dataset mid-run will undercount it.

### Use as an API

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("studio-amba/base-gov-pt-scraper").call(run_input={
    "searchQuery": "construção",
    "contractType": "publicWorks",
    "maxResults": 50,
})

for contract in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{contract['itemTitle']} | {contract['organization']} | {contract['estimatedValue']} EUR")
```

### Limitations

- **This covers awarded contracts, not open tenders**: base.gov.pt's "Contratos" search discloses contracts after signing, not open calls for bids. Every result already has a buyer, a supplier, and a price.
- **Search matches the contract subject only**: the `searchQuery` field matches "Objeto do contrato", not party names — searching a company name in `searchQuery` will not find contracts they were awarded.
- **Prices are as disclosed**: some contracts (framework agreements, non-priced arrangements) may show no meaningful contractual price.
- **CPV granularity**: most contracts carry a single principal CPV code; multi-CPV contracts are supported but rare in practice.

### Other European procurement scrapers

Check the [Studio AMBA actor catalog](https://apify.com/studio-amba) for more European public procurement data, including eTenders (Ireland), DOFFIN (Norway), TenderNed (Netherlands), TED (EU-wide), and Belgian public procurement.

### Your feedback

Found a bug or want a feature? Open an issue on the [Issues tab](https://console.apify.com/actors/studio-amba~base-gov-pt-scraper/issues).

# Actor input Schema

## `searchQuery` (type: `string`):

Search contracts by keyword, matched against the contract subject ('Objeto do contrato'). Examples: 'informática', 'construção', 'limpeza', 'consultoria', 'software'.

## `contractType` (type: `string`):

Filter by contract type ('Tipo de contrato').

## `cpv` (type: `string`):

Filter by CPV (Common Procurement Vocabulary) code or description. Examples: '72000000' (IT services), '45000000' (construction). Leave empty for all categories.

## `publishedAfter` (type: `string`):

Only contracts published on or after this date. Format: YYYY-MM-DD.

## `publishedBefore` (type: `string`):

Only contracts published on or before this date. Format: YYYY-MM-DD.

## `priceMin` (type: `integer`):

Only contracts with a contractual price at or above this amount, in EUR.

## `priceMax` (type: `integer`):

Only contracts with a contractual price at or below this amount, in EUR.

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

Maximum number of contracts to return. Each contract requires one extra request to fetch full details (CPV codes, execution place, description).

## `proxyConfiguration` (type: `object`):

Apify proxy configuration.

## Actor input object example

```json
{
  "searchQuery": "informática",
  "contractType": "all",
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "searchQuery": "informática",
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("studio-amba/base-gov-pt-scraper").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 = {
    "searchQuery": "informática",
    "maxResults": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("studio-amba/base-gov-pt-scraper").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 '{
  "searchQuery": "informática",
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call studio-amba/base-gov-pt-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,studio-amba/base-gov-pt-scraper"
        }
    }
}

```

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/Kt9xPRaQHBUohbfdx/builds/6ssIw9iW4UY4a8qXV/openapi.json
