# Public Contract Awards & Winners: Portugal & Spain (`yodeling_november/public-contract-awards-pt-es`) Actor

🏆 See who wins public contracts in Portugal and Spain, at what price and against whom. Winner, price, discount on the base price, number of bids and competitors for every award, plus rankings of top winners and biggest buyers. Official open data for bid strategy and sales targeting.

- **URL**: https://apify.com/yodeling_november/public-contract-awards-pt-es.md
- **Developed by:** [João Fernandes](https://apify.com/yodeling_november) (community)
- **Categories:** Business, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 contract awards

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?

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

## Public Contract Awards & Winners: Portugal & Spain

**See who wins public contracts, at what price, and against whom.**

Every public contract tells a story: who won, how much the buyer paid, how big the discount was and how many companies competed. This Actor turns the official open data of **Portugal (Portal BASE)** and **Spain (PLACSP)** into clean award records, with the winner, the price, the **discount against the base price**, the **number of bids** and the **competitors**. It also builds **rankings of the top winners and the biggest buyers**. Natural persons are anonymized.

### ✨ Why use it

- 🏆 **Know your competitors:** who wins in your CPV codes, how often, and at what discount.
- 🎯 **Find buyers worth targeting:** which public bodies spend the most on what you sell, and who supplies them today.
- 📊 **Ready-made summaries:** total awarded, average discount, average bids and top buyers for each winner; total spend, share of single-bid awards and top suppliers for each buyer.
- 🇵🇹 **Every Portuguese contract since 2012,** including direct awards: about 190,000 a year.
- 🔔 **Daily feed:** *New* mode returns only awards you haven't seen.
- 💸 **Pay per row:** $3 per 1,000 awards, $0.01 per summary row.

### 🌍 Coverage

- 🇵🇹 **Portugal:** every public contract in **Portal BASE** since 2012, about 190,000 a year, including direct awards. Each comes with base price, contract price, the **list of bidders**, procedure, CPV and place of execution.
- 🇪🇸 **Spain:** award results per lot from the **Plataforma de Contratación del Sector Público** and the regional platforms it aggregates, with winner, amount, number of bids and SME flag.

### 💡 Use cases

- **Bid strategy:** see who wins in your CPV codes, at what discount and against how many bidders, before you price your next bid.
- **Sales targeting:** find the buyers that spend the most on what you sell, and who supplies them today.
- **Risk and integrity analysis:** buyers with a high share of single-bid awards or of direct awards.
- **Journalism and research:** public spending by supplier, buyer or sector.

### 🚀 How to use it

1. Click **Try for free** and choose Portugal, Spain or both.
2. Add CPV prefixes (`72` for IT, `45` for construction), buyers, winners or a minimum value, and the period you want.
3. Run it and download the results as **Excel, CSV or JSON**, or read them from the **Apify API**.
4. Turn on the winner and buyer summaries for instant rankings, or save it as a daily task in *New* mode and send new awards to Make, Zapier, n8n or a webhook.

### 📥 Input examples

IT services in Portugal and Spain in the last 90 days, with summaries:

```json
{ "cpvPrefixes": ["72"], "publishedWithinDays": 90, "summaries": ["winner", "buyer"] }
```

Everything a company won in Portugal in 2025:

```json
{ "countries": ["PT"], "winners": ["Claranet"], "dateFrom": "2025-01-01", "dateTo": "2025-12-31", "summaries": ["buyer"] }
```

Daily feed of new Spanish awards above €100,000 (schedule it):

```json
{ "countries": ["ES"], "minValue": 100000, "publishedWithinDays": 3, "mode": "new", "monitorId": "es-100k" }
```

### 📦 Output

Award rows (`recordType: "award"`):

```json
{
  "awardId": "BASE-15610238",
  "country": "PT",
  "title": "Aquisição de Serviços para Revisão do Projeto de Execução …",
  "buyerName": "CMPEAE - Empresa de Águas e Energia do Município do Porto, EM",
  "winners": [{ "type": "organisation", "taxId": "5…", "name": "A. Burmester - Arquitectos Associados, Lda.", "sme": true }],
  "basePrice": 5000.0,
  "awardedPrice": 5000.0,
  "discountPercent": 0.0,
  "bidsReceived": 1,
  "competitors": [{ "type": "organisation", "taxId": "5…", "name": "…" }],
  "procedureType": "Concurso público",
  "cpvCodes": ["71240000"],
  "awardDate": "2026-08-14",
  "contractDate": "2026-09-03",
  "url": "https://www.base.gov.pt/Base4/pt/detalhe/?type=contratos&id=15610238"
}
```

Summary rows: `winner-summary` (winner, awards, totalAwarded, averageDiscountPercent, averageBids, topBuyers, topCpvs, first and last award) and `buyer-summary` (buyer, awards, totalSpend, averageBids, singleBidSharePercent, averageDiscountPercent, topWinners, topCpvs). The dataset has three views: *Awards*, *Winner summaries* and *Buyer summaries*.

### 💰 How much does it cost?

| Event | Price |
|---|---|
| Award (one row) | $0.003 |
| Summary row | $0.01 |

Higher Apify plans get volume discounts.

### 🔒 Personal data

Many public contracts go to **freelancers and sole traders**. They are kept in the data but **anonymized**: their name and tax id are removed and they appear as `"type": "natural person"`, both as winners and as competitors. The rules for spotting them:

- Portuguese tax ids of natural persons, and Spanish DNI/NIE.
- Tax ids masked by the source.
- Entries without a tax id and without a company legal form in the name.

Natural persons are not included in winner summaries.

### ℹ️ Good to know

- **Portugal:** the open-data files are refreshed **about once a week**. You can query any period back to 2012, so a year of data takes about a minute.
- **Spain:** the national feed carries every status change of every tender, so one run reads about **1.5 to 3 days** of it. For complete Spanish data, **schedule a daily run in New mode**. Historical Spanish awards are not covered.
- Prices are without VAT. `discountPercent` is shown only when both prices are known.

### 📚 Sources and licences

| Source | Publisher | Licence / terms |
|---|---|---|
| Portal BASE | IMPIC, open data on dados.gov.pt | Public domain |
| PLACSP | Ministerio de Hacienda | Spanish public-sector information reuse (Ley 37/2007) |

This Actor is not affiliated with or endorsed by these publishers.

### Contratos públicos: quem ganha / Adjudicaciones: quién gana

Quem ganha os contratos públicos em Portugal (Portal BASE), por quanto, com que desconto e contra quem. Quién gana los contratos públicos en España (PLACSP), por cuánto y con cuántas ofertas.

### 🔗 More official data from the same developer

- [European Fuel Prices](https://apify.com/yodeling_november/eu-fuel-prices): cheapest stations in 6 countries and averages for 29.
- [North America Fuel Prices](https://apify.com/yodeling_november/north-america-fuel-prices): Mexican stations plus US and Canada averages.
- [Public Tenders: Portugal, Spain & EU](https://apify.com/yodeling_november/public-tenders-pt-es-eu): a daily feed of new calls for tender.
- [New Companies & Insolvencies: Spain & France](https://apify.com/yodeling_november/company-events-spain-france): fresh leads and risk alerts from the official gazettes.
- [UK Companies House Search](https://apify.com/yodeling_november/uk-companies-house-search): new UK companies by SIC code and postcode.
- [EU Company Verification (KYB)](https://apify.com/yodeling_november/eu-company-verification): bulk checks in 5 official registries.
- [European Public Data MCP Server](https://apify.com/yodeling_november/public-data-mcp): all of this as tools for your AI agent.

# Actor input Schema

## `countries` (type: `array`):

Portugal: every contract in Portal BASE since 2012 (files refreshed weekly). Spain: award results from PLACSP and the regional platforms it aggregates; one run reads the last 1.5 to 3 days, so schedule daily runs in New mode for complete Spanish data.

## `publishedWithinDays` (type: `integer`):

How far back to look. For Portugal you can go back years (or use the dates below).

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

Optional (YYYY-MM-DD). Replaces 'Published within'.

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

Optional (YYYY-MM-DD).

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

Optional, e.g. 45 (construction), 72 (IT services), 33 (medical equipment).

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

Optional. Case and accents are ignored.

## `buyers` (type: `array`):

Optional. Buyer name or tax id (part of it), e.g. 'Câmara Municipal do Porto', '501306099'.

## `winners` (type: `array`):

Optional. Winner company name or tax id (part of it), e.g. 'Claranet', 'B61172219'.

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

Optional, partial match, e.g. 'Concurso público', 'Ajuste Direto', 'open'.

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

Optional.

## `minValue` (type: `integer`):

Optional.

## `maxValue` (type: `integer`):

Optional.

## `includeAwards` (type: `boolean`):

One row per contract (Portugal) or awarded lot (Spain).

## `summaries` (type: `array`):

Optional. By winner: awards, total value, average discount, main buyers. By buyer: spend, average bids, share of single-bid awards, main suppliers.

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

Newest first. 0 means no cap.

## `maxSummaryRows` (type: `integer`):

Largest first. 0 means no cap.

## `mode` (type: `string`):

New returns only awards not delivered before for the same Monitor ID (summaries always cover the whole window).

## `monitorId` (type: `string`):

Name for the saved state in New mode.

## Actor input object example

```json
{
  "countries": [
    "PT",
    "ES"
  ],
  "publishedWithinDays": 90,
  "cpvPrefixes": [
    "72"
  ],
  "includeAwards": true,
  "summaries": [
    "winner",
    "buyer"
  ],
  "maxResults": 100,
  "maxSummaryRows": 20,
  "mode": "snapshot",
  "monitorId": "default"
}
```

# Actor output Schema

## `awards` (type: `string`):

One row per contract or awarded lot.

## `winners` (type: `string`):

Totals by winning company.

## `buyers` (type: `string`):

Totals by contracting authority.

# 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 = {
    "publishedWithinDays": 90,
    "cpvPrefixes": [
        "72"
    ],
    "summaries": [
        "winner",
        "buyer"
    ],
    "maxResults": 100,
    "maxSummaryRows": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("yodeling_november/public-contract-awards-pt-es").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 = {
    "publishedWithinDays": 90,
    "cpvPrefixes": ["72"],
    "summaries": [
        "winner",
        "buyer",
    ],
    "maxResults": 100,
    "maxSummaryRows": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("yodeling_november/public-contract-awards-pt-es").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 '{
  "publishedWithinDays": 90,
  "cpvPrefixes": [
    "72"
  ],
  "summaries": [
    "winner",
    "buyer"
  ],
  "maxResults": 100,
  "maxSummaryRows": 20
}' |
apify call yodeling_november/public-contract-awards-pt-es --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yodeling_november/public-contract-awards-pt-es"
        }
    }
}
```

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/2RTpY3ZcD7n4798MX/builds/GctsJ7zwyAYRATOiV/openapi.json
