# Licitaciones públicas de España (PLACSP) (`datospublicos/licitaciones-publicas-espana`) Actor

Licitaciones del sector público español filtradas por CPV, importe, provincia de ejecución y palabra clave. Datos oficiales del Ministerio de Hacienda, salida limpia en tabla.

- **URL**: https://apify.com/datospublicos/licitaciones-publicas-espana.md
- **Developed by:** [Jaime Pérez Alarcón](https://apify.com/datospublicos) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 licitación extraídas

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

## Licitaciones públicas de España — datos limpios y filtrados

**Deja de pelearte con ficheros XML de 250 páginas de especificación.**

El Estado publica todas las licitaciones públicas gratis, pero en formato CODICE 2.07:
XML anidado, en ficheros encadenados de 500 entradas, con los campos enterrados bajo
cuatro niveles de etiquetas. El propio Ministerio de Hacienda tuvo que publicar una
aplicación de escritorio en Java para que la gente pudiera pasarlo a Excel.

Este Actor hace eso por ti, filtrado y en un solo paso.

### Para quién es

- **Empresas que se presentan a concursos** — solo las licitaciones de tu sector, tu provincia y tu rango de importe.
- **Despachos y asesorías** — vigila los expedientes de un órgano de contratación concreto.
- **Analistas y periodistas de datos** — contratación pública en tabla plana, lista para analizar.

### Filtra por el lugar de ejecución, no por la sede

Esto es lo que casi nadie hace bien. Cada licitación trae **dos** direcciones: dónde está
el organismo y dónde se ejecuta el contrato. En el feed real, **el 66% de las licitaciones
se ejecutan en una provincia distinta de la del organismo que las convoca**.

Una obra en Alicante gestionada desde Valencia aparece, en la mayoría de herramientas,
bajo "Valencia". Aquí aparece bajo Alicante, que es donde vas a trabajar.

Además se traducen los códigos NUTS (`ES611` → Almería) y las provincias bilingües
funcionan en los dos idiomas: "alicante" y "alacant" encuentran lo mismo.

### Qué obtienes

```json
{
  "expediente": "1705/2026",
  "titulo": "Ejecución de cubierta para pista de Pádel",
  "organo_contratacion": "Alcaldía del Ayuntamiento de Calera y Chozas",
  "nif_organo": "P4502800H",
  "estado": "PUB",
  "importe_sin_iva": 121525.9,
  "importe_total": 147046.34,
  "valor_estimado": 121525.9,
  "cpv": ["45212200"],
  "provincia": "Toledo",
  "ciudad_ejecucion": "Calera y Chozas",
  "fecha_limite": "2026-10-07",
  "url": "https://contrataciondelestado.es/..."
}
```

Exportable a JSON, CSV, Excel o XML desde la interfaz de Apify, o por API.

### Filtros

| Filtro | Qué hace |
|---|---|
| Palabras clave | Busca en título y órgano de contratación |
| Códigos CPV | Por prefijo: `45` construcción, `72` servicios TI, `71` ingeniería |
| Importe mínimo / máximo | Sobre el importe sin IVA |
| Provincia de ejecución | Coincidencia parcial, bilingüe |
| Estado | En plazo, adjudicada, resuelta, anulada |
| Días hacia atrás | Ventana temporal |

### Retraso de publicación (importante)

La Plataforma de Contratación publica su feed con **3 o 4 días de retraso**. No es cosa
de este Actor: el Ministerio actualiza así. Por eso el valor por defecto de `diasAtras`
es 10 y no 1.

Si pones una ventana demasiado corta recibirás cero resultados. El Actor te avisa en el
log cuando eso ocurre.

### Uso típico: alerta semanal

Programa el Actor los lunes a las 7:00 con `diasAtras: 10` y tus filtros. Cada semana
tendrás las licitaciones nuevas de tu sector sin abrir un solo XML.

### Conjuntos disponibles

Licitaciones de perfiles del contratante · Contratos menores · Plataformas autonómicas agregadas

### Fuente

Datos abiertos oficiales de la Plataforma de Contratación del Sector Público
(Ministerio de Hacienda). Reutilización permitida con fines comerciales, citando la
fuente y sin alterar el contenido. Este Actor no modifica los datos: los normaliza y filtra.

# Actor input Schema

## `feed` (type: `string`):

Qué publicaciones recoger.

## `diasAtras` (type: `integer`):

Ventana temporal. Usa 1 para una alerta diaria, 7 para el resumen semanal.

## `palabrasClave` (type: `array`):

Busca en el título y en el órgano de contratación. Basta con que aparezca una. Vacío = todas.

## `codigosCPV` (type: `array`):

Prefijos. 45 = construcción, 72 = servicios TI, 71 = ingeniería, 79 = servicios empresariales.

## `importeMinimo` (type: `integer`):

Sin IVA. Vacío = sin mínimo.

## `importeMaximo` (type: `integer`):

Sin IVA. Vacío = sin máximo.

## `provincias` (type: `array`):

Filtra por dónde se ejecuta el contrato, NO por la sede del organismo. Coincidencia parcial: 'alicante' y 'alacant' encuentran lo mismo. Vacío = toda España.

## `estados` (type: `array`):

Vacío = todos.

## `maxResultados` (type: `integer`):

Tope de coste por ejecución.

## Actor input object example

```json
{
  "feed": "licitaciones",
  "diasAtras": 30,
  "maxResultados": 100
}
```

# Actor output Schema

## `dataset` (type: `string`):

Una fila por licitación, con expediente, órgano, importe, CPV, provincia de ejecución y fecha límite.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("datospublicos/licitaciones-publicas-espana").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("datospublicos/licitaciones-publicas-espana").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 '{}' |
apify call datospublicos/licitaciones-publicas-espana --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datospublicos/licitaciones-publicas-espana"
        }
    }
}
```

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/erdcLaMMDdV6zew6d/builds/LgNyFN7Td75WKiC5I/openapi.json
