# Spain B2B Leads: Google Maps + BORME (`agoradelmediterraneo/spain-b2b-leads`) Actor

Scrapes Spanish businesses from Google Maps and enriches them with BORME registry data (CIF, legal form, CNAE code). Pay per lead — only pay for what you extract.

- **URL**: https://apify.com/agoradelmediterraneo/spain-b2b-leads.md
- **Developed by:** [Agora](https://apify.com/agoradelmediterraneo) (community)
- **Categories:** Lead generation
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 b2b 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Spain B2B Leads: Google Maps + BORME Enrichment

Extract verified Spanish business leads from **Google Maps** and automatically enrich them with official **Registro Mercantil (BORME)** data: CIF, legal name, CNAE code, and company type.

**Pay per lead** — $0.003/result. Only pay for what you extract.

### What it does

1. **Searches Google Maps** for businesses matching your keyword + location using a real browser (Playwright)
2. **Extracts full contact info** per lead: name, address, phone, website, rating, reviews count
3. **Enriches each lead** with BORME registry data via fuzzy matching against openmercantil.es
4. **Sorts output**: BORME-matched leads first, then by rating and data completeness

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `keyword` | string | `"abogados"` | Business type (e.g. `"fontaneros"`, `"dentistas"`, `"gestorías"`, `"arquitectos"`) |
| `location` | string | `"Madrid"` | City or region in Spain (e.g. `"Barcelona"`, `"Sevilla"`, `"País Vasco"`) |
| `maxResults` | integer | `20` | Max leads to return (1–100). Actor processes up to 2× candidates internally to maximize BORME match rate. |
| `onlyMatched` | boolean | `false` | If `true`, only return leads confirmed in the Registro Mercantil (CIF verified) |
| `extractEmails` | boolean | `false` | If `true`, visits each business website and extracts contact email addresses (adds `emails` field) |
| `enrichmentEndpoint` | string | `""` | Optional: URL of a custom eu-company-enrichment webhook as fallback |
| `enrichmentSecret` | string | `""` | Optional: webhook secret for the enrichment endpoint |

### Output

Each item in the dataset:

```json
{
  "name": "Martínez & Caballero Abogados",
  "address": "Pça. Tetuan, 40, Eixample, 08010 Barcelona, España",
  "phone": "+34628379016",
  "website": "http://www.martinezcaballeroabogados.com/",
  "rating": 4.9,
  "reviews": 888,
  "category": "abogados",
  "google_maps_url": "https://www.google.com/maps/place/...",
  "borme_matched": false,
  "match_confidence": 0,
  "cif": null,
  "razon_social": null,
  "forma_juridica": null,
  "cnae": null,
  "capital_social": null,
  "administradores": [],
  "borme_last_entry": null
}
```

When BORME data is found:

```json
{
  "name": "Edenred España",
  "phone": "+34913001200",
  "website": "https://edenred.es",
  "rating": 4.2,
  "reviews": 156,
  "borme_matched": true,
  "match_confidence": 0.86,
  "cif": "A78881190",
  "razon_social": "EDENRED ESPAÑA SA",
  "forma_juridica": "SA",
  "cnae": "7022",
  "capital_social": "3000000",
  "borme_last_entry": "2026-02-09"
}
```

### BORME match rate

Match rate depends on business type and size:

- **Large/medium companies** (tech, consulting, energy, finance): ~30–60%
- **Professional offices** (lawyers, architects): ~5–20% (commercial name often differs from legal entity)
- **Retail/hospitality**: ~10–25%

When `borme_matched: false`, Google Maps data (phone, website, address, rating) is still returned and fully usable for prospecting.

### Use cases

- Lead generation for B2B sales teams targeting Spanish SMEs
- Building prospect lists by sector and geography
- Verifying business existence via official Registro Mercantil
- Market research and competitor mapping
- CRM enrichment with CIF and CNAE codes

### Data sources

- **Business listings**: Google Maps via Playwright browser automation
- **BORME enrichment**: [openmercantil.es](https://openmercantil.es) public API — official data from the Boletín Oficial del Registro Mercantil
- Attribution: "Basado en datos de la Agencia Estatal Boletín Oficial del Estado."

### Notes

- Google Maps results are geo-ranked — highest-rated and most popular businesses appear first
- The actor processes up to `maxResults × 2` candidates to maximize BORME match rate, then returns the top `maxResults` sorted by match quality
- For high-volume extraction (500+ leads), run multiple times with different keywords or locations

# Actor input Schema

## `keyword` (type: `string`):

Type of business to search (e.g. 'abogados', 'clínicas dentales', 'fontaneros')

## `location` (type: `string`):

City or region in Spain (e.g. 'Madrid', 'Barcelona', 'Cataluña')

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

Maximum number of business leads to extract (1-100)

## `onlyMatched` (type: `boolean`):

If true, only return leads with a confirmed match in the Registro Mercantil (BORME)

## `extractEmails` (type: `boolean`):

If true, visits each business website and extracts contact email addresses. Slower but adds email field to every lead with a website.

## `enrichmentEndpoint` (type: `string`):

URL of the eu-company-enrichment webhook (leave blank to use OpenCorporates fallback)

## `enrichmentSecret` (type: `string`):

x-rapidapi-proxy-secret header value for the enrichment webhook

## Actor input object example

```json
{
  "keyword": "abogados",
  "location": "Madrid",
  "maxResults": 20,
  "onlyMatched": false,
  "extractEmails": false,
  "enrichmentEndpoint": ""
}
```

# 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("agoradelmediterraneo/spain-b2b-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("agoradelmediterraneo/spain-b2b-leads").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 agoradelmediterraneo/spain-b2b-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=agoradelmediterraneo/spain-b2b-leads",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/vsZyoDVPaMdIMKqOG/builds/Q5Wph2M60p7Y6i9vP/openapi.json
