# fast-google-maps-scraper (`nodeflow/googlemapscrapper`) Actor

Extract B2B leads from Google Maps at lightning speed. Scrape business names, phone numbers, addresses, websites, and reviews. Ultra-fast network interception. Pay only for successful results. Perfect for cold outreach and lead generation.

- **URL**: https://apify.com/nodeflow/googlemapscrapper.md
- **Developed by:** [NodeFlow](https://apify.com/nodeflow) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.50 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

## 🚀 Google Maps Fast & Cheap Lead Scraper

**The ultimate Fast & Cheap solution for B2B Lead Generation on Google Maps!**

Stop paying for slow, expensive DOM scrapers. This ultra-fast **Google Maps B2B Lead Extractor** intercepts network traffic directly, bypassing the need to render complex HTML. It delivers **clean, accurate, and high-volume business data** at a fraction of the cost and time, ensuring your scraping operations are both **Fast & Cheap**.

If you are building B2B cold outreach campaigns, local SEO lists, or market research databases, this scraper is designed to provide you with reliable data instantly, giving you a competitive edge.

Extract Google Maps business leads at high speed without reading result cards or other page HTML. The Actor listens to the same background XHR/fetch responses used by Google Maps, parses business records in memory, and writes every unique result directly to the Apify dataset.

### Features

- **No DOM scraping** — business data is never read from HTML elements or CSS selectors.
- **Ultra-fast network interception** — captures Google Maps search and place payloads as they arrive.
- **Low memory usage** — blocks images, media, and fonts and streams records directly to the dataset.
- **B2B lead generation ready** — exports company names, phones, websites, addresses, ratings, and review counts.
- **Pay-per-event ready** — every stored business emits the `business-result` charge event.
- **Duplicate protection** — de-duplicates places before storing and charging for them.
- **Zero API keys** — no Google Maps API key is required.

### How it works

1. The Actor opens a Google Maps search with Crawlee and Playwright.
2. A response listener captures relevant Google Maps XHR/fetch traffic before navigation begins.
3. The parser handles XSSI-prefixed JSON, nested batched responses, compact Maps arrays, and length-delimited protobuf payloads.
4. If Google presents a regional consent dialog, the Actor accepts it and waits for the results feed. These selectors are used only for page control, never for extracting business data.
5. The Actor scrolls `div[role="feed"]` to trigger additional network requests.
6. Each unique business is immediately stored with `Actor.pushData()`.

Google Maps is an evolving third-party service. Network payload formats, availability, and result counts can change. Use this Actor responsibly and make sure your use complies with applicable laws and Google’s terms.

### Input parameters

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `searchQuery` | string | Yes | `Web design agencies in London` | A Google Maps search phrase, such as `Restaurants in London` or `Plumbers in Berlin`. |
| `maxItems` | integer | No | `20` | Maximum unique businesses to store. Accepted range: 1–500. |

#### Input example

```json
{
  "searchQuery": "Dentists in Manchester",
  "maxItems": 50
}
```

### Output example

Results are available in the run’s default dataset and can be seamlessly downloaded as JSON, CSV, Excel, XML, or RSS for your CRM and outreach tools.

```json
{
  "companyName": "Manchester Dental Professionals",
  "phone": "+44 20 1234 5678",
  "website": "https://manchesterdentalpros.co.uk/",
  "address": "10 High Street, Manchester, M1 1PT, UK",
  "category": "Dental Clinic",
  "rating": 4.8,
  "reviewCount": 247,
  "googleMapsUrl": "https://goo.gl/maps/exampleID"
}
```

Unavailable optional values are returned as `null`, preserving a stable output shape for integrations.

### Run locally

Node.js 20 or newer is required.

```bash
npm install
npm start
```

Local input is read from `storage/key_value_stores/default/INPUT.json`. Local results are written under `storage/datasets/default/`.

### Deploy from GitHub

1. Push this complete repository to GitHub.
2. In Apify Console, create an Actor and choose **Git repository** as its source.
3. Connect the repository and build the `latest` version. The included manifest, schemas, and Dockerfile require no source-code changes.
4. For pay-per-event monetization, select that pricing model and define `business-result` as the primary recurring event. Choose the price per saved business in Apify Console.

The code checks the run’s charge limit through `Actor.pushData(record, 'business-result')`; when the customer’s limit is reached, it stops storing additional results.

### Run diagnostics

Every run emits concise diagnostic markers in the Apify log:

- `[CONSENT]` — reports whether a Google consent screen was detected and dismissed.
- `[NETWORK]` — confirms that a Google Maps XHR/fetch data response was intercepted.
- `[PARSER]` — reports payload size, parsed record count, and each extracted company name.
- `[DATASET]` — confirms the item was written to the default dataset while emitting the `business-result` event.
- `[SCROLL]` — reports loading and scroll progress for `div[role="feed"]`.

A run that extracts no businesses now fails with captured-response and parser counters instead of silently finishing with an empty output.

### Data quality notes

- Phone numbers and websites are returned only when Google includes them in intercepted payloads.
- Google may return fewer places than requested for narrow searches or small geographic areas.
- Broad queries with a city or region generally produce the most consistent results.
- Proxy availability and Google rate limits can affect runs. On Apify, the Actor automatically uses the account’s default proxy configuration when available.

# Actor input Schema

## `searchQuery` (type: `string`):

e.g. Restaurants in London or Plumbers in Berlin

## `maxItems` (type: `integer`):

Maximum number of businesses to scrape

## Actor input object example

```json
{
  "searchQuery": "Web design agencies in London",
  "maxItems": 20
}
```

# Actor output Schema

## `businesses` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("nodeflow/googlemapscrapper").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("nodeflow/googlemapscrapper").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 '{}' |
apify call nodeflow/googlemapscrapper --silent --output-dataset

```

## MCP server setup

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

```

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/bfagx4NELAPAlEjNA/builds/McypRKDLWaXj9IamV/openapi.json
