# Spain Public Tenders (PLACSP + regional platforms) (`danielefontana/spain-tenders`) Actor

Spanish public procurement from the Plataforma de Contratación del Sector Público and the regional platforms it aggregates (Catalonia, Andalusia, Madrid...): tenders, awards with winners and amounts. Filter by CPV, region, keywords. Normalized JSON.

- **URL**: https://apify.com/danielefontana/spain-tenders.md
- **Developed by:** [Daniele Fontana](https://apify.com/danielefontana) (community)
- **Categories:** Lead generation, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 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

## Spain Public Tenders (PLACSP + regional platforms)

Get Spanish public procurement from the **Plataforma de Contratación del Sector Público (PLACSP)**
and the **regional platforms it aggregates** (Catalonia, Andalusia, Madrid, Basque Country,
Galicia...) as clean, normalized JSON: calls for tenders, awards with winners and amounts, prior
information and cancellations. Filter by region, CPV, keywords, buyer, value and date.

PLACSP publishes everything as huge XML syndication files (up to 15 MB each, hundreds per month).
This Actor reads them for you and returns one tidy record per contract file (*expediente*).

- Official open-data syndication of the Spanish Ministry of Finance: no scraping, no browser.
- **Below and above the EU thresholds**: about 80 % of Spanish calls for tenders are below them and never reach TED.
- About **500 new calls for tenders per day**, plus awards with winner name, tax id (NIF) and amount.
- One record per contract file, in the same schema as our EU (TED), France, UK and Germany Actors.
- Pay per result: you only pay for the records actually saved.

***

### What you get

```json
{
  "source": "es-placsp",
  "source_id": "20906001",
  "id": "es-placsp:20906001",
  "title": "Mantenimiento de los sistemas de alimentación ininterrumpida (SAI) de la Universidad de Zaragoza en 2 lotes",
  "buyer_name": "Rectorado de la Universidad de Zaragoza",
  "buyer_id": "Q5018001G",
  "buyer_city": "Zaragoza",
  "region": "ES243",
  "country": "ESP",
  "cpv_codes": ["72253200"],
  "cpv_main": "72253200",
  "procedure_type": "simplified open",
  "contract_nature": "services",
  "notice_kind": "competition",
  "estimated_value": 19084.07,
  "currency": "EUR",
  "publication_date": "2026-11-13",
  "deadline": "2026-11-27",
  "status": "open",
  "url": "https://contrataciondelestado.es/wps/poc?uri=deeplink:detalle_licitacion&idEvl=3tQDF1FkNU3VGIpKDxgsAQ%3D%3D",
  "documents": [
    { "type": "administrative-specifications", "url": "https://contrataciondelestado.es/FileSystem/servlet/GetDocumentByIdServlet?...", "language": null },
    { "type": "technical-specifications", "url": "https://contrataciondelestado.es/FileSystem/servlet/GetDocumentByIdServlet?...", "language": null }
  ],
  "winner_name": null,
  "award_value": null,
  "extra": { "file_reference": "00153-2026", "folder_status": "PUB", "above_threshold": false, "budget_without_vat": 9471, "budget_with_vat": 11459.91, "lots": 2, "eu_funded": false }
}
```

#### Fields

| Field | Type | Description |
|---|---|---|
| `source`, `source_id`, `id` | string | `es-placsp`, the feed id of the contract file (`agg-` prefix for regional platforms) and `es-placsp:<id>`. |
| `title` | string | Subject of the contract. `description` is not published in the feeds and is always null. |
| `buyer_name`, `buyer_id`, `buyer_city` | string | Contracting body, its NIF (or DIR3 code) and city. Regional platforms often omit id and city. |
| `region` | string | NUTS code of the place of performance (`ES300` Madrid, `ES511` Barcelona...). |
| `cpv_codes`, `cpv_main` | string\[] / string | 8-digit CPV codes, including the lots'. |
| `procedure_type` | string | `open`, `simplified open`, `restricted`, `negotiated with/without publication`, `call-off from framework agreement`... (official code list). |
| `contract_nature` | `works` / `services` / `goods` / null | Supplies, services, works; concessions mapped to works or services. |
| `notice_kind` | `competition` / `result` / `planning` / `other` | From the file status: en plazo / pendiente de adjudicación, adjudicada / resuelta, anuncio previo, anulada. |
| `estimated_value`, `currency` | number / string | Estimated value of the contract (*valor estimado*, excl. VAT). Budget with and without VAT in `extra`. |
| `publication_date` | `YYYY-MM-DD` | Date of the latest notice of the file (call, award, formalization). |
| `deadline` | `YYYY-MM-DD` | Deadline for tenders (calls for tenders only). |
| `status` | `open` / `closed` / `awarded` / `cancelled` / `unknown` | `closed` = deadline passed, pending award. |
| `url` | string | Contract file page on PLACSP or on the regional platform. |
| `documents` | array | Administrative and technical specifications (pliegos), additional documents, award and formalization documents. |
| `winner_name`, `award_value` | string / number | Awards: winners (joined with `; `) and total awarded amount excl. VAT (sum of lots). Winner NIFs in `extra.winner_ids`. |
| `extra` | object | File reference, status, contract type, procedure code, above threshold, budgets, province, DIR3, parent organizations, platform, lots, offers received, EU funding (FEDER, PRTR...), TED notice id. |
| `raw` | object | The original feed entry, only when `includeRaw` is on. |

### Input

All inputs are optional. With no input you get the **calls for tenders published in the last 3 days** (about 1 500).

| Input | Description |
|---|---|
| `noticeKinds` | `competition` (default), `result`, `planning`, `other`. |
| `regions` | NUTS prefixes: `ES3` Madrid, `ES51` Cataluña, `ES52` Comunidad Valenciana, `ES61` Andalucía, `ES21` País Vasco... |
| `cpvCodes` | CPV codes or prefixes (`72` IT services, `45` construction, `90` cleaning...). |
| `keywords` | Phrases searched in the title; any may match. |
| `threshold` | `all` (default), `above`, `below` the EU thresholds. |
| `contractNatures` | `works`, `services`, `goods`. |
| `buyerNames` | Buyer or parent organization contains (`Ayuntamiento de Madrid`, `Servicio Andaluz de Salud`...). |
| `daysBack` / `dateFrom` / `dateTo` | Window (default 3 days). |
| `minValue` | Minimum estimated value in EUR. |
| `onlyOpen` | Keep only calls whose deadline has not passed. |
| `maxItems` | Stop after N records. |
| `sources` | `placsp`, `regional` (both by default). |
| `includeUpdates` | Also return files that changed without a new notice (bids opened, documents added). |
| `includeRaw` | Add the original entry. |

#### Example: open IT tenders in Madrid and Catalonia

```json
{ "regions": ["ES3", "ES51"], "cpvCodes": ["72", "48"], "onlyOpen": true, "daysBack": 7 }
```

#### Example: who won cleaning contracts this week, with tax ids

```json
{ "noticeKinds": ["result"], "cpvCodes": ["909"], "daysBack": 7 }
```

#### Example: municipal works below the EU thresholds in Andalusia

```json
{ "regions": ["ES61"], "contractNatures": ["works"], "threshold": "below", "buyerNames": ["Ayuntamiento"] }
```

### How to use the results

- **Download** as JSON, CSV or Excel from the run's Dataset tab, or call the dataset API.
- **Schedule** the Actor daily with `daysBack: 1` and connect it to Slack, email, Google Sheets,
  Make or Zapier with Apify integrations.
- **AI agents**: every Apify Actor is also available as an MCP tool.
- The same contract file comes back when its status changes (call → award): use `id` together
  with `extra.folder_status` to track it.

### Pricing and run cost

Pay per result: a fixed price per 1 000 records saved, shown on the Actor page. PLACSP serves
large files slowly: expect about 30–60 seconds per day of window (3 days ≈ 2 minutes). Nothing is
charged when no record matches.

### Data source, freshness and limits

- Sources: PLACSP syndication feeds *licitacionesPerfilesContratanteCompleto3* (authorities
  publishing on PLACSP) and *PlataformasAgregadasSinMenores* (regional platforms, minor contracts
  excluded), Ministerio de Hacienda. Updated continuously.
- Each feed entry is the latest state of a contract file. Within a run the newest state wins.
- The window applies to the date the file changed; by default only files with a notice published
  in the window are returned (`includeUpdates` adds the rest).
- Minor contracts (*contratos menores*) are not included.
- Texts are in Spanish or in the regional language used by the buyer (Catalan, Basque, Galician).

### Legal

PLACSP open data is published by the Ministerio de Hacienda for reuse with attribution
(Ley 37/2007 on the reuse of public sector information). Normalized fields contain no personal
contact details; the `raw` record contains whatever the buyer published.

***

### 🇪🇸 En español

Este Actor devuelve las **licitaciones y adjudicaciones de la Plataforma de Contratación del
Sector Público y de las plataformas autonómicas agregadas** en JSON normalizado: órgano de
contratación, NIF, objeto, CPV, valor estimado, plazo, pliegos, adjudicatarios e importes.
Incluye los contratos **por debajo de los umbrales europeos**, que no se publican en TED.

Sin parámetros obtienes las **licitaciones publicadas en los últimos 3 días**. Ejemplos:

- Licitaciones TIC abiertas en Madrid: `{"regions": ["ES3"], "cpvCodes": ["72"], "onlyOpen": true}`
- Adjudicaciones de la semana: `{"noticeKinds": ["result"], "daysBack": 7}`
- Obras municipales no armonizadas: `{"contractNatures": ["works"], "threshold": "below"}`

Pago por resultado (por cada 1.000 registros guardados); sin resultados no hay coste. Programa
una ejecución diaria y recibe las nuevas licitaciones por correo, Slack o Google Sheets.

### Support

Open an issue from the Actor's **Issues** tab. Please include the run id and the input used.

# Actor input Schema

## `noticeKinds` (type: `array`):

competition = calls for tenders (en plazo, and pendiente de adjudicación once the deadline has passed); result = awards (adjudicada, resuelta) with winners and amounts; planning = prior information (anuncio previo); other = cancellations (anulada).

## `regions` (type: `array`):

Prefixes of the NUTS code of the place of performance: ES3 Madrid, ES51 Cataluña, ES52 Comunidad Valenciana, ES61 Andalucía, ES21 País Vasco, ES11 Galicia, ES41 Castilla y León, ES24 Aragón... More digits narrow it down (ES511 = Barcelona). Empty = all of Spain.

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

Common Procurement Vocabulary codes. A prefix matches the whole division: 72 = IT services, 45 = construction, 90 = cleaning and environmental, 33 = medical, 79 = business services. Full codes like 72253000 are accepted too.

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

Words or phrases searched in the title (case and accent insensitive). Any keyword may match. Example: software, limpieza, "mantenimiento de ascensores".

## `threshold` (type: `string`):

above = harmonised procedures (also on TED); below = national procedures below the EU thresholds (not on TED).

## `contractNatures` (type: `array`):

Works (obras), services (servicios) or goods (suministros). Concessions are mapped to works or services. Empty = all.

## `buyerNames` (type: `array`):

Matches the contracting body and its parent organizations, e.g. "Ayuntamiento de Madrid", "Servicio Andaluz de Salud", "Generalitat".

## `daysBack` (type: `integer`):

Used when 'Published from' is empty. PLACSP pages are large: each day takes roughly 30–60 seconds to read.

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

Overrides 'daysBack'. Lower bound, inclusive.

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

Upper bound, inclusive. Empty = today.

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

Skips contract files whose estimated value (excluding VAT) is lower than this amount.

## `onlyOpen` (type: `boolean`):

Keep only calls for tenders whose deadline has not passed yet.

## `maxItems` (type: `integer`):

Stop after this many records. You are only charged for records actually written. Empty = no limit (subject to your Apify spending cap).

## `sources` (type: `array`):

placsp = authorities publishing on PLACSP (state administration, most municipalities and regions); regional = regional platforms aggregated by PLACSP (Catalonia, Andalusia, Madrid, Basque Country, Galicia...). Both by default.

## `includeUpdates` (type: `boolean`):

Also return contract files that changed in the window without a new notice (bids opened, documents added, corrections), with their latest state.

## `includeRaw` (type: `boolean`):

Adds the original feed entry (XML converted to JSON) under the `raw` field (much larger output).

## Actor input object example

```json
{
  "noticeKinds": [
    "competition"
  ],
  "regions": [],
  "cpvCodes": [],
  "keywords": [],
  "threshold": "all",
  "contractNatures": [],
  "buyerNames": [],
  "daysBack": 3,
  "onlyOpen": false,
  "sources": [
    "placsp",
    "regional"
  ],
  "includeUpdates": false,
  "includeRaw": false
}
```

# Actor output Schema

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

All tenders saved by the run (JSON; add ?format=csv or ?format=xlsx to download).

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

Counts of matched, filtered and saved records and the query used.

# 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 = {
    "noticeKinds": [
        "competition"
    ],
    "regions": [],
    "cpvCodes": [],
    "keywords": [],
    "daysBack": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("danielefontana/spain-tenders").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 = {
    "noticeKinds": ["competition"],
    "regions": [],
    "cpvCodes": [],
    "keywords": [],
    "daysBack": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("danielefontana/spain-tenders").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 '{
  "noticeKinds": [
    "competition"
  ],
  "regions": [],
  "cpvCodes": [],
  "keywords": [],
  "daysBack": 3
}' |
apify call danielefontana/spain-tenders --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,danielefontana/spain-tenders"
        }
    }
}
```

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/s1gk5q5hBqzaUOLk4/builds/H197AUbDv3Ww3XLqe/openapi.json
