# Spain Construction Leads — Licencias de Obra & Obras Públicas (`icarodata/spain-construction-leads`) Actor

Construction leads in Spain from official open data: Madrid building licences, Barcelona public-space works with contractor and budget, and PLACSP public works tenders and awards (CPV 45). Filter by city, type, budget and date. Schedule weekly with Only-new and pay only for new leads. $5 per 1,000.

- **URL**: https://apify.com/icarodata/spain-construction-leads.md
- **Developed by:** [Icaro Data](https://apify.com/icarodata) (community)
- **Categories:** Lead generation, Real estate
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 66.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 construction leads

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 Construction Leads — Licencias de Obra & Obras Públicas

**Spain Construction Leads** turns official Spanish open data into **construction sales leads**: **building licences granted in Madrid**, **works in progress on Barcelona's public space (with contractor and budget)** and **public works tenders and awards from PLACSP for all of Spain (CPV 45)**. Filter by **city, district, works type, budget and date**, schedule it weekly with **Only new since last run**, and send fresh leads to Google Sheets, your CRM or email. No login, no API key.

- ✅ **4 lead types**: building licence granted · public-space works in progress · public works tender (open for bids) · public works contract awarded (winning contractor + CIF)
- ✅ **Official sources only**: Ayuntamiento de Madrid (CC BY 4.0), Ajuntament de Barcelona (CC BY 4.0), Plataforma de Contratación del Sector Público
- ✅ **Who, what, where, how much**: address/district, works type, budget, dates, promoter and contractor **companies**
- ✅ **Normalised works categories** (residential works, first occupancy, commercial premises, urbanisation, utilities, sewerage, paving, transport infrastructure, building…)
- ✅ **Only new since last run** — weekly alerts without repeats, and you never pay twice for a lead
- ✅ **Privacy-first**: only companies and public bodies are named (see *Personal data*)
- ✅ **$5 per 1,000 leads** — **200 leads = $1.00**

### Who uses it?

| Use case | Who |
| --- | --- |
| Find **renovation and new-build projects** right after the licence is granted | Installers (HVAC, solar, lifts, windows, kitchens), interior fit-out, scaffolding, waste containers |
| Sell to the **contractors already on site** | Building-material distributors, machinery and crane rental, safety & PPE suppliers, subcontractors |
| **Bid on public works** or partner with winners | Construction companies, engineering firms, UTE partners |
| **Market intelligence**: who is building what, where, for how much | Developers, analysts, investors, construction SaaS |
| **Local prospecting** by district | Real-estate agencies, architects, facility managers |

### How to get construction leads in 4 steps

1. Click **Try for free**.
2. Choose **municipalities** (`Madrid`, `Barcelona`, `Sevilla`, `Málaga`…) and/or **provinces**, and the **lead types** you want.
3. Optionally pick **works types**, **keywords** (`fachada`, `cubierta`, `rehabilitación`, `ascensor`), a **minimum budget** or **Only leads with a named contractor**.
4. Click **Start**, export JSON/CSV/Excel or connect an integration. For alerts, **schedule** it weekly with **Only new since last run**.

#### Input example

```json
{
  "municipalities": ["Madrid", "Barcelona"],
  "leadTypes": ["building_licence", "public_space_works", "public_works_award"],
  "worksTypes": [],
  "minBudget": null,
  "daysBack": 31,
  "maxItems": 500,
  "onlyNewSinceLastRun": true
}
```

#### Output examples

**Building licence (Madrid)**

```json
{
  "leadId": "madrid:350/2025/34758",
  "leadType": "building_licence",
  "worksType": "residential_works",
  "worksTypeOriginal": "Licencia urbanística residencial",
  "status": "granted",
  "municipality": "Madrid",
  "address": "Calle Puerto Rico, 6",
  "zoning": "NZ 3.1",
  "applicantType": "company",
  "leadDate": "2026-10-30",
  "applicationDate": "2025-11-06",
  "sourceUrl": "https://datos.madrid.es/dataset/640505-0-licencias-urbanisticas-otorgadas",
  "attribution": "Ayuntamiento de Madrid — datos.madrid.es (CC BY 4.0)"
}
```

**Public-space works with contractor and budget (Barcelona)**

```json
{
  "leadId": "bcn:06-2026G0048",
  "leadType": "public_space_works",
  "worksType": "urbanisation",
  "title": "Urbanització — Pau Alsina / c. Bailen",
  "status": "in_progress",
  "municipality": "Barcelona",
  "district": "Gràcia",
  "neighbourhood": "el Camp d'en Grassot i Gràcia Nova",
  "address": "Pau Alsina / c. Bailen",
  "startDate": "2026-11-16",
  "endDate": "2027-05-14",
  "budget": 1052578.2,
  "budgetType": "awarded",
  "promoterCompany": "BIMSA",
  "contractorCompany": "OBRES I PROJECTES CATALUNYA SL",
  "attribution": "Ajuntament de Barcelona — Open Data BCN (CC BY 4.0)"
}
```

**Public works tender (PLACSP)**

```json
{
  "leadId": "placsp:public_works_tender:1662576J::P0208100H",
  "leadType": "public_works_tender",
  "title": "Obras de renovación de la EBAR y aliviado de tormentas en la calle Alfonso XIII de Villarrobledo, cofinanciado en un 85% por la Unión Europea a través del Fondo FEDER en el marco del Plan EDIL.",
  "municipality": "Villarrobledo",
  "province": "Albacete",
  "contractingAuthority": "Junta de Gobierno del Ayuntamiento de Villarrobledo",
  "budget": 313537.19,
  "deadline": "2026-12-09",
  "cpvCodes": [
    "45232450"
  ],
  "leadDate": "2026-11-17",
  "sourceUrl": "https://contrataciondelestado.es/wps/poc?uri=deeplink:detalle_licitacion&idEvl=QAbze3X1B3lrhBlEHQFSKA%3D%3D"
}
```

**Public works award — winning contractor (PLACSP)**

```json
{
  "leadId": "placsp:public_works_award:2026011::P4612900C",
  "leadType": "public_works_award",
  "title": "Cubrición de graderío",
  "municipality": "La Font d'En Carròs",
  "province": "Valencia/València",
  "contractingAuthority": "Alcaldía del Ayuntamiento de La Font d'En Carròs",
  "budget": 132404.33,
  "budgetType": "awarded",
  "contractorCompany": "OBRESA EDIFICACION Y OBRA CIVIL S.L.",
  "contractorTaxId": "B98478951",
  "leadDate": "2026-11-02",
  "sourceUrl": "https://contrataciondelestado.es/wps/poc?uri=deeplink:detalle_licitacion&idEvl=pQHBa7sALoXs%2BnLj3vAg5A%3D%3D"
}
```

All leads share the same fields (`description`, `neighbourhood`, `heritageProtection`, `managingBody`, `addressPrecision`, `currency`, `redactedNames`, `datasetUrl`, `licence`, `licenceUrl`, `scrapedAt`…), so you can load them into one sheet or table.

### Sources and coverage

| Source | Lead type | Coverage | Update | Licence |
| --- | --- | --- | --- | --- |
| [Madrid — Licencias urbanísticas otorgadas](https://datos.madrid.es/dataset/640505-0-licencias-urbanisticas-otorgadas) | `building_licence` | City of Madrid, ~300–450 licences/month | Monthly | CC BY 4.0 |
| [Barcelona — Obres a l'espai públic](https://opendata-ajuntament.barcelona.cat/data/es/dataset/obres) | `public_space_works` | City of Barcelona, ~2,000 works (≈300 in progress), budget & contractor when published | Continuous | CC BY 4.0 |
| [PLACSP — Plataforma de Contratación del Sector Público](https://contrataciondelsectorpublico.gob.es) | `public_works_tender`, `public_works_award` | All Spain (state, regional and local buyers, incl. aggregated regional platforms) | Several times a day | Reuse under Ley 37/2007 |

More cities will be added as they publish licence data under an open licence. Want yours? Open an issue.

### Filters

| Input | What it does |
| --- | --- |
| `sources`, `leadTypes`, `worksTypes` | Choose datasets, lead types and normalised works categories |
| `municipalities`, `provinces`, `districts` | Location (PLACSP municipality is inferred from the buyer when not published) |
| `keywords`, `excludeKeywords` | Text match on title, description, address and company names |
| `minBudget`, `maxBudget`, `keepLeadsWithoutBudget` | Budget in EUR (excl. VAT where published) |
| `daysBack`, `sinceDate`, `untilDate` | Lead date window (licence granted, works start, tender published, contract awarded) |
| `statuses`, `applicantTypes`, `withContractorOnly` | Status, Madrid applicant type, only leads with a named contractor |
| `maxPlacspPages`, `maxItems`, `maxRunTimeSecs`, `onlyNewSinceLastRun` | Depth of the PLACSP scan, volume cap, time budget (default 180 s; the run stops and keeps what it found), incremental mode |

### Pricing — pay per lead

**$0.005 per lead saved ($5.00 per 1,000)** plus Apify's tiny actor-start event. Filtered-out, duplicate and already-delivered leads are **free**.

| Scenario | Leads | Cost |
| --- | --- | --- |
| New Madrid residential licences each month | ~250 | **~$1.25 / month** |
| Barcelona works in progress with contractor, weekly | ~40/week | **~$0.80 / month** |
| Public works awards in your province, weekly | ~30/week | **~$0.60 / month** |
| Full monthly feed (all sources, all Spain works) | ~3,000 | **~$15 / month** |

Comparable Spanish construction-lead subscriptions cost **€69–€99+ per month**.

### Integrations

- **Google Sheets**: Apify → *Integrations* → Google Sheets, append each run.
- **Make, Zapier, n8n**: "Watch actor runs" → "Get dataset items" → HubSpot, Pipedrive, Salesforce, Airtable, Slack or email.
- **API**: `POST https://api.apify.com/v2/acts/icarodata~spain-construction-leads/run-sync-get-dataset-items?token=YOUR_TOKEN` with the input JSON.
- **Python / JavaScript**: `apify-client` → `client.actor("icarodata/spain-construction-leads").call(run_input=...)`.

### Featured use: schedule daily or weekly with “only new”

The cheapest, most reliable way to use this Actor is a **weekly (or daily) schedule** with **Only new since last run** enabled. Each run returns — and bills — only leads you have not received before. Already-seen leads are free.

1. Open this Actor in Apify Console and click **Save as Task** with your filters.
2. Set **Only new since last run** to `true` and `daysBack` to `31` (Madrid licences are published monthly).
3. Create a **Schedule** (for example every Monday at 08:00 Europe/Madrid, or every weekday if you also follow public works).
4. Add an integration (email, Slack, Google Sheets, CRM via Make/Zapier/n8n, or a webhook).

Example input:

```json
{
  "municipalities": ["Madrid", "Barcelona"],
  "leadTypes": ["building_licence", "public_space_works", "public_works_award"],
  "daysBack": 31,
  "maxItems": 500,
  "onlyNewSinceLastRun": true
}
```

State is kept per filter set in the named key-value store `spain-construction-leads-state`, so it survives between runs.

### Personal data

- **Madrid** does not publish applicant names. When the applicant is a **private individual**, this Actor also **drops the street number** (`addressPrecision: "street"`), so the lead is street-level only.
- **Barcelona** promoters/contractors and **PLACSP** winners are returned only when they are **companies or public bodies**. Names that look like private individuals (and personal NIF/NIE numbers) are withheld and counted in `redactedNames`.
- No phone numbers or emails are collected. Use the leads in line with GDPR/LOPDGDD and LSSI when contacting companies.

### FAQ

**Can I use this data commercially?** Yes. Madrid and Barcelona publish under **CC BY 4.0** and PLACSP under the Spanish public-sector reuse rules (Ley 37/2007). Keep the `attribution` field when you redistribute the data.

**Why do Madrid licences have no budget?** Madrid does not publish it in this dataset. If you set `minBudget`, Madrid leads are dropped unless `keepLeadsWithoutBudget` is on.

**Why is a PLACSP lead's municipality empty?** Some notices only give the province or NUTS code. The Actor infers the municipality from the buyer ("Ayuntamiento de …") when possible.

**How far back does PLACSP go?** The official feeds are read newest-first; `maxPlacspPages` (default 5 per feed) covers roughly the last 1–2 days. For back-fills raise it together with `maxRunTimeSecs` (e.g. 40 pages and 1800 s). If the official PLACSP feed is slow or temporarily blocks requests, the run still succeeds with the Madrid/Barcelona leads and logs a warning.

**What if PLACSP is temporarily unavailable?** The PLACSP portal's firewall sometimes throttles automated reads for a while. When that happens the run logs a warning, still delivers the Madrid and Barcelona leads, and you are only charged for leads actually delivered. With `onlyNewSinceLastRun` on, the next scheduled run picks up the PLACSP notices it missed.

**Is this the same as a building-permit scraper?** Yes, for Spain: it is the Spanish equivalent of US building-permit lead tools, built only on official open data.

### Licence and attribution

Data: Ayuntamiento de Madrid — [datos.madrid.es](https://datos.madrid.es) (CC BY 4.0); Ajuntament de Barcelona — [Open Data BCN](https://opendata-ajuntament.barcelona.cat) (CC BY 4.0); *Origen de los datos: Plataforma de Contratación del Sector Público (Ministerio de Hacienda)*. Not affiliated with or endorsed by these administrations.

***

### 🇪🇸 En español

**Spain Construction Leads** convierte datos abiertos oficiales en **oportunidades comerciales del sector de la construcción**:

- **Licencias urbanísticas concedidas en Madrid** (obras residenciales, locales, primera ocupación…), con dirección, norma zonal y tipo de solicitante.
- **Obras en el espacio público de Barcelona** en ejecución, con **presupuesto, promotor y empresa constructora**.
- **Licitaciones y adjudicaciones de obras públicas de toda España** (PLACSP, CPV 45), con **empresa adjudicataria y CIF**.

**Para quién:** instaladores (climatización, fotovoltaica, ascensores, carpintería), distribuidores de materiales, alquiler de maquinaria y grúas, subcontratas, constructoras que licitan, ingenierías y analistas.

**Cómo usarlo:** indica los **municipios** (Madrid, Barcelona, Sevilla…), los **tipos de lead**, palabras clave como `fachada`, `cubierta` o `rehabilitación` y, si quieres, un **presupuesto mínimo**. Prográmalo cada semana con **Solo nuevos desde la última ejecución** y recibe solo lo nuevo en Google Sheets, tu CRM o el email (Make, Zapier, n8n o API).

**Precio:** **0,005 $ por lead (5 $ por cada 1.000)**. Lo filtrado, duplicado o ya entregado no se cobra. Ejemplo: 200 leads = 1 $.

**Datos personales:** solo se nombran empresas y organismos. Si el solicitante de una licencia de Madrid es un particular, se elimina el número de la calle. Los nombres que parecen de personas físicas y los NIF/NIE personales se omiten.

**Licencia:** Ayuntamiento de Madrid y Ajuntament de Barcelona (CC BY 4.0); *Origen de los datos: Plataforma de Contratación del Sector Público (Ministerio de Hacienda)*.

### Related Actors by Icaro Data

- [Licitaciones España (PLACSP)](https://apify.com/icarodata/placsp-licitaciones) — all-sector Spanish public tenders
- [UK Public Tenders](https://apify.com/icarodata/uk-public-tenders) — Find a Tender and Contracts Finder
- [BOE Subastas Scraper](https://apify.com/icarodata/boe-subastas) — official property auctions
- [Spain Property Enricher](https://apify.com/icarodata/spain-property-enricher) — cadastral reference, surfaces and coordinates
- [BORME Scraper](https://apify.com/icarodata/borme-feed) — new Spanish companies

# Actor input Schema

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

Official datasets to read. All by default.

## `leadTypes` (type: `array`):

Leave empty for all.

## `municipalities` (type: `array`):

Optional city names, e.g. Madrid, Barcelona, Valencia, Sevilla. PLACSP covers every Spanish municipality; Madrid/Barcelona datasets are read only when those cities are included (or no city is set).

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

Optional province names (Madrid, Barcelona, Málaga…).

## `districts` (type: `array`):

Optional districts, e.g. Eixample, Gràcia, Chamberí, Hortaleza.

## `worksTypes` (type: `array`):

Leave empty for all.

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

Keep leads containing ANY keyword in title, description, address or company names (e.g. fachada, cubierta, rehabilitación, telecomunicacions).

## `excludeKeywords` (type: `array`):

Drop leads containing ANY of these words.

## `minBudget` (type: `integer`):

Keep leads whose budget is at least this amount. Madrid licences publish no budget and are dropped when set, unless 'Keep leads without budget' is on.

## `maxBudget` (type: `integer`):

Keep leads whose budget is at most this amount.

## `keepLeadsWithoutBudget` (type: `boolean`):

With a minimum budget set, still keep leads that publish no budget.

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

Look-back window on the lead date (licence granted, works start, tender published or contract awarded) when 'Since date' is empty. Madrid publishes monthly, so keep at least 31 days for Madrid.

## `sinceDate` (type: `string`):

Optional YYYY-MM-DD. Overrides 'Days back'.

## `untilDate` (type: `string`):

Optional YYYY-MM-DD (inclusive).

## `statuses` (type: `array`):

Optional: granted (Madrid), in_progress / finished / stopped (Barcelona), open / announced / pending_award / awarded / resolved (PLACSP).

## `applicantTypes` (type: `array`):

Optional filter for Madrid licences. Names are never published; for private individuals the street number is removed.

## `withContractorOnly` (type: `boolean`):

Keep only leads with a contractor company (Barcelona works, PLACSP awards).

## `maxPlacspPages` (type: `integer`):

Each official PLACSP ATOM page holds up to 500 procedures of all sectors and takes ~20–60 s to read; 5 pages per feed ≈ the last 1–2 days. Raise it (up to 200) together with 'Max run time' for longer back-fills; the run stops earlier once 'Maximum leads' is reached.

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

Stop after saving this many leads. You pay only for saved leads.

## `maxRunTimeSecs` (type: `integer`):

Internal time budget. When it is reached the Actor stops reading feeds and saves the leads found so far (the run still succeeds). Default 180 s keeps runs fast; set e.g. 1800 with more PLACSP pages for long back-fills, or 0 for no internal limit (the platform run timeout still applies).

## `onlyNewSinceLastRun` (type: `boolean`):

Return only leads not delivered in a previous run with the same filters (state in the named key-value store 'spain-construction-leads-state').

## Actor input object example

```json
{
  "sources": [
    "madrid_licencias",
    "barcelona_obras",
    "placsp_obras"
  ],
  "leadTypes": [],
  "municipalities": [
    "Madrid"
  ],
  "provinces": [],
  "districts": [],
  "worksTypes": [],
  "keywords": [],
  "excludeKeywords": [],
  "keepLeadsWithoutBudget": false,
  "daysBack": 30,
  "statuses": [],
  "applicantTypes": [],
  "withContractorOnly": false,
  "maxPlacspPages": 2,
  "maxItems": 30,
  "maxRunTimeSecs": 180,
  "onlyNewSinceLastRun": false
}
```

# Actor output Schema

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

No description

# 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 = {
    "municipalities": [
        "Madrid"
    ],
    "maxPlacspPages": 2,
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("icarodata/spain-construction-leads").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 = {
    "municipalities": ["Madrid"],
    "maxPlacspPages": 2,
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("icarodata/spain-construction-leads").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 '{
  "municipalities": [
    "Madrid"
  ],
  "maxPlacspPages": 2,
  "maxItems": 30
}' |
apify call icarodata/spain-construction-leads --silent --output-dataset

```

## MCP server setup

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

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/fTw2lHHE8TrgdL5J0/builds/GHWYiph1B3cSp67jb/openapi.json
