# Google Maps B2B Leads & Contact Scraper (`youuiiiii/gmaps-leads-scraper`) Actor

Extract business leads from Google Maps including names, addresses, websites, phone numbers, ratings, direct emails, and social media profiles.

- **URL**: https://apify.com/youuiiiii/gmaps-leads-scraper.md
- **Developed by:** [Richie C. Tungadi](https://apify.com/youuiiiii) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

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

## Google Maps B2B Leads & Contact Scraper

An Apify Actor that discovers businesses on Google Maps, opens their detail panels,
and optionally visits their public websites for contact emails and social profiles.

### Input

```json
{
  "queries": ["Digital marketing agency Jakarta"],
  "maxResults": 20,
  "extractEmails": true,
  "language": "en",
  "proxyConfiguration": {"useApifyProxy": true}
}
```

- `queries`: non-empty search strings; exact duplicate queries are removed.
- `maxResults`: 1–500 leads **per query**, default 20. This is a limit, not a guarantee.
- `extractEmails`: default true; checks the homepage and at most one same-host
  contact/about page. Email deliverability and ownership are **not verified**.
- `language`: default `en`. Card parsing recognizes English/Indonesian opening
  statuses and comma/dot decimal ratings. Other languages may leave fields empty.
- `proxyConfiguration`: default `{"useApifyProxy": true}`. Supports Apify proxy
  groups or custom proxy URLs. Set `{"useApifyProxy": false}` for a direct run.
  A requested proxy must initialize successfully; there is no silent direct fallback.
  The same configured proxy is used for browser and contact-site requests.

### Output

The default dataset contains `query`, `title`, `category`, `address`, `phone`,
`website`, `emails`, `socials`, `rating`, `reviewsCount`, `status`, `latitude`,
`longitude`, and `googleMapsUrl`. Missing source fields may be null or absent.
Coordinates come from the business URL, never the map viewport center.
Apify can export the dataset as JSON/CSV/Excel. No CRM integration is included.

Per-lead `detailError` or `contactErrors` records incomplete extraction. The
`RUN_SUMMARY` key-value record contains totals and per-query outcomes. Failed
queries cause a failed run after other queries finish; already saved leads remain
available. Website failures preserve the business lead and show up in the summary.
An explicit no-results page is a completed query with zero leads. An unknown or
blocked page is a query failure, not a successful empty result.

### Local development

Use Python 3.12+ and an isolated environment:

```powershell
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
.\.venv\Scripts\python.exe -m playwright install chromium
.\.venv\Scripts\python.exe -m unittest discover -s tests -v
```

To include browser integration fixtures, set `$env:RUN_BROWSER_TESTS = "1"`
and rerun the unittest command above. These fixtures use routed local HTML.

For a small direct smoke test, save the following as
`storage/key_value_stores/default/INPUT.json`:

```json
{"queries":["Coffee shops Jakarta"],"maxResults":3,"extractEmails":false,"proxyConfiguration":{"useApifyProxy":false}}
```

Then run `.\.venv\Scripts\python.exe -m src`. Results are in local Apify storage.
For deployment, connect this repository in Apify Console and build the Actor.
The Docker image and Python Playwright package are both pinned to 1.60.0; update
both together. The Actor uses root Dockerfile/README auto-discovery.

### Operational limits

This uses Google Maps DOM selectors, which can change. CAPTCHA/consent pages and
regional layouts can prevent extraction; proxies do not guarantee access. Maps
and website visits are sequential; contact requests run in a worker thread so
Actor/browser events remain responsive. No high-volume throughput is promised.
Data is deduplicated within each query by Maps URL; a business matching different
queries may appear once for each query. There is no cross-run resume/deduplication.
Website JavaScript is not rendered for contact discovery. Runtime input validation
and regression tests do not replace a live Apify smoke test on your target region.

# Actor input Schema

## `queries` (type: `array`):

List of keywords or locations to search on Google Maps (e.g. 'Coffee shops in Jakarta', 'Dental clinic Melbourne', 'Lawyers in London').

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

Maximum number of places to collect per search query.

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

Visit the business homepage and one contact/about page to discover public emails and social profiles. Email deliverability is not verified.

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

Language code for Google Maps results (e.g., 'en', 'id', 'es', 'fr').

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

Optional proxy used for Google Maps and contact websites. Leave disabled to run directly, or enable if you have residential proxies.

## Actor input object example

```json
{
  "queries": [
    "Digital marketing agency Jakarta"
  ],
  "maxResults": 5,
  "extractEmails": true,
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": 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 = {
    "queries": [
        "Digital marketing agency Jakarta"
    ],
    "maxResults": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("youuiiiii/gmaps-leads-scraper").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 = {
    "queries": ["Digital marketing agency Jakarta"],
    "maxResults": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("youuiiiii/gmaps-leads-scraper").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 '{
  "queries": [
    "Digital marketing agency Jakarta"
  ],
  "maxResults": 5
}' |
apify call youuiiiii/gmaps-leads-scraper --silent --output-dataset

```

## MCP server setup

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

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/4ce7UqdJadwoRAj6S/builds/sQPBE8oDiyWFNSqgg/openapi.json
