# 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Spain B2B Leads: Google Maps + BORME",
        "description": "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.",
        "version": "1.0",
        "x-build-id": "Q5Wph2M60p7Y6i9vP"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/agoradelmediterraneo~spain-b2b-leads/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-agoradelmediterraneo-spain-b2b-leads",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/agoradelmediterraneo~spain-b2b-leads/runs": {
            "post": {
                "operationId": "runs-sync-agoradelmediterraneo-spain-b2b-leads",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/agoradelmediterraneo~spain-b2b-leads/run-sync": {
            "post": {
                "operationId": "run-sync-agoradelmediterraneo-spain-b2b-leads",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "keyword",
                    "location"
                ],
                "properties": {
                    "keyword": {
                        "title": "Business keyword",
                        "type": "string",
                        "description": "Type of business to search (e.g. 'abogados', 'clínicas dentales', 'fontaneros')"
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "City or region in Spain (e.g. 'Madrid', 'Barcelona', 'Cataluña')"
                    },
                    "maxResults": {
                        "title": "Maximum results",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of business leads to extract (1-100)",
                        "default": 20
                    },
                    "onlyMatched": {
                        "title": "Only BORME-matched leads",
                        "type": "boolean",
                        "description": "If true, only return leads with a confirmed match in the Registro Mercantil (BORME)",
                        "default": false
                    },
                    "extractEmails": {
                        "title": "Extract emails from websites",
                        "type": "boolean",
                        "description": "If true, visits each business website and extracts contact email addresses. Slower but adds email field to every lead with a website.",
                        "default": false
                    },
                    "enrichmentEndpoint": {
                        "title": "BORME enrichment endpoint",
                        "type": "string",
                        "description": "URL of the eu-company-enrichment webhook (leave blank to use OpenCorporates fallback)",
                        "default": ""
                    },
                    "enrichmentSecret": {
                        "title": "Enrichment webhook secret",
                        "type": "string",
                        "description": "x-rapidapi-proxy-secret header value for the enrichment webhook"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
