# Portugal Public Tenders Scraper (Portal BASE) (`merrily_beryl/pt-public-contracts-base`) Actor

Export Portuguese public procurement notices from the official Portal BASE open data (IMPIC): buyer, contract type, CPV, base price, proposal deadline.

- **URL**: https://apify.com/merrily_beryl/pt-public-contracts-base.md
- **Developed by:** [João Pedro Faria](https://apify.com/merrily_beryl) (community)
- **Categories:** Business, Lead generation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 result (tender notice)s

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 Tenders Scraper (Portal BASE)

Search and export **Portuguese public procurement notices** (concursos públicos, procedimentos, urgent tenders, amendments) from the **official Portal BASE open data** published by IMPIC on dados.gov.pt. No HTML scraping, no login, no proxies: only notices published by public contracting bodies.

### What you get

For every notice: notice number, publication date, notice type and procedure, description (in Portuguese), buyer name and NIF, contract type (goods, services, public works...), CPV codes, base price (EUR), proposal deadline in days and as a date, environmental criteria flag, lots, link to the notice in the Diário da República and link to the tender documents on the e-procurement platform.

### Use cases

- **Tender monitoring**: new Portuguese bids in your sector every day (schedule the Actor).
- **Market research**: which municipalities, hospitals and state companies buy IT, construction or medical supplies, and for how much.
- **Supplier prospecting**: public bodies that buy what you sell (organisations only).
- **Cross-border bid tracking** together with the EU-wide TED notices.

### Input

| Field | Description |
|---|---|
| `publishedFrom` / `publishedTo` | Date range `YYYY-MM-DD` (default: last 30 days). |
| `openForBidsOnly` | Only notices whose proposal deadline has not passed. |
| `keywords` | Words in the description or lots, in Portuguese (any match). |
| `cpvPrefixes` | CPV code prefixes, e.g. `72` IT services, `45` construction, `33` medical. |
| `contractTypes` | e.g. `serviços`, `bens móveis`, `obras públicas`. |
| `buyerNif` | NIF of specific contracting bodies. |
| `minValueEur` | Minimum base price in EUR. |
| `maxResults` | Maximum notices returned (you pay per result). |

Example:

```json
{"cpvPrefixes": ["72"], "openForBidsOnly": true, "minValueEur": 50000, "maxResults": 200}
```

### Output example

```json
{
  "noticeNumber": "26251/2026",
  "publishedAt": "2026-10-30",
  "noticeType": "Anúncio de procedimento",
  "procedure": "Concurso público",
  "description": "Renovação das licenças para Software CAD",
  "buyerName": "BIKINNOV - Bike Value Innovation Center - Association",
  "contractTypes": ["Aquisição de bens móveis"],
  "cpvCodes": ["48321000-4 - Pacote de software para design assistido por computador (CAD)"],
  "basePrice": 60000,
  "currency": "EUR",
  "proposalsCloseAt": "2026-11-08",
  "url": "https://files.diariodarepublica.pt/cp_hora/2026/10/211/419976525.pdf"
}
```

### Pricing

Pay per event: **you pay per notice returned** (event `result-item`). Use `maxResults` to cap your spend.

### FAQ

**Is this legal?** Yes. The data is published as open data by IMPIC (Portal BASE) under the Portuguese public procurement regime. This Actor reads the official dados.gov.pt files, not the website. Output contains public bodies and their notices, not data about private individuals.

**How fresh is the data?** The IMPIC files are refreshed weekly, so the newest notices can be a few days old.

**Can I run it daily?** Yes: use Apify schedules, or integrate via API, Make, Zapier or n8n.

### Limitations

Fields depend on what the buyer filled in. Descriptions are in Portuguese. Always check the official notice before bidding. This Actor covers pre-award notices only (not awarded contracts). Source: IMPIC / Portal BASE (dados.gov.pt).

# Actor input Schema

## `publishedFrom` (type: `string`):

Date YYYY-MM-DD. Default: 30 days ago.

## `publishedTo` (type: `string`):

Date YYYY-MM-DD. Default: today.

## `openForBidsOnly` (type: `boolean`):

Keep only notices whose proposal deadline has not passed yet.

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

Keep notices whose description contains any of these words (Portuguese, case-insensitive).

## `cpvPrefixes` (type: `array`):

Keep notices with a CPV code starting with any of these, e.g. 72 (IT services), 45 (construction), 33 (medical).

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

Keep these contract types (Portuguese wording, partial match), e.g. 'serviços', 'bens móveis', 'obras públicas'.

## `buyerNif` (type: `array`):

Keep only notices from these contracting bodies (9-digit NIF of the public entity).

## `minValueEur` (type: `integer`):

Only notices with a base price at or above this amount.

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

Maximum number of notices to return (you are charged per result).

## Actor input object example

```json
{
  "openForBidsOnly": false,
  "maxResults": 50
}
```

# Actor output Schema

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

All results (one item per record) in the default dataset.

# 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 = {
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("merrily_beryl/pt-public-contracts-base").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 = { "maxResults": 50 }

# Run the Actor and wait for it to finish
run = client.actor("merrily_beryl/pt-public-contracts-base").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 '{
  "maxResults": 50
}' |
apify call merrily_beryl/pt-public-contracts-base --silent --output-dataset

```

## MCP server setup

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

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/JzQ2ca6SdICNonDTh/builds/JpRXw1BpaSK4cjuWo/openapi.json
