# Google Maps Lead Extractor for Spain (`apitory/leads-negocios-google-maps`) Actor

Extract contactable leads for Spanish local businesses from Google Maps: a Spanish search pack for Madrid, Barcelona and Valencia, with emails and phones pulled from each business's own website. Pay only for leads with a contact found.

- **URL**: https://apify.com/apitory/leads-negocios-google-maps.md
- **Developed by:** [Apitory.com](https://apify.com/apitory) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 place scrapeds

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/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

## Google Maps Lead Extractor for Spain

Pull **contactable leads for Spanish local businesses** — plumbers, electricians, renovation companies, dental clinics, mechanics, restaurants and more — straight from Google Maps, with the public contact details from each business's own website attached.

You get one structured record per business: **place data** (name, category, address, phone, website, rating, review count) **plus the contacts published on the business's website** — emails, phone numbers and social profile links. The input comes prefilled with a Spanish-language search pack covering Madrid, Barcelona and Valencia, and the proxy country is prefilled to **ES**, so categories and addresses render in Spanish, the way a local buyer sees them.

Built for **agencies that sell to Spanish local businesses** — web design, local marketing, booking and ordering systems, review management — and for anyone building a prospect list of Spanish trades and services with working contact details.

### Quickstart

Default input — eight Spanish trades/services across three cities; swap in your own terms and cities:

```json
{
  "searchTerms": [
    "fontanero en Madrid",
    "electricista en Madrid",
    "empresa de reformas en Madrid",
    "clínica dental en Barcelona",
    "restaurante en Barcelona",
    "taller mecánico en Barcelona",
    "clínica dental en Valencia",
    "peluquería en Valencia"
  ],
  "maxPlaces": 200,
  "extractContacts": true,
  "proxyCountry": "ES"
}
```

One trade + one city per term, written in Spanish exactly as a local customer would type it into Maps. To cover several markets, duplicate the pack per city. To go deep on one trade (say, every dental clinic in Andalucía), keep a single term and raise `maxPlaces`. Businesses are deduplicated by Google place ID across all terms, so overlapping terms never double-charge you.

**Spanish search wording that works well on Maps:** `fontanero` (plumber), `electricista` (electrician), `cerrajero` (locksmith), `taller mecánico` (car mechanic), `clínica dental` (dental clinic), `empresa de reformas` (renovation company), `peluquería` (hair salon), `restaurante`, `abogados` (lawyers), `empresa de limpieza` (cleaning company), `aire acondicionado` (air conditioning), `fisioterapia` (physiotherapy).

### Pricing (pay per event)

| Event | Price | When it is charged |
|---|---|---|
| Actor start | $0.00005 per GB of memory | Once, when the run starts |
| **Place scraped** | **$0.004 / business** | For every business record in the dataset |
| **Lead scraped** | **$0.10 / lead** | **Only** when the business's website yields at least one public email or phone (`contactFound: true`) |

No contact found → no lead charge. No website → no lead charge. You never pay the premium for an empty record.

### How it works

1. **Maps phase (browser).** For each search term, the Actor opens `google.com/maps/search/<term>` in Chromium through Apify Proxy (residential by default, exit IP pinned to Spain unless you change `proxyCountry`), dismisses the EU consent dialog if shown, scrolls the results feed and harvests every result card. It then navigates to each place page directly and reads the detail panel. Places are deduplicated by Google place ID across all search terms.
2. **Contact phase (plain HTTP, no browser).** For every business with a website, the Actor fetches the homepage plus up to 3 likely contact pages (discovered from the homepage's own links — `/contacto`, `/contact`, `/about`, …) and extracts:

   - **emails** — `mailto:` links first, then a text pass with placeholder / image-filename / tracker-address filtering and light de-obfuscation (`name [at] domain [dot] com`);
   - **phones** — `tel:` links first, then a conservative text pass;
   - **social links** — Facebook, Instagram, LinkedIn, Twitter/X, YouTube profile URLs (share/intent/post URLs excluded).

   Websites shared by several locations (chains and franchises) are fetched once.

If Google serves its bot-detection "sorry" page for a search (rare through residential IPs), the Actor detects it, marks that term `BLOCKED_BY_GOOGLE` in the run metrics and finishes honestly with whatever it has — it does not crash or fabricate results.

### Inputs

| Input | Type | Default | Notes |
|---|---|---|---|
| `searchTerms` | string array | eight-term Spanish pack (Madrid / Barcelona / Valencia) | One trade + one city per term, in Spanish, typed exactly as in Google Maps. |
| `maxPlaces` | integer | `200` | Cap on unique businesses across all terms (max 1000). |
| `extractContacts` | boolean | `true` | Turn off for place data only (no lead events are charged). |
| `proxyGroup` | string | `RESIDENTIAL` | Apify Proxy group for the Maps browser phase. Residential is strongly recommended. |
| `proxyCountry` | string | `ES` | Exit-IP country. Prefilled to Spain; change only when retargeting the pack to another Spanish-speaking market. |
| `useApifyProxy` | boolean | `true` | Off only for local diagnostics. |

### Output — one record per business

| Field | Description |
|---|---|
| `name` | Business name. |
| `category` | e.g. "Fontanero", "Clínica dental", "Restaurante" (renders in the exit IP's Google UI language — Spanish with `proxyCountry: ES`). |
| `address` | Address as shown on Maps. |
| `phone` | Phone as shown on Maps (website phones are in `_contact.phones`). Every record with a Maps listing phone is callable even without a website hit. |
| `website` | Website URL listed on Maps, or `null`. |
| `rating` / `reviewsCount` | Rating and review count from Maps — your prioritisation signal (a 4.8-star clinic with 600 reviews is a different prospect from a 3.9 with 12). |
| `mapsUrl` | Link to the place on Google Maps. |
| `featureId` | Maps feature id (`0x…:0x…`). |
| `placeId` | Google `ChIJ…` place id — the deduplication key. |
| `searchTerm` | Which search produced this business. |
| `contactFound` | `true` when the website yielded ≥ 1 email or phone (the **lead** condition). |
| `_contact` | `{ website, emails[], phones[], socialLinks[], pagesFetched[] }`, or `null` when the business has no website. |

A run summary (businesses found, websites visited, contact and email hit rates, per-search states such as `RENDERED` / `BLOCKED_BY_GOOGLE`) is stored in the key-value store record `metrics` and printed at the end of the run log.

#### Sample record (real output)

From a pre-publish test run — `restaurante en Madrid` with `proxyCountry: ES`, 15 businesses: **15 had websites, 12 (80%) produced a public contact and 7 (47%) a public email.** (Category and address render in the language of the exit IP's Google UI — the run was pinned to Spain, so they are in Spanish. Note the `pagesFetched` list: the contact details came from the site's `/contacto/` page, which the Actor discovers from the homepage's own links.)

```json
{
  "name": "La Taberna de Peñalver",
  "category": "Restaurante mediterráneo",
  "address": "C. del Conde de Peñalver, 90, 92 94, Salamanca, 28006 Madrid",
  "phone": "608 45 05 51",
  "website": "https://www.latabernadepenalver.com/",
  "rating": 4.8,
  "reviewsCount": 22503,
  "placeId": "ChIJnx_fKOApQg0RlDK1xQwDUBI",
  "contactFound": true,
  "_contact": {
    "emails": ["info@latabernadepenalver.com"],
    "phones": ["+34608450551", "+34644065781"],
    "socialLinks": [
      "https://www.instagram.com/latabernadepenalver",
      "https://www.facebook.com/La-Taberna-de-Pe%C3%B1alver-105284924592263"
    ]
  }
}
```

**Cost per lead, in plain numbers:** a 200-business run costs $0.80 in place events. At the test run's 80% contact rate, ≈ 160 of those businesses produce a public contact: $0.80 + 160 × $0.10 ≈ **$16.80 for ~160 contactable Spanish businesses — roughly $0.11 per lead**. Your conversion will vary by trade and city; every run's summary reports its actual hit rate, so you can price your client report or your resale list from real numbers, not promises.

### FAQ

**Chains and multi-location businesses — do I get duplicates?** Two kinds, two answers. The *same location* surfaced by several of your search terms is deduplicated by Google place ID before anything is pushed or charged — you never pay twice for one business. *Different locations* of a chain are separate records on purpose: each location has its own phone, its own reviews and its own manager, and for local outreach the location is the buying unit. If several locations share one chain website, that site is fetched once and its public contact may appear on each location's record — filter by website domain if you want one row per chain.

**Do you charge for duplicates?** No. Deduplication by place ID happens before pushing and charging.

**What if a business has no website?** You get the place record (with the Maps phone, if listed) and pay only the $0.004 place event. For web-design agencies, those records are often the best prospects of all — a busy plumber with no website is a pitch waiting to happen.

**Can I use it from the API / n8n / Make / Zapier?** Yes — like every Apify Actor it runs via the Apify API and the official integrations. Send the input JSON, read the default dataset when the run finishes. Run it on a schedule to rebuild a city's trade list monthly and diff against last month's for new businesses and closed ones.

**Which countries are supported?** Anywhere Google Maps has listings. This pack is tuned for Spain (Spanish terms, `proxyCountry: ES`, `/contacto` page discovery); for another Spanish-speaking market, change the cities in the terms and the `proxyCountry` code to match.

### Limitations (stated plainly)

- **DOM-based extraction.** Google Maps changes its markup regularly; the Actor leans on the most stable hooks available (`div[role="feed"]`, `data-item-id` attributes, the panel `h1`), but a field coming back `null` usually means a selector drifted, not that the data does not exist. Report it and it gets fixed.
- **Website fetching is plain HTTP.** A minority of sites block datacenter IPs or hide contacts behind JavaScript; those come back with empty `_contact` arrays and are **not** charged as leads.
- **Text-derived phones can include false positives.** `tel:`-link phones are reliable; treat text-only numbers as unverified.
- **Public data only.** The Actor collects contact details that businesses publish on Google Maps and on their own websites. It does not access private data.

### Support

Questions, trade-pack requests, or a field that came back empty? Contact: **apitoryhq@gmail.com** — issues are answered publicly in the Actor's Issues tab whenever possible.

# Actor input Schema

## `extractContacts` (type: `boolean`):

For every business with a website, visit the website (homepage + up to 3 likely contact pages, including /contacto) over plain HTTP and extract public emails, phones and social links into the record's \_contact object. This is what turns a place into a lead — turn off only if you want place data alone.

## `maxPlaces` (type: `integer`):

Stop after collecting this many unique businesses across all search terms. 200 covers roughly one trade across a mid-size Spanish city, or several trades in a smaller market.

## `proxyCountry` (type: `string`):

Two-letter country code for the Apify Proxy exit IP. Prefilled with 'ES' — Spanish searches work best from a Spanish exit IP, and Maps categories/addresses render in Spanish. Change it (e.g. 'MX', 'AR') only if you retarget the pack to another Spanish-speaking market.

## `proxyGroup` (type: `string`):

Apify Proxy group used for the Google Maps browser phase. RESIDENTIAL is strongly recommended; datacenter IPs are served Google's 'sorry' page almost immediately.

## `searchTerms` (type: `array`):

Google Maps searches to run, in Spanish, exactly as a local customer would type them — one trade or service + one city per term. The prefilled pack covers eight high-value local services across Madrid, Barcelona and Valencia. Replace the cities with your market (keep the Spanish trade wording — 'fontanero', 'cerrajero', 'taller mecánico', 'clínica dental', 'empresa de reformas'…), duplicate the pack per city to cover several markets, or narrow it to a single trade. Places are deduplicated across terms, so multi-location businesses appear once.

## `useApifyProxy` (type: `boolean`):

Turn off only for local/diagnostic runs without proxy. A direct run from a datacenter IP is expected to hit Google's 'sorry' page; the actor reports that state honestly instead of failing.

## Actor input object example

```json
{
  "extractContacts": true,
  "maxPlaces": 200,
  "proxyCountry": "ES",
  "proxyGroup": "RESIDENTIAL",
  "searchTerms": [
    "fontanero en Madrid",
    "electricista en Madrid",
    "empresa de reformas en Madrid",
    "clínica dental en Barcelona",
    "restaurante en Barcelona",
    "taller mecánico en Barcelona",
    "clínica dental en Valencia",
    "peluquería en Valencia"
  ],
  "useApifyProxy": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

One record per place (name, category, address, phone, website, rating, reviewsCount, mapsUrl, contactFound, and a \_contact object with the emails/phones/socials found on the business website), followed by one final record with \_meta=true summarizing the run (places found, contact hit rate, requests, bytes, elapsed time). Run metrics are also stored as a key-value store record named metrics.

# 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 = {
    "extractContacts": true,
    "maxPlaces": 200,
    "proxyCountry": "ES",
    "proxyGroup": "RESIDENTIAL",
    "searchTerms": [
        "fontanero en Madrid",
        "electricista en Madrid",
        "empresa de reformas en Madrid",
        "clínica dental en Barcelona",
        "restaurante en Barcelona",
        "taller mecánico en Barcelona",
        "clínica dental en Valencia",
        "peluquería en Valencia"
    ],
    "useApifyProxy": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("apitory/leads-negocios-google-maps").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 = {
    "extractContacts": True,
    "maxPlaces": 200,
    "proxyCountry": "ES",
    "proxyGroup": "RESIDENTIAL",
    "searchTerms": [
        "fontanero en Madrid",
        "electricista en Madrid",
        "empresa de reformas en Madrid",
        "clínica dental en Barcelona",
        "restaurante en Barcelona",
        "taller mecánico en Barcelona",
        "clínica dental en Valencia",
        "peluquería en Valencia",
    ],
    "useApifyProxy": True,
}

# Run the Actor and wait for it to finish
run = client.actor("apitory/leads-negocios-google-maps").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 '{
  "extractContacts": true,
  "maxPlaces": 200,
  "proxyCountry": "ES",
  "proxyGroup": "RESIDENTIAL",
  "searchTerms": [
    "fontanero en Madrid",
    "electricista en Madrid",
    "empresa de reformas en Madrid",
    "clínica dental en Barcelona",
    "restaurante en Barcelona",
    "taller mecánico en Barcelona",
    "clínica dental en Valencia",
    "peluquería en Valencia"
  ],
  "useApifyProxy": true
}' |
apify call apitory/leads-negocios-google-maps --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apitory/leads-negocios-google-maps"
        }
    }
}
```

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/mM4lc4MIbd7TC5SnH/builds/KCg97YPUViusZJoRS/openapi.json
