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

Licitaciones abiertas de la Plataforma de Contratación (PLACSP), filtradas por CPV, zona, importe y plazo. JSON listo para alertas, n8n, Make o Zapier.

- **URL**: https://apify.com/blank_oystercatcher/licitaciones-espana.md
- **Developed by:** [Juan Sebastian Ag](https://apify.com/blank_oystercatcher) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 licitacións

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 (PLACSP)

Licitaciones de la [Plataforma de Contratación del Sector Público](https://contrataciondelsectorpublico.gob.es/) filtradas por CPV, zona (NUTS), importe, texto y estado. Salida en JSON lista para alertas, n8n, Make o Zapier.

### Fuente

Plataforma de Contratación del Sector Público, Ministerio de Hacienda.\
Datos abiertos (feed Atom/CODICE). Reutilización sujeta a la Ley 37/2007 y a las condiciones de [datos.gob.es](https://datos.gob.es/es/aviso-legal) / aviso legal del portal.\
Cada registro incluye `actualizado` y `fuente`.

### Qué hace

Lee el feed oficial y devuelve licitaciones filtradas por:

- **CPV** (prefijos, p. ej. `72` = informática, `90` = limpieza)
- **Zona NUTS** (p. ej. `ES52` = Comunidad Valenciana; vacío = toda España)
- **Importe** mínimo / máximo (sin IVA)
- **Solo abiertas** (estado PUB con plazo no vencido)
- **Texto** en título u órgano

Ideal para automatizar alertas o alimentar tu propio sistema, no solo para buscar a mano en el portal.

### Ejemplo de input

```json
{
  "cpv": ["72"],
  "soloAbiertas": true,
  "diasAtras": 1,
  "maxResultados": 50
}
```

### Campos de salida

`id`, `expediente`, `titulo`, `organo`, `nifOrgano`, `estado`, `estadoDescripcion`, `importeSinIva`, `importeConIva`, `cpv[]`, `nuts[]`, `lugar[]`, `plazoPresentacion`, `actualizado`, `url`, `fuente`

| Estado | Significado |
|--------|-------------|
| PUB | Publicada (abierta) |
| EV | En evaluación |
| ADJ | Adjudicada |
| RES | Resuelta |

### Precio

Pago por evento: **Licitación** (una por resultado) + **Actor Start**.\
Usa `diasAtras: 1` y un `maxResultados` razonable para controlar el coste.

### English

Open tenders from Spain’s official public procurement platform (PLACSP), filtered by CPV, NUTS region, amount and deadline. JSON ready for alerts and automation. Source: Ministerio de Hacienda open data; reuse subject to datos.gob.es terms (Law 37/2007).

# Actor input Schema

## `cpv` (type: `array`):

Qué se compra. Prefijos del código CPV: 72 = informática, 90 = limpieza/medio ambiente, 45 = obras. Vacío = todos.

## `nuts` (type: `array`):

Dónde. Ejemplos: ES523 = Valencia, ES52 = Comunidad Valenciana, ES30 = Madrid. Vacío = toda España.

## `texto` (type: `string`):

Opcional. Busca esta palabra en el título o en el órgano de contratación (sin distinguir tildes).

## `importeMin` (type: `integer`):

Importe estimado mínimo en euros sin IVA. Déjalo vacío para no filtrar por mínimo.

## `importeMax` (type: `integer`):

Importe estimado máximo en euros sin IVA. Déjalo vacío para no filtrar por máximo.

## `soloAbiertas` (type: `boolean`):

Solo licitaciones en estado PUB (publicada) cuyo plazo de presentación no ha vencido.

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

Busca entre las licitaciones publicadas o modificadas en los últimos N días. Usa 1 para pruebas baratas.

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

Número máximo de licitaciones a devolver en esta ejecución.

## `maxPaginas` (type: `integer`):

Tope de seguridad. Cada página trae unas 130 licitaciones.

## Actor input object example

```json
{
  "cpv": [
    "72"
  ],
  "soloAbiertas": true,
  "diasAtras": 1,
  "maxResultados": 100,
  "maxPaginas": 100
}
```

# Actor output Schema

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

Lista de licitaciones que cumplen los filtros (dataset por defecto).

# 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 = {
    "cpv": [
        "72"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("blank_oystercatcher/licitaciones-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 = { "cpv": ["72"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,blank_oystercatcher/licitaciones-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/jhfAelabyyh8fldFd/builds/Zzy0P2k86a5aakgd2/openapi.json
