# Google Business Search & Lead Extractor (`thescrapelab/apify-google-maps-b2b-extractor`) Actor

Search Google for businesses and extract high-quality B2B leads instantly. Including scraping reviews.

- **URL**: https://apify.com/thescrapelab/apify-google-maps-b2b-extractor.md
- **Developed by:** [Inus Grobler](https://apify.com/thescrapelab) (community)
- **Categories:** E-commerce, Lead generation, Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.10 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Business Search & Lead Extractor

Search Google for businesses and extract high-quality B2B leads instantly. Collects clean website URLs, phone numbers, ratings, and unique Google IDs (CID). Optimized for high-speed search and low usage cost.

### 🚀 Why choose this extractor?

Unlike other scrapers that rely on fragile CSS classes, this Actor uses **ARIA-first selection** and **Direct CID Extraction**. This means it stays working even when Google updates its layout.

#### Key Data Extracted (Businesses):
| Field | Description |
| :--- | :--- |
| **Business Name** | Official name of the business. |
| **Website** | Clean, direct URL (we bypass Google's redirect tracking). |
| **Phone** | Verified phone number. |
| **Address** | Full physical address. |
| **Category** | Primary business category (e.g., Plumber, Marketing Agency). |
| **Rating & Reviews** | Average stars and total review count. |
| **Coordinates** | High-precision Latitude and Longitude. |
| **Plus Code** | Global location code for precise mapping. |
| **Price Level** | Indicators like $, $$, or $$$ (if available). |
| **Claimed Status** | Tells you if the business has verified their Google profile. |
| **Closed Status** | Detects if a business is temporarily or permanently closed. |
| **Business ID / CID** | A unique 12-char identifier or Google CID to link reviews perfectly to this business. |

#### Deep Review Extraction (Optional)
If you enable review extraction in the settings, the Actor outputs each review as an **entirely separate row/dataset item**, perfectly structured for Pay-Per-Result scaling and database imports. It extracts:
*   **Reviewer Name**
*   **Rating**
*   **Full Text** (automatically expands long text walls)
*   **Publish Date**

---

### 🛠 How to Use

1. **Enter Search Queries**: Add business types and locations (e.g., `Dentists in Miami`, `Roofers near Dallas`).
2. **Set Limits**: Choose how many results you want per query.
3. **Run**: Click Start. The Actor will automatically handle infinite scrolling and detail extraction.
4. **Download**: Export your leads in Excel, CSV, or JSON format.

---

### 💡 Pro Tips

- **Proxies**: We highly recommend using **Apify Residential Proxies** to avoid being blocked by Google.
- **Accuracy**: For the most accurate location data, use specific search queries like `Marketing Agencies in Austin, TX`.
- **Speed**: You can increase the "Max Parallel Tabs" in Advanced Settings to speed up the process if you have enough proxy capacity.

---

### 📊 Sample Output Schema

Because the Actor can fetch reviews, the dataset will contain multiple "types" of rows, cleanly linked by the `businessId`.

#### 1. Business Data Item
```json
{
  "type": "business",
  "businessId": "123456789012345678",
  "businessName": "Joe's Pizza",
  "category": "Pizza Restaurant",
  "rating": 4.8,
  "reviewCount": 1245,
  "priceLevel": "$$",
  "websiteUrl": "https://www.joespizza.com",
  "phoneNumber": "+1 212-555-0123",
  "fullAddress": "7 Carmine St, New York, NY 10014",
  "isClaimed": true,
  "isClosed": null,
  "latitude": "40.7306",
  "longitude": "-73.9996",
  "plusCode": "P2XF+4M New York",
  "cid": "123456789012345678",
  "searchQuery": "Pizza New York"
}
````

#### 2. Connected Review Item (if enabled)

```json
{
  "type": "review",
  "businessId": "123456789012345678",
  "businessName": "Joe's Pizza",
  "reviewerName": "Alice Smith",
  "reviewerRating": 5,
  "reviewText": "The best slice in the city. Always fresh and the crust is incredible!",
  "publishDate": "2 weeks ago"
}
```

***

### ⚖️ Legal & Ethical Use

This tool is for personal and business lead generation. Ensure you comply with all local privacy laws (like GDPR/CCPA) when using the extracted contact data.

# Actor input Schema

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

Which business types or locations are you searching for? (e.g. \['Plumbers in Chicago', 'HVAC near Dallas'])

## `maxPlacesPerQuery` (type: `integer`):

How many businesses should we collect for each specific search?

## `maxReviewsPerPlace` (type: `integer`):

How many reviews to extract per business? (0 = skip reviews for maximum speed)

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

We recommend using Apify Residential Proxies for maximum reliability.

## `sectionAdvanced` (type: `boolean`):

Open to customize language and performance.

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

Language for the Google Maps interface (ISO code).

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

How many browser tabs should run at once? Higher is faster but requires more proxies.

## Actor input object example

```json
{
  "searchQueries": [
    "Plumbers in Chicago"
  ],
  "maxPlacesPerQuery": 1,
  "maxReviewsPerPlace": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "sectionAdvanced": false,
  "language": "en",
  "maxConcurrency": 5
}
```

# Actor output Schema

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

Output stored in the default dataset containing business and review items.

# 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": [
        "Plumbers in Chicago"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thescrapelab/apify-google-maps-b2b-extractor").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": ["Plumbers in Chicago"] }

# Run the Actor and wait for it to finish
run = client.actor("thescrapelab/apify-google-maps-b2b-extractor").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": [
    "Plumbers in Chicago"
  ]
}' |
apify call thescrapelab/apify-google-maps-b2b-extractor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Business Search & Lead Extractor",
        "description": "Search Google for businesses and extract high-quality B2B leads instantly. Including scraping reviews.",
        "version": "0.0",
        "x-build-id": "t00Ji4T8LwCwJkIXh"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/thescrapelab~apify-google-maps-b2b-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-thescrapelab-apify-google-maps-b2b-extractor",
                "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/thescrapelab~apify-google-maps-b2b-extractor/runs": {
            "post": {
                "operationId": "runs-sync-thescrapelab-apify-google-maps-b2b-extractor",
                "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/thescrapelab~apify-google-maps-b2b-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-thescrapelab-apify-google-maps-b2b-extractor",
                "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": [
                    "searchQueries",
                    "maxPlacesPerQuery"
                ],
                "properties": {
                    "searchQueries": {
                        "title": "Search Queries",
                        "type": "array",
                        "description": "Which business types or locations are you searching for? (e.g. ['Plumbers in Chicago', 'HVAC near Dallas'])",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPlacesPerQuery": {
                        "title": "Max Results per Query",
                        "minimum": 1,
                        "type": "integer",
                        "description": "How many businesses should we collect for each specific search?",
                        "default": 1
                    },
                    "maxReviewsPerPlace": {
                        "title": "Max Reviews per Place",
                        "minimum": 0,
                        "type": "integer",
                        "description": "How many reviews to extract per business? (0 = skip reviews for maximum speed)",
                        "default": 0
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Settings",
                        "type": "object",
                        "description": "We recommend using Apify Residential Proxies for maximum reliability.",
                        "default": {
                            "useApifyProxy": true
                        }
                    },
                    "sectionAdvanced": {
                        "title": "Advanced Settings",
                        "type": "boolean",
                        "description": "Open to customize language and performance.",
                        "default": false
                    },
                    "language": {
                        "title": "Language",
                        "type": "string",
                        "description": "Language for the Google Maps interface (ISO code).",
                        "default": "en"
                    },
                    "maxConcurrency": {
                        "title": "Max Parallel Tabs",
                        "minimum": 1,
                        "type": "integer",
                        "description": "How many browser tabs should run at once? Higher is faster but requires more proxies.",
                        "default": 5
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
