# Spain Public Tenders & BOE Auctions Scraper (`super_vegetable/spain-tenders-auctions-boe-scraper`) Actor

Extracts official government procurement contracts, tenders, and judicial auctions from Spain (PLACSP & BOE) with budgets, deadlines, and direct bidding links.

- **URL**: https://apify.com/super_vegetable/spain-tenders-auctions-boe-scraper.md
- **Developed by:** [Albert](https://apify.com/super_vegetable) (community)
- **Categories:** Lead generation, Business, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 80.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 enriched boe auction (catastro €/m2) or public contracts

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 Procurement Tenders & BOE Auctions Scraper (v2.0 Deep Architecture)

Professional intelligence scraper for official Spanish government tenders, won public contracts (with winning company NIFs), and judicial / public auctions (with cadastral references, valuations, debts, and deposits) directly from the **Official State Gazette (Boletín Oficial del Estado - BOE)** and **subastas.boe.es**.

> \[!NOTE]
> **100% Real Data Guarantee (Zero Synthetic Fallbacks):** All records are extracted in real-time from official open government endpoints, including Section 4 (Judicial Auctions), Section 5A (Public Procurement), and Section 5B (Patrimonial Auctions: TGSS, AEAT, Adif, and Municipalities).

***

### 3 High-Value Business Use Cases

#### 1. Real Estate & Distressed Asset Investors (Subasteros & Fondos Inmobiliarios)

- **Live Spanish Cadastre API Enrichment (`ovc.catastro.meh.es`):** Automatically resolves 20-digit Cadastral References (`referencia_catastral`) against the official Cadastre to append built surface area (`catastro_superficie_construida_m2`), construction year (`catastro_ano_construccion`), primary use (`catastro_uso_principal`), and direct link (`url_sede_catastro`).
- **Automated Open Market Value & Discount Benchmark:** Cross-references cadastral surface area with official MITMA/INE benchmark values per province to calculate:
  - `valor_mercado_estimado_eur` (Estimated Open Market Price).
  - `descuento_vs_mercado_pct` (Discount % compared to open market).
  - `margen_bruto_potencial_eur` (Gross potential margin).
  - `roi_estimado_pct` (Estimated net ROI considering regional acquisition taxes).
- **Automated Cost of Acquisition Calculator:** Pre-computes regional property transfer tax (`itp_autonomico_pct` and `itp_estimado_eur`, e.g. 6% in Madrid vs 10% in Catalonia/Valencia), mandatory 5% bidding deposit (`deposito_obligatorio_5pct_eur`), and estimated notary/registry fees.
- **High-Equity Opportunity Filters:** Filter specifically for auctions with verified Cadastral References (`onlyWithCadastralRef: true`), minimum discount threshold (`minDiscountPct: 40`), and low debt-to-valuation ratios (`maxDebtToValuePct: 70`).
- **Court & Physical Details:** Managing judicial authority, contact email, phone, physical address, occupancy status (`situacion_posesoria`), and primary residence flags (`vivienda_habitual`).

#### 2. Public Contractors & Bidders (Licitadores y Proveedores del Estado)

- **Direct Pliegos Links (`url_pliegos`):** Direct URLs to download administrative and technical specifications without navigating complex state portals.
- **Criteria Breakdown:** Ponderation between price and qualitative technical criteria (e.g., `Precio: 75% | Extensión de garantía: 10%`).
- **CPV & Solvency Details:** Official CPV classifications and exact financial and technical solvency thresholds required.
- **Tight Deadlines:** Normalized `fecha_limite_ofertas` for automated alert triggers.

#### 3. B2B Sales Prospecting & Subcontracting (RGPD-Compliant Corporate NIFs)

- **Winning Company Corporate Name & Tax ID (`adjudicatario_nif`):** Instantly know who won every state, regional, or municipal contract (including multi-lot awards).
- **Built-in RGPD / LOPD Compliance (`maskPersonalNif`):** Automatically classifies winners into `PERSONA_JURIDICA_EMPRESA` (Corporate CIFs: S.L., S.A., UTE) vs `PERSONA_FISICA_AUTONOMO` and masks personal DNIs/NIEs by default.
- **Subcontractor & Supplier Prospecting:** Reach out to winning corporate contractors with specialized supply, machinery, surety bonds (*avales*), and staffing services the moment they win.

***

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `recordTypes` | `Array<String>` | `["TENDERS", "AWARDS", "AUCTIONS"]` | Select one or more record types to extract. |
| `dateFrom` | `String` | `null` | Start date (`YYYY-MM-DD`). Defaults to the latest available BOE publication issue. |
| `dateTo` | `String` | `null` | Optional end date (`YYYY-MM-DD`) for historical range extraction. |
| `provinces` | `Array<String>` | `[]` | Filter by province or autonomous community (e.g. `Madrid`, `Barcelona`, `Valencia`, `Sevilla`, `Asturias`, `Cadiz`). Accent-insensitive. |
| `searchKeywords` | `Array<String>` | `[]` | Free-text keywords or CPV codes (e.g. `software`, `ciberseguridad`, `vivienda`, `72000000`). If empty (`[]`), returns all records. |
| `minAmountEur` | `Integer` | `0` | Minimum contract budget or auction valuation in Euros (€). |
| `maxAmountEur` | `Integer` | `0` | Maximum contract budget or auction valuation in Euros (€) (0 for unlimited). |
| `maxResults` | `Integer` | `50` | Maximum number of records to return. Scraper terminates immediately upon reaching this limit. |

***

### Example Output Records

#### 1. Judicial Real Estate Auction (`AUCTION`)

```json
{
  "record_type": "AUCTION",
  "tender_id": "SUB-JA-2026-267446",
  "subasta_id": "SUB-JA-2026-267446",
  "boe_id": "BOE-B-2026-34803",
  "publication_date": "2026-10-26",
  "category": "SUBASTA_JUDICIAL",
  "status": "SUBASTA_ACTIVA",
  "title": "Subasta Judicial Inmobiliaria en AVILES: FINCA REGISTRAL Nº 5547, INSCRITA EN EL REGISTRO DE LA PROPIEDAD Nº2 DE AVILÉS",
  "amount_eur": 73404.93,
  "valor_subasta_eur": 73404.93,
  "tasacion_eur": 0.0,
  "deuda_reclamada_eur": 82946.52,
  "deposito_eur": 3670.25,
  "ratio_deuda_valor_pct": 113.0,
  "referencia_catastral": "4361001TP6246S0014PX",
  "direccion": "C/ COVADONGA, Nº2, 6º, DERECHA",
  "codigo_postal": "33402",
  "localidad": "AVILES",
  "provincia": "Asturias",
  "vivienda_habitual": "No",
  "situacion_posesoria": "No consta",
  "contracting_body": "Sección Civil e Instruc TI Avilés. Plz.n 3",
  "autoridad_gestora": "Sección Civil e Instruc TI Avilés. Plz.n 3",
  "email_organo": "scejaviles.hipotecarios@asturias.org",
  "telefono_organo": "985127821",
  "url": "https://subastas.boe.es/detalleSubasta.php?idSub=SUB-JA-2026-267446"
}
```

#### 2. Open Public Procurement Tender (`TENDER`)

```json
{
  "record_type": "TENDER",
  "tender_id": "BOE-B-2026-34880",
  "boe_id": "BOE-B-2026-34880",
  "publication_date": "2026-10-26",
  "category": "SUMINISTROS",
  "status": "PLAZO_ABIERTO",
  "title": "Anuncio de licitación de: Jefatura de la Sección de Asuntos Económicos de la Unidad Militar de Emergencias. Objeto: Adquisición de siete (7) máquinas automotrices teleoperadas de intervención para la UME.",
  "contracting_body": "Jefatura de la Sección de Asuntos Económicos de la Unidad Militar de Emergencias",
  "nif_organo": "S2800475B",
  "localidad": "Torrejón de Ardoz, Madrid",
  "provincia": "Madrid",
  "materias_cpv": "42000000 Maquinaria industrial",
  "amount_eur": 1735531.0,
  "valor_estimado_eur": 1735531.0,
  "criterios_adjudicacion": "18.1) Ampliación de garantía (40%) | 18.2) Precio (60%)",
  "fecha_limite_ofertas": "Hasta las 18:59 horas del 19 de noviembre de 2026",
  "url_pliegos": "https://contrataciondelestado.es/wps/poc?uri=deeplink:detalle_licitacion&idEvl=tO3LdF7oHwU2wEhQbcAqug%3D%3D"
}
```

#### 3. Contract Award & Winner Intelligence (`AWARD`)

```json
{
  "record_type": "AWARD",
  "tender_id": "BOE-B-2026-34859",
  "boe_id": "BOE-B-2026-34859",
  "publication_date": "2026-10-26",
  "category": "SUMINISTROS",
  "status": "ADJUDICADO",
  "title": "Anuncio de formalización de contratos de: Junta de Contratación de la Secretaría de Estado de Justicia. Objeto: Suministro de consumibles para el equipo Hamilton.",
  "contracting_body": "Junta de Contratación de la Secretaría de Estado de Justicia",
  "nif_organo": "S2813610I",
  "amount_eur": 86607.4,
  "importe_adjudicacion_eur": 86607.4,
  "adjudicatario_nombre": "HAMILTON IBERIA S.L.U",
  "adjudicatario_nif": "B66809013",
  "adjudicatario_localidad": "hospitalet del llobregat",
  "es_pyme": true,
  "num_ofertas_recibidas": 2,
  "url": "https://www.boe.es/buscar/doc.php?id=BOE-B-2026-34859"
}
```

***

### Integration & Automation

You can connect this Actor directly to:

- **Telegram / Discord Bots:** Receive real-time push alerts when high-value tenders or auctions appear in your target provinces.
- **Make / Zapier / n8n:** Sync winning companies directly into HubSpot, Salesforce, or Google Sheets for immediate B2B sales outreach.
- **Webhook endpoints:** Feed internal CRM pipelines via the live Apify dataset API.

# Actor input Schema

## `recordTypes` (type: `array`):

Select the types of records to extract: TENDERS (open procurement bids), AWARDS (won contracts with winning company NIF and amounts), AUCTIONS (judicial and public property auctions).

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

Start date for BOE issues. If omitted, automatically defaults to the latest published BOE date.

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

End date for scraping date ranges. If omitted, only dateFrom or latest BOE is scraped.

## `provinces` (type: `array`):

Filter records by Spanish province or autonomous community (e.g. Madrid, Barcelona, Valencia, Sevilla, Asturias, Cadiz). Case and accent insensitive.

## `searchKeywords` (type: `array`):

Keywords or CPV codes to filter (e.g. software, ciberseguridad, limpieza, obras, vivienda, 72000000). Leave empty to fetch all published records.

## `minAmountEur` (type: `integer`):

Filter records with contract budget or auction valuation greater than or equal to this amount in EUR.

## `maxAmountEur` (type: `integer`):

Filter records with contract budget or auction valuation less than or equal to this amount in EUR (0 for unlimited).

## `enrichWithCatastro` (type: `boolean`):

Automatically cross-queries Spain's official Sede Electrónica del Catastro API for every 20-digit cadastral reference to extract built surface area (m²), construction year, primary use, and compute €/m² valuation and debt metrics.

## `onlyWithCadastralRef` (type: `boolean`):

When scraping AUCTIONS, only return properties that include a valid 20-character Cadastral Reference.

## `maxDebtToValuePct` (type: `integer`):

Filter distressed property auctions where claimed debt is at most X% of the auction valuation (e.g. set to 70 for high-equity opportunities). Leave 0 for all.

## `minDiscountPct` (type: `integer`):

Filter real estate auctions offering at least X% discount compared to the official average market price per m² in the province (e.g. set to 30 for 30%+ below-market bargains).

## `maskPersonalNif` (type: `boolean`):

Automatically classifies Spanish Tax IDs into Corporate CIFs (Personas Jurídicas: S.L., S.A.) vs Natural Persons (Autónomos/Particulares) and masks personal DNIs/NIEs for GDPR compliance.

## `webhookUrl` (type: `string`):

Optional HTTP POST Webhook URL to receive instant JSON alert notifications whenever matching auctions, tenders, or awards are found.

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

Maximum number of records to return. Scraper stops immediately when reached.

## Actor input object example

```json
{
  "recordTypes": [
    "TENDERS",
    "AWARDS",
    "AUCTIONS"
  ],
  "provinces": [],
  "searchKeywords": [],
  "minAmountEur": 0,
  "maxAmountEur": 0,
  "enrichWithCatastro": true,
  "onlyWithCadastralRef": false,
  "maxDebtToValuePct": 0,
  "minDiscountPct": 0,
  "maskPersonalNif": true,
  "maxResults": 50
}
```

# Actor output Schema

## `overview` (type: `string`):

Unified table view of tenders, awards, and auctions

## `auctions` (type: `string`):

Real estate judicial and public auctions with valuation, debt ratio, and 20-char cadastral refs

## `tenders` (type: `string`):

Active public procurement tenders with budgets, CPV codes, criteria, and direct links to bidding specifications

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

B2B intelligence view with winning corporate names, Tax IDs (NIF), awarded amounts, and competitor counts

## `rawJson` (type: `string`):

Direct JSON endpoint ready for Telegram bots, Make, Zapier, and webhook automations

# 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("super_vegetable/spain-tenders-auctions-boe-scraper").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("super_vegetable/spain-tenders-auctions-boe-scraper").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 super_vegetable/spain-tenders-auctions-boe-scraper --silent --output-dataset

```

## MCP server setup

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

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/x8nea0j2BBJDPzEpc/builds/XnFtJZBe1odwZT5XC/openapi.json
