# Spain Public Tenders & Awards (Contratación del Estado) (`corridordata/spain-public-tenders-contratacion`) Actor

Parse Spain's official Plataforma de Contratación del Sector Público (PLACSP) CODICE XML/Atom feeds into clean JSON/CSV: open tenders (licitaciones), budgets, CPV codes, buyer emails, deadlines, and winning awardees (NIF + price).

- **URL**: https://apify.com/corridordata/spain-public-tenders-contratacion.md
- **Developed by:** [Corridor Data](https://apify.com/corridordata) (community)
- **Categories:** Lead generation, Automation, Agents
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 parsed spanish tender / 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

## Spain Public Tenders & Contract Awards (*Plataforma de Contratación del Sector Público* — España)

Convierte los complejos ficheros XML/CODICE Atom de la **Plataforma de Contratación del Sector Público de España (`PLACSP` / `contrataciondelsectorpublico.gob.es`)** en **JSON / CSV / Excel limpio** en segundos—listo para **n8n, Make, Clay, alertas diarias de licitaciones y agentes de IA (MCP)**.

*(Clean JSON/CSV extractor for Spain's official Public Sector Procurement Portal — captures open tenders, minor contracts, CPV codes, tax-exclusive budgets, contracting authority emails/NIFs, pliego PDFs, and winning awardees with Spanish NIF & contract price).*

***

### Qué Extrae / Extracted Fields

- **Identificación y Estado:** `expediente`, `statusCode` (`PUB` en plazo, `EV` evaluación, `ADJ` / `RES` adjudicada), `contractType` (*Suministros, Servicios, Obras*), `title`.
- **Órgano de Contratación:** `contractingAuthority`, `authorityNif`, `authorityEmail`, `authorityPhone`, `location`, `nutsCode`.
- **Importes y Clasificación:** `budgetExclTaxEur` (sin IVA), `budgetInclTaxEur` (con IVA), `cpvCodes`, `submissionDeadline`.
- **Adjudicaciones (Inteligencia Competitiva B2B):** `awardWinnerName` (*empresa adjudicataria*), `awardWinnerNif` (*CIF/NIF del ganador*), `awardAmountExclTaxEur`, `awardDate`, `biddersCount`, `documents` (*Pliegos administrativos y técnicos*).

***

### Ejemplo de Salida JSON / Sample Output

```json
{
  "expediente": "CBA5129/2026",
  "statusCode": "RES",
  "statusLabel": "Resuelta / Formalizada (Awarded & Resolved)",
  "contractType": "Suministros (Supplies & Hardware)",
  "title": "Suministro De Ordenadores Ultraligeros Estándar Para Puestos De Trabajo Del Intef",
  "contractingAuthority": "Dirección General de Racionalización y Centralización de la Contratación",
  "authorityNif": "S2801213F",
  "authorityEmail": "secretaria.contratacioncentralizada@hacienda.gob.es",
  "authorityPhone": "915958100",
  "location": "Madrid",
  "nutsCode": "ES300",
  "cpvCodes": ["30213000"],
  "budgetExclTaxEur": 23865,
  "budgetInclTaxEur": 28876.65,
  "submissionDeadline": null,
  "awardWinnerName": "Eypscap, S.A.",
  "awardWinnerNif": "A28562908",
  "awardAmountExclTaxEur": 23865,
  "awardDate": "2026-11-17",
  "biddersCount": 1,
  "url": "https://contrataciondelestado.es/wps/poc?uri=deeplink:detalle_licitacion&idEvl=iGk0lgAxg8NJ8Trn0ZPzLw%3D%3D"
}
```

***

### API Quickstart (`curl` / `n8n`)

```bash
curl -X POST "https://api.apify.com/v2/acts/corridordata~spain-public-tenders-contratacion/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "maxItems": 50,
    "statusFilter": "open_only",
    "cpvPrefixes": ["72", "30"],
    "minBudgetEur": 15000
  }'
```

***

### Use with Claude Desktop, Cursor & AI Agents (Apify MCP Server)

This Actor is **MCP-native** and can be invoked autonomously by **Claude Desktop**, **Cursor**, **Windsurf**, **VS Code**, **OpenAI Agents SDK**, or **LangChain** using either the dedicated `@corridordata/mcp-server` package (tool: `search_spain_public_tenders`) or Apify's official `@apify/actors-mcp-server`.

#### Option A — Corridor Data B2B Suite (`@corridordata/mcp-server`)

```json
{
  "mcpServers": {
    "corridordata": {
      "command": "npx",
      "args": [
        "-y",
        "@corridordata/mcp-server",
        "--tools",
        "search_spain_public_tenders"
      ],
      "env": {
        "APIFY_TOKEN": "YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

#### Option B — Official Apify MCP Server (`@apify/actors-mcp-server`)

```json
{
  "mcpServers": {
    "corridordata-spain-public-tenders-contratacion": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "corridordata/spain-public-tenders-contratacion"
      ],
      "env": {
        "APIFY_TOKEN": "YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

**Example Agent Prompt:**

> *"Extrae las últimas licitaciones públicas abiertas de software y servicios TI (CPV 72) en España con presupuesto y enlace oficial."*

***

### Automate in `n8n`, `Make`, `Clay` & Python

#### 1. `n8n` HTTP Request Node (Synchronous JSON Dataset Output)

- **Method:** `POST`
- **URL:** `https://api.apify.com/v2/acts/corridordata~spain-public-tenders-contratacion/run-sync-get-dataset-items?format=json&clean=true`
- **Header:** `Authorization: Bearer YOUR_APIFY_TOKEN`
- **JSON Body:**

```json
{
  "maxItems": 30,
  "statusFilter": "open_only",
  "cpvPrefixes": [
    "72"
  ]
}
```

#### 2. Copy-Paste Importable `n8n` Workflow Snippet (`Cmd+V` / `Ctrl+V` onto Canvas)

Copy the JSON block below and paste it directly onto any `n8n` workflow canvas to create a scheduled trigger + pre-wired Apify node immediately:

```json
{
  "name": "Spain SME Radar: Licitaciones Públicas (PLACSP) + Subvenciones BOE / BORME",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * 1-5"
            }
          ]
        }
      },
      "id": "c0010001-0001-4000-8000-000000000001",
      "name": "Weekday Morning Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        240,
        320
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/acts/corridordata~spain-public-tenders-contratacion/run-sync-get-dataset-items?format=json&clean=true",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + ($env.APIFY_TOKEN || 'YOUR_APIFY_TOKEN') }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"maxItems\": 30,\n  \"statusFilter\": \"open_only\",\n  \"cpvPrefixes\": [\n    \"72\"\n  ]\n}",
        "options": {
          "timeout": 180000
        }
      },
      "id": "c0010001-0001-4000-8000-000000000002",
      "name": "Run corridordata/spain-public-tenders-contratacion",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        320
      ]
    }
  ],
  "connections": {
    "Weekday Morning Schedule": {
      "main": [
        [
          {
            "node": "Run corridordata/spain-public-tenders-contratacion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
```

#### 3. Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("corridordata/spain-public-tenders-contratacion").call(run_input={
  "maxItems": 30,
  "statusFilter": "open_only",
  "cpvPrefixes": [
    "72"
  ]
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

***

#### Referencia de Costes Laborales y Estructura Societaria para Licitadores

Al elaborar presupuestos de licitación pública en España (coste empresa de perfiles técnicos o comparativa fiscal entre Autónomo y Sociedad Limitada), consulta las referencias actualizadas en [Borderless Math España](https://borderlessmath.com/es) y la [Calculadora de Coste Empresa por Contratar en España](https://borderlessmath.com/es/calculadora-coste-empresa-contratar-empleado-espana).

***

### Frequently Asked Questions (FAQ)

- **Do I need residential proxies or external API keys?**\
  No. This Actor runs in an ultra-lightweight `128 MB` container using optimized public endpoints—zero proxy configuration or third-party subscriptions required.
- **How does Pay-Per-Event (`result-item`) billing work?**\
  You are only billed per validated record written to your output dataset (`result-item`), with automatic volume discounts on Apify `BRONZE`, `SILVER`, and `GOLD` plans. You can cap spend on any run using Apify's `maxTotalChargeUsd` setting.
- **Can I export results to CSV, Excel, Parquet, or Webhook?**\
  Yes—every run writes to a standard Apify Dataset supporting one-click export to **JSON, CSV, XLSX, XML, RSS**, or automatic webhook delivery to **Clay, HubSpot, Salesforce, Slack, Google Sheets, and n8n**.

# Actor input Schema

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

Maximum number of parsed Spanish public tender/award notices to return and charge via PPE.

## `feedType` (type: `string`):

Choose general contracting profiles (Perfiles del Contratante) or minor contracts (Contratos Menores).

## `statusFilter` (type: `string`):

Filter by CODICE status: all notices, open for bidding (PUB — Publicada / En plazo), or awarded/resolved (ADJ / RES — Adjudicada / Resuelta).

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

Optional Spanish/English keywords matched against contract title, contracting authority, or location (e.g. \["software", "ciberseguridad", "limpieza", "consultoría"]).

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

Optional CPV prefixes (e.g. \["72" for IT/Software services, "30" for Office/Computer hardware, "45" for Construction, "79" for Business consulting]).

## `region` (type: `string`):

Optional location substring filter (e.g. 'Madrid', 'Barcelona', 'Andalucía', 'Valencia').

## `minBudgetEur` (type: `number`):

Minimum tax-exclusive budget in EUR.

## Actor input object example

```json
{
  "maxItems": 25,
  "feedType": "licitaciones",
  "statusFilter": "all",
  "keywords": [],
  "cpvPrefixes": [],
  "region": "",
  "minBudgetEur": 0
}
```

# Actor output Schema

## `licitaciones` (type: `string`):

Parsed Spanish PLACSP tender & contract-award notices.

## `runSummary` (type: `string`):

Atom feed pages scanned and execution stats.

# 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 = {
    "maxItems": 25,
    "feedType": "licitaciones",
    "statusFilter": "all",
    "keywords": [],
    "cpvPrefixes": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("corridordata/spain-public-tenders-contratacion").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 = {
    "maxItems": 25,
    "feedType": "licitaciones",
    "statusFilter": "all",
    "keywords": [],
    "cpvPrefixes": [],
}

# Run the Actor and wait for it to finish
run = client.actor("corridordata/spain-public-tenders-contratacion").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 '{
  "maxItems": 25,
  "feedType": "licitaciones",
  "statusFilter": "all",
  "keywords": [],
  "cpvPrefixes": []
}' |
apify call corridordata/spain-public-tenders-contratacion --silent --output-dataset

```

## MCP server setup

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

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/a8j05hcggvujKPre9/builds/PbzB4lzKPeLEgdvTd/openapi.json
