# Google Maps Business Leads (`mighty_monk/google-maps-business-leads`) Actor

Extract local business leads from Google Maps search queries or place URLs. Returns name, address, phone, website, rating, review count, category, coordinates, hours, and Maps URL — ready for outreach and CRM import.

- **URL**: https://apify.com/mighty\_monk/google-maps-business-leads.md
- **Developed by:** [Harsh](https://apify.com/mighty_monk) (community)
- **Categories:** Lead generation, Travel
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 business 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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## Google Maps Business Leads

**Extract local business leads from Google Maps** search queries or place URLs. Returns name, address, phone, website, rating, review count, category, coordinates, opening hours, and Maps URL — ready for outreach and CRM import.

Built with **TypeScript** and **Crawlee CheerioCrawler** (no browser by default). Multi-strategy HTML parsing (fixture cards, JSON-LD, embedded Maps payloads, place links, meta tags, DOM panels) with retries, rate limiting, proxy support, and placeId deduplication.

Run it on the [Apify platform](https://apify.com) for scheduling, API access, proxy rotation, monitoring, and dataset exports (JSON, CSV, Excel).

### Features

- Search by free-text query (city + niche), e.g. `coffee shops in Austin TX`
- Or scrape direct Google Maps **place** / **search** URLs
- Fields: `name`, `category`, `address`, `city`, `state`, `country`, `phone`, `website`, `emails`, `rating`, `reviewCount`, `placeId`, `lat`, `lng`, `mapsUrl`, `openingHours`, `searchQuery`, `scrapedAt`
- Deduplicate by `placeId` (with name+address fallback)
- Retries, rate limiting (`requestDelayMs`), concurrency controls
- Apify Proxy enabled by default (recommended for Maps)
- Graceful handling of captcha/blocks (records error, does not crash the run)
- Dataset JSON + **LEADS.csv** + **SUMMARY.md** in the key-value store
- Optional email harvest from business websites (`includeEmailsFromWebsite`)

### Why use Google Maps Business Leads?

- **Lead generation** — build outreach lists for local services and retail
- **Market research** — compare density, ratings, and categories by city
- **CRM enrichment** — import phone, website, and address fields
- **Sales ops** — monitor competitor footprints by query

### How to use

1. Open the Actor in [Apify Console](https://console.apify.com)
2. Enter one or more **search queries** (and/or Maps place URLs)
3. Set **Max results per query**, delay, and proxy (residential recommended if blocked)
4. Click **Start**
5. Download results from the **Dataset** tab, or **LEADS.csv** / **SUMMARY.md** from the key-value store

### Input

| Field                      | Type     | Default        | Description                                      |
| -------------------------- | -------- | -------------- | ------------------------------------------------ |
| `searchQueries`            | string[] | sample queries | Maps search queries (city + niche)               |
| `startUrls`                | array    | `[]`           | Direct Google Maps place or search URLs          |
| `maxResultsPerQuery`       | integer  | `50`           | Cap unique leads per query                       |
| `maxConcurrency`           | integer  | `2`            | Parallel HTTP requests (keep low for Maps)       |
| `maxRequestRetries`        | integer  | `3`            | HTTP retry count                                 |
| `requestDelayMs`           | integer  | `1000`         | Delay used for rate limiting                     |
| `language`                 | string   | `en`           | Maps `hl` language code                          |
| `countryCode`              | string   | `us`           | Maps `gl` country bias                           |
| `includeEmailsFromWebsite` | boolean  | `false`        | Visit business websites to collect public emails |
| `proxyConfiguration`       | object   | Apify Proxy on | Proxy settings                                   |

Example:

```json
{
    "searchQueries": ["coffee shops in Austin TX", "plumbers in Chicago"],
    "startUrls": [],
    "maxResultsPerQuery": 50,
    "maxConcurrency": 2,
    "maxRequestRetries": 3,
    "requestDelayMs": 1000,
    "proxyConfiguration": { "useApifyProxy": true },
    "language": "en",
    "includeEmailsFromWebsite": false,
    "countryCode": "us"
}
````

See [`examples/input.json`](examples/input.json).

### Output

Each dataset item is one business lead:

```json
{
    "name": "Joe's Coffee",
    "category": "Coffee shop",
    "address": "123 Congress Ave, Austin, TX 78701, United States",
    "city": "Austin",
    "state": "TX",
    "country": "United States",
    "phone": "+1 512-555-0101",
    "website": "https://joescoffee.example.com",
    "emails": [],
    "rating": 4.7,
    "reviewCount": 842,
    "placeId": "ChIJfixture0001joescoffee",
    "lat": 30.2672,
    "lng": -97.7431,
    "mapsUrl": "https://www.google.com/maps/place/...",
    "openingHours": ["Monday: 7AM-6PM", "Tuesday: 7AM-6PM"],
    "searchQuery": "coffee shops in Austin TX",
    "scrapedAt": "2026-07-13T12:00:00.000Z",
    "error": null
}
```

Key-value store exports:

- **LEADS.csv** — flat CRM-friendly CSV of all leads
- **SUMMARY.md** — human-readable run summary
- **OUTPUT** — JSON totals and export keys

See [`examples/output.json`](examples/output.json).

### Pricing

Pay-per-event pricing: charged primarily per business lead written to the default dataset (`apify-default-dataset-item`), plus a small actor-start fee.

### Installation (local)

```bash
cd factory/google-maps-business-leads
npm install
npm run build
npm test
## Optional local run (live Maps often requires residential proxy):
## apify run -p
```

### Limitations

- Google Maps is heavily protected. Datacenter IPs are frequently captcha’d; **use Apify Proxy** (residential groups when needed).
- Result volume and field completeness depend on what Maps returns in HTML for your IP/locale. Some sessions return thin or empty payloads.
- This Actor prefers **Cheerio/HTTP** (fast, cheap). It does not drive a full browser; highly interactive Maps UI may need additional strategies over time.
- Opening hours, emails, and some fields may be missing for certain listings.
- Respect Google Terms of Service, local laws, and do not use data for spam or prohibited purposes.
- Email extraction from websites is best-effort regex on public HTML only.

### FAQ

**Why did I get zero results?**\
Likely a block/captcha or empty HTML payload. Check logs for “blocked”, enable residential proxy, lower concurrency, and increase `requestDelayMs`.

**Can I scrape only place URLs?**\
Yes — put place URLs in `startUrls` and leave `searchQueries` empty.

**How are duplicates handled?**\
Leads are deduplicated primarily by `placeId`, then by name+address / coordinates.

**Does it support languages other than English?**\
Set `language` (`hl`) and `countryCode` (`gl`) to bias Maps results.

### Changelog

#### 1.0.0

- Initial release: search queries + place URLs, multi-strategy extractors, CSV/Markdown export, proxy/retries, unit tests with HTML fixtures

### License

Apache-2.0

# Actor input Schema

## `searchQueries` (type: `array`):

Google Maps search queries such as "coffee shops in Austin TX" or "plumbers in Chicago". Each query is scraped up to maxResultsPerQuery leads.

## `startUrls` (type: `array`):

Optional direct Google Maps place or search URLs. Place URLs are scraped as individual leads; search URLs expand to listings.

## `maxResultsPerQuery` (type: `integer`):

Maximum number of unique business leads to keep for each search query.

## `maxConcurrency` (type: `integer`):

Maximum number of HTTP requests processed in parallel. Keep low for Maps to reduce blocks.

## `maxRequestRetries` (type: `integer`):

How many times to retry failed HTTP requests before giving up.

## `requestDelayMs` (type: `integer`):

Approximate delay between requests used for rate limiting (converted to maxRequestsPerMinute).

## `language` (type: `string`):

Google Maps interface language code (hl parameter), e.g. en, es, de, fr.

## `countryCode` (type: `string`):

Preferred country/region bias (gl parameter), e.g. us, gb, de, ca.

## `includeEmailsFromWebsite` (type: `boolean`):

When enabled, visits each business website homepage and extracts public email addresses (extra requests; slower).

## `proxyConfiguration` (type: `object`):

Apify Proxy is strongly recommended for Google Maps. Residential proxies work best when datacenter IPs are blocked.

## Actor input object example

```json
{
  "searchQueries": [
    "coffee shops in Austin TX",
    "plumbers in Chicago"
  ],
  "startUrls": [],
  "maxResultsPerQuery": 50,
  "maxConcurrency": 2,
  "maxRequestRetries": 3,
  "requestDelayMs": 1000,
  "language": "en",
  "countryCode": "us",
  "includeEmailsFromWebsite": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `csv` (type: `string`):

No description

## `summary` (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 = {
    "searchQueries": [
        "coffee shops in Austin TX",
        "plumbers in Chicago"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mighty_monk/google-maps-business-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 = { "searchQueries": [
        "coffee shops in Austin TX",
        "plumbers in Chicago",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("mighty_monk/google-maps-business-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 '{
  "searchQueries": [
    "coffee shops in Austin TX",
    "plumbers in Chicago"
  ]
}' |
apify call mighty_monk/google-maps-business-leads --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Maps Business Leads",
        "description": "Extract local business leads from Google Maps search queries or place URLs. Returns name, address, phone, website, rating, review count, category, coordinates, hours, and Maps URL — ready for outreach and CRM import.",
        "version": "1.0",
        "x-build-id": "oX4meIgaS3QpYaNYN"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/mighty_monk~google-maps-business-leads/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-mighty_monk-google-maps-business-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/mighty_monk~google-maps-business-leads/runs": {
            "post": {
                "operationId": "runs-sync-mighty_monk-google-maps-business-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/mighty_monk~google-maps-business-leads/run-sync": {
            "post": {
                "operationId": "run-sync-mighty_monk-google-maps-business-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",
                "properties": {
                    "searchQueries": {
                        "title": "Search queries",
                        "type": "array",
                        "description": "Google Maps search queries such as \"coffee shops in Austin TX\" or \"plumbers in Chicago\". Each query is scraped up to maxResultsPerQuery leads.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "startUrls": {
                        "title": "Google Maps place URLs",
                        "type": "array",
                        "description": "Optional direct Google Maps place or search URLs. Place URLs are scraped as individual leads; search URLs expand to listings.",
                        "default": [],
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "maxResultsPerQuery": {
                        "title": "Max results per query",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of unique business leads to keep for each search query.",
                        "default": 50
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Maximum number of HTTP requests processed in parallel. Keep low for Maps to reduce blocks.",
                        "default": 2
                    },
                    "maxRequestRetries": {
                        "title": "Max request retries",
                        "minimum": 0,
                        "maximum": 10,
                        "type": "integer",
                        "description": "How many times to retry failed HTTP requests before giving up.",
                        "default": 3
                    },
                    "requestDelayMs": {
                        "title": "Request delay (ms)",
                        "minimum": 0,
                        "maximum": 60000,
                        "type": "integer",
                        "description": "Approximate delay between requests used for rate limiting (converted to maxRequestsPerMinute).",
                        "default": 1000
                    },
                    "language": {
                        "title": "Language",
                        "type": "string",
                        "description": "Google Maps interface language code (hl parameter), e.g. en, es, de, fr.",
                        "default": "en"
                    },
                    "countryCode": {
                        "title": "Country code",
                        "type": "string",
                        "description": "Preferred country/region bias (gl parameter), e.g. us, gb, de, ca.",
                        "default": "us"
                    },
                    "includeEmailsFromWebsite": {
                        "title": "Include emails from website",
                        "type": "boolean",
                        "description": "When enabled, visits each business website homepage and extracts public email addresses (extra requests; slower).",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy is strongly recommended for Google Maps. Residential proxies work best when datacenter IPs are blocked.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
