# Google Maps Scraper | Lead Gen, Emails & Multi-City Search (`b2b_leads/google-maps-scraper-lead-gen-emails-multi-city-search`) Actor

Google Maps lead generation scraper: parallel multi-city keyword search, business email finder, phone, website & ratings. Nearby discovery, place URLs, lead filters & webhooks. Real-time data for outbound sales, agencies, local SEO & market research. Fast, no browser.

- **URL**: https://apify.com/b2b\_leads/google-maps-scraper-lead-gen-emails-multi-city-search.md
- **Developed by:** [Chidubem Aneke](https://apify.com/b2b_leads) (community)
- **Categories:** Lead generation, Travel, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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/platform/actors/running/actors-in-store#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 Real-Time Data

**Collect local business intelligence from Google Maps at scale.** Search multiple cities and keywords in one run, discover nearby competitors, extract place details and reviews, and filter for sales-ready leads — all as **clean, structured JSON** streamed to your Apify dataset in real time.

Built for agencies, growth teams, data engineers, and AI workflows that need **reliable Google Maps data** without slow, expensive browser automation.

***

### Why this Actor

| | Google Maps Real-Time Data | Typical browser scraper |
|---|---------------------------|-------------------------|
| **Speed** | Fast per-result collection | Often 5–15 s per place |
| **Memory** | **512 MB** default | 2–4 GB+ |
| **Setup** | Organized input UI, run immediately | Often fragile & high-maintenance |
| **Cost** | Low compute, efficient proxy use | High |
| **Output** | Structured JSON, LLM-ready | Often messy HTML |
| **Scale** | Large runs — **10,000+ items** per run | Often capped lower |
| **Multi-market** | Many keyword + location pairs per run | Usually one query at a time |

***

### What you get — 40+ data points per place

Every record includes `featureType` and `scrapedAt` so you can filter, join, and pipe into any workflow.

#### Search results (`featureType: "search"`)

| Field | Description |
|-------|-------------|
| `title`, `category`, `categories[]` | Business name and types |
| `address`, `completeAddress`, `neighborhood` | Full location breakdown (street, city, state, ZIP, country) |
| `phone`, `website` | Contact channels |
| `rating`, `reviewCount`, `reviewsPerRating` | Reputation signals |
| `latitude`, `longitude`, `placeUrl` | Coordinates and Maps link |
| `openHours`, `status`, `description` | Hours, open/closed, summary |
| `priceRange`, `thumbnail`, `images[]` | Price tier and photos |
| `reservations[]`, `orderOnline[]`, `menu` | Booking and ordering links |
| `owner` | Owner name and profile link when available |
| `searchQuery`, `searchLocation` | Which search produced this row |
| `searchTaskIndex`, `searchTaskLabel` | Traceability for multi-task runs |
| `position` | Rank in search results |

#### Nearby discovery (`featureType: "nearby"`)

Same rich place fields as search, tagged for category-based discovery around a map point (restaurants, dentists, hotels, gyms, and 14 more categories).

#### Place details (`featureType: "place"` or `"scrape_by_url"`)

Full structured profile for a specific Google Maps URL — ideal when you already have a list of businesses to enrich.

#### Reviews (`featureType: "review"`)

| Field | Description |
|-------|-------------|
| `authorName`, `authorUrl`, `authorPhoto` | Reviewer identity |
| `rating`, `text`, `textTranslated` | Score and content |
| `relativeDate`, `publishedAt` | When the review was posted |
| `likes`, `images[]` | Engagement and photos |
| `ownerResponse`, `ownerResponseDate` | Business reply |
| `placeTitle`, `placeUrl`, `placeId` | Linked business |

Set `includeRaw: true` to attach extended debug data on any record (larger output, for advanced users).

***

### Reliability by feature

| Capability | Search / Nearby | Place URLs | Notes |
|------------|-----------------|------------|-------|
| **Fast place listing** | ✅ Reliable | ✅ | Core strength — no browser |
| **Rating & review count** | ✅ Always included | ✅ | From search/preview — no extra request |
| **Extended details** (phone, hours, description) | ✅ With `fetchExtendedDetails` | ✅ | One lightweight preview request per place |
| **Email discovery** | ✅ With `fetchEmails` | ✅ | Website + Maps page scan — best for lead gen |
| **Full review text** | ❌ Not on search | ⚠️ Best-effort | Use dedicated **Reviews** feature with place URLs |

Search and nearby always emit **one row per business** — review text never mixes into the place table.

***

### Features

#### Search terms & locations — on by default

Run **multiple keyword + location pairs in one actor run** — e.g. *restaurants in Manhattan* and *dentists in Brooklyn* side by side. Each task has its own max results limit. Filters include minimum rating, price level, open now, phone/website required, category contains, and permanently closed exclusion.

Every search result includes **rating** and **reviewCount** automatically. Enable **Fetch extended details** for phone, hours, and descriptions (one extra request per business). Enable **Find emails** for lead-gen contact discovery (`emails[]` on each place).

#### Nearby Discovery

Automatically map a local market: pick from 18 business categories (restaurants, hotels, cafes, dentists, lawyers, hospitals, and more) around a city or area. Set radius in meters and cap results per category.

#### Place Details

Paste Google Maps place URLs (including `maps.app.goo.gl` short links). Get name, address, phone, website, hours, ratings, images, reservations, menus, and optional reviews as separate rows.

#### Reviews

Dedicated review extraction for specific place URLs — text, author, rating, date, photos, and owner responses. Filter by minimum review rating.

#### Scrape By URL

Quick path for any supported Maps URL — same rich output as Place Details.

#### Lead Generation Filters

Layer extra filters on search and nearby output: require phone, require website, minimum rating. Perfect for outbound sales and local lead-gen lists.

***

### Use cases

- **Local lead generation** — plumbers, dentists, lawyers, agencies with phone + website + rating filters
- **Multi-city prospecting** — one run across dozens of keyword + location pairs
- **Competitive mapping** — nearby discovery to see who operates in a neighborhood or radius
- **Reputation monitoring** — pull reviews for your locations or competitors
- **Market research** — compare density, ratings, and categories across regions
- **Data enrichment** — start from a URL list and backfill structured business profiles
- **AI & LLM pipelines** — JSON for RAG, scoring, outreach drafts, and territory summaries
- **CRM & warehouse feeds** — push dataset items via Apify API, optional real-time webhook, or integrations

***

### LLM & MCP integration

Output is **JSON Lines–friendly structured data** — ideal for ChatGPT, Claude, Gemini, LangChain, LlamaIndex, and custom agents.

#### Recommended workflow

1. Run the Actor with the features you need (search tasks, nearby, URLs, etc.).
2. Fetch dataset items via [Apify API](https://docs.apify.com/api/v2) or export JSON/CSV.
3. Pass records to your LLM with a system prompt, or index into a vector store.

#### Example: single business for an LLM prompt

```json
{
  "featureType": "search",
  "title": "Brooklyn Dental Studio",
  "category": "Dentist",
  "address": "123 Main St, Brooklyn, NY 11201",
  "phone": "(718) 555-0142",
  "website": "https://example.com",
  "rating": 4.8,
  "reviewCount": 214,
  "searchTaskLabel": "dentists | Brooklyn, NY",
  "placeUrl": "https://www.google.com/maps/place/?q=place_id:ChIJ..."
}
```

#### Apify MCP (Model Context Protocol)

Use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) so AI assistants can:

- **Run** this Actor with natural-language instructions
- **Read** dataset results directly in the chat
- **Chain** with other Actors (e.g. enrich → score → CRM)

Typical MCP tool flow:

```
User: "Find 30 highly rated Italian restaurants in Manhattan and summarize each for outreach"
→ MCP runs Actor with searchTasks=[{ query: "Italian restaurants", location: "Manhattan, NY" }], minRating=4
→ MCP reads dataset items
→ LLM summarizes and drafts emails
```

#### API quick start

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enableSearch": true,
    "searchTasks": [
      { "query": "plumbers", "location": "Austin, TX", "placesPerQuery": 50 },
      { "query": "electricians", "location": "Dallas, TX", "placesPerQuery": 50 }
    ],
    "leadRequirePhone": true,
    "enableLeadFilters": true
  }'
```

Dataset items: `GET https://api.apify.com/v2/datasets/{datasetId}/items?format=json`

***

### Input reference

Enable only what you need. All features are independent.

| Input | Type | Default | Description |
|-------|------|---------|-------------|
| **Search terms & locations** | | | |
| `enableSearch` | boolean | `true` | Keyword + location search |
| `searchTasks` | object\[] | 2 example tasks | Primary input: `{ query, location, placesPerQuery? }` per row |
| `placesPerQuery` | integer | `20` | Default max businesses per search task |
| `maxPagesPerQuery` | integer | `50` | Pagination depth cap per task |
| `minRating` | number | — | Minimum star rating (0–5) |
| `priceLevels` | enum\[] | — | free, inexpensive, moderate, expensive, very\_expensive |
| `openNow` | boolean | `false` | Open right now only |
| `excludeClosed` | boolean | `true` | Skip permanently closed |
| `requirePhone` | boolean | `false` | Must have phone |
| `requireWebsite` | boolean | `false` | Must have website |
| `categoryFilter` | string | — | Category text filter |
| `fetchExtendedDetails` | boolean | `false` | Richer hours, phone & descriptions (1 extra request per business) |
| `fetchEmails` | boolean | `false` | Find emails on Maps page + business website (`emails[]` on each place) |
| **Nearby Discovery** | | | |
| `enableNearby` | boolean | `false` | Category discovery around a location |
| `nearbyCategories` | enum\[] | 5 defaults | restaurants, hotels, cafes, dentists, gyms, … (18 total) |
| `nearbyLocation` | string | — | City or area name |
| `nearbyRadiusMeters` | integer | `5000` | Search radius (100–100,000 m) |
| `placesPerCategory` | integer | `20` | Max per category |
| **Place Details** | | | |
| `enablePlaceDetails` | boolean | `false` | Scrape place URLs |
| `placeUrls` | string\[] | — | Maps or short links |
| `fetchReviewsOnDetails` | boolean | `true` | Emit reviews as separate rows |
| `maxReviewsPerPlace` | integer | `20` | Review cap per place |
| `includeImages` | boolean | `true` | Photo URLs |
| **Reviews** | | | |
| `enableReviews` | boolean | `false` | Dedicated review scraping |
| `reviewPlaceUrls` | string\[] | — | Place URLs |
| `reviewsPerPlace` | integer | `50` | Max reviews per URL |
| `minReviewRating` | integer | — | Filter (1–5) |
| `includeReviewImages` | boolean | `true` | Review photos |
| `includeOwnerResponses` | boolean | `true` | Owner replies |
| **Scrape By URL** | | | |
| `enableScrapeByUrl` | boolean | `false` | Paste any supported Maps URL |
| `scrapeUrls` | string\[] | — | URL list |
| **Lead Generation** | | | |
| `enableLeadFilters` | boolean | `false` | Extra filters on search/nearby |
| `leadRequirePhone` | boolean | `true` | Leads must have phone |
| `leadRequireWebsite` | boolean | `false` | Leads must have website |
| `leadMinRating` | number | — | Minimum rating |
| **Output & limits** | | | |
| `language` | string | `en` | Results language |
| `country` | string | `us` | Region for localized results |
| `maxItems` | integer | `10000` | Global cap across all features (set higher for large runs) |
| `webhookUrl` | string | — | Optional real-time POST URL — dataset is always written; webhook is additional |
| `webhookFormat` | enum | `json` | `json` (full record) or `slack` (Slack message) |
| `includeRaw` | boolean | `false` | Attach debug payload |
| `proxyConfiguration` | object | residential US | Apify proxy settings |

Full schema: see `.actor/input_schema.json` or the **Input** tab on Apify Console.

***

### Output reference

Each dataset row is one record. Filter by `featureType`:

| `featureType` | Description |
|---------------|-------------|
| `search` | Business from keyword search |
| `nearby` | Business from nearby category discovery |
| `place` | Business from Place Details URL |
| `scrape_by_url` | Business from Scrape By URL |
| `review` | Single review (linked to a place) |

**Traceability fields on search results:**

- `searchTaskIndex` — 0-based task number
- `searchTaskLabel` — e.g. `"restaurants | Manhattan, NY"`

Export formats: **JSON**, **CSV**, **Excel**, **RSS**, or via **API**.

***

### Webhook delivery (optional)

Every record is **always saved to the Apify dataset** first. If you set `webhookUrl` in the **Output & limits** section, each new record is **also POSTed in real time** to your endpoint — useful for CRMs, Slack, Zapier, Make, or custom pipelines.

| Setting | Description |
|---------|-------------|
| `webhookUrl` | Your endpoint (https). Leave empty to use dataset only. |
| `webhookFormat` | `json` — full place or review object. `slack` — compact Slack incoming-webhook message. |

Webhook delivery is **best-effort**: a failed webhook never stops the run or prevents dataset writes.

**Example — search with Slack alerts**

```json
{
  "enableSearch": true,
  "searchTasks": [{ "query": "coffee shops", "location": "Seattle, WA", "placesPerQuery": 50 }],
  "webhookUrl": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
  "webhookFormat": "slack"
}
```

**Example — search with emails + JSON webhook**

```json
{
  "enableSearch": true,
  "searchTasks": [{ "query": "dentists", "location": "Chicago, IL" }],
  "fetchEmails": true,
  "fetchExtendedDetails": true,
  "webhookUrl": "https://your-crm.example.com/api/leads",
  "webhookFormat": "json"
}
```

***

### Quick start examples

**Multi-city lead gen (default pattern)**

```json
{
  "enableSearch": true,
  "searchTasks": [
    { "query": "roofing contractors", "location": "Phoenix, AZ", "placesPerQuery": 100 },
    { "query": "roofing contractors", "location": "Tucson, AZ", "placesPerQuery": 100 }
  ],
  "enableLeadFilters": true,
  "leadRequirePhone": true,
  "leadMinRating": 4,
  "minRating": 4
}
```

**Nearby market map**

```json
{
  "enableSearch": false,
  "enableNearby": true,
  "nearbyLocation": "Miami, FL",
  "nearbyRadiusMeters": 3000,
  "nearbyCategories": ["restaurants", "bars", "hotels", "beauty_salons"],
  "placesPerCategory": 30
}
```

**Enrich a URL list**

```json
{
  "enableSearch": false,
  "enablePlaceDetails": true,
  "placeUrls": [
    "https://maps.app.goo.gl/example1",
    "https://www.google.com/maps/place/?q=place_id:ChIJ..."
  ],
  "fetchReviewsOnDetails": true,
  "maxReviewsPerPlace": 25
}
```

**Search with emails + extended details (lead gen)**

```json
{
  "enableSearch": true,
  "searchTasks": [{ "query": "Italian restaurants", "location": "Boston, MA", "placesPerQuery": 30 }],
  "fetchExtendedDetails": true,
  "fetchEmails": true,
  "minRating": 4,
  "requireWebsite": true
}
```

**Reviews only (specific URLs)**

```json
{
  "enableSearch": false,
  "enableReviews": true,
  "reviewPlaceUrls": ["https://www.google.com/maps/place/?q=place_id:ChIJ..."],
  "reviewsPerPlace": 100,
  "minReviewRating": 4,
  "includeOwnerResponses": true
}
```

***

### Proxy & performance

- **Apify residential proxy (US)** is **enabled by default** — no extra setup required on Apify.
- Default memory: **512 MB** — enough headroom for most runs without users needing to tune it.
- Results are **streamed to the dataset** as they are collected; long runs do not pile up data in memory.

***

### Limitations & compliance

- Review volume may be limited by what Google Maps displays for a given place.
- Not affiliated with Google. Use responsibly and comply with applicable laws and Google's Terms of Service.
- Always respect rate limits, robots terms, and local regulations when collecting business data.

***

### Contact & custom work

Need something beyond this Actor? I build **custom scrapers**, **data pipelines**, and **full-stack web applications** for startups and enterprises.

- **Email:** <dubem115@gmail.com>
- **GitHub:** [github.com/DrunkCodes](https://github.com/DrunkCodes)

Reach out for:

- Custom Apify Actors (any website or data source)
- Google Maps / local SEO / reputation data projects at scale
- LLM & MCP integrations with your data stack
- Web apps, dashboards, and automation tools

***

*Google Maps Real-Time Data · by [DrunkCodes](https://github.com/DrunkCodes)*

# Actor input Schema

## `enableSearch` (type: `boolean`):

Search Google Maps by keyword and location. Enabled by default.

## `searchTasks` (type: `array`):

Add one row per search. Pair a keyword with a city or area.

## `placesPerQuery` (type: `integer`):

Default maximum businesses per search task. Override per task in the list above.

## `maxPagesPerQuery` (type: `integer`):

Maximum depth to paginate each search (safety cap for very large runs).

## `minRating` (type: `number`):

Only keep places with at least this star rating (0–5). Leave empty for no filter.

## `priceLevels` (type: `array`):

Filter by price level when Google exposes it on the listing.

## `openNow` (type: `boolean`):

Skip places that appear closed right now.

## `excludeClosed` (type: `boolean`):

Skip permanently closed businesses.

## `requirePhone` (type: `boolean`):

Only return places that have a phone number.

## `requireWebsite` (type: `boolean`):

Only return places that have a website URL.

## `categoryFilter` (type: `string`):

Keep only places whose category list contains this text (e.g. "dentist", "hotel").

## `fetchEmails` (type: `boolean`):

Reliable lead-gen option: scans the business website and Google Maps page for contact emails. Adds emails\[] on each place row. Works independently of extended details.

## `enableNearby` (type: `boolean`):

Discover businesses by category around a city or area (restaurants, hotels, dentists, etc.).

## `nearbyCategories` (type: `array`):

Business categories to discover nearby. All selected by default when Nearby is enabled.

## `nearbyLocation` (type: `string`):

City or area for nearby discovery (e.g. "Miami, FL").

## `nearbyRadiusMeters` (type: `integer`):

Search radius around the location. Zoom is auto-calculated from this.

## `placesPerCategory` (type: `integer`):

Maximum places to collect per nearby category.

## `enablePlaceDetails` (type: `boolean`):

Scrape full structured data for specific Google Maps place URLs.

## `placeUrls` (type: `array`):

Google Maps place URLs or maps.app.goo.gl short links.

## `includeImages` (type: `boolean`):

Extract photo URLs when available on place detail pages.

## `enableScrapeByUrl` (type: `boolean`):

Scrape any supported Google Maps URL (place links, short links).

## `scrapeUrls` (type: `array`):

Google Maps URLs to scrape.

## `enableLeadFilters` (type: `boolean`):

Apply extra lead-generation filters on search and nearby results.

## `leadRequirePhone` (type: `boolean`):

Only keep places with a phone number.

## `leadRequireWebsite` (type: `boolean`):

Only keep places with a website.

## `leadMinRating` (type: `number`):

Only keep places rated at least this high.

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

Language for business names and addresses (e.g. en, es, de).

## `country` (type: `string`):

Country or region for localized results (e.g. us, uk, de).

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

Global cap on total dataset rows across all features. Set high for large runs (e.g. 10000+).

## `webhookUrl` (type: `string`):

Optional. Every record is always saved to the run's dataset — this webhook is an ADDITIONAL real-time push. When set, each new record is also POSTed to this URL (CRM, Slack incoming webhook, Zapier, Make, Google Sheets).

## `webhookFormat` (type: `string`):

json = full record object; slack = Slack-friendly message payload.

## `includeRaw` (type: `boolean`):

Include extra debug data on each record. Larger output — for advanced users only.

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

Apify residential proxy (US) is enabled by default for reliable Google Maps collection.

## Actor input object example

```json
{
  "enableSearch": true,
  "searchTasks": [
    {
      "query": "restaurants",
      "location": "Manhattan, NY"
    },
    {
      "query": "dentists",
      "location": "Brooklyn, NY"
    }
  ],
  "placesPerQuery": 20,
  "maxPagesPerQuery": 50,
  "priceLevels": [],
  "openNow": false,
  "excludeClosed": true,
  "requirePhone": false,
  "requireWebsite": false,
  "categoryFilter": "",
  "fetchEmails": false,
  "enableNearby": false,
  "nearbyCategories": [
    "restaurants",
    "hotels",
    "cafes",
    "dentists",
    "gyms"
  ],
  "nearbyLocation": "",
  "nearbyRadiusMeters": 5000,
  "placesPerCategory": 20,
  "enablePlaceDetails": false,
  "placeUrls": [],
  "includeImages": true,
  "enableScrapeByUrl": false,
  "scrapeUrls": [],
  "enableLeadFilters": false,
  "leadRequirePhone": true,
  "leadRequireWebsite": false,
  "language": "en",
  "country": "us",
  "maxItems": 10000,
  "webhookUrl": "",
  "webhookFormat": "json",
  "includeRaw": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `allResults` (type: `string`):

Complete dataset with every field from all enabled features in this run.

## `search` (type: `string`):

Businesses from keyword + location search.

## `nearby` (type: `string`):

Businesses from nearby category discovery.

## `places` (type: `string`):

Place detail rows from URLs.

# 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 = {
    "enableSearch": true,
    "searchTasks": [
        {
            "query": "restaurants",
            "location": "Manhattan, NY"
        },
        {
            "query": "dentists",
            "location": "Brooklyn, NY"
        }
    ],
    "placesPerQuery": 20,
    "excludeClosed": true,
    "fetchEmails": false,
    "includeImages": true,
    "leadRequirePhone": true,
    "language": "en",
    "country": "us",
    "maxItems": 10000,
    "includeRaw": false,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b_leads/google-maps-scraper-lead-gen-emails-multi-city-search").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 = {
    "enableSearch": True,
    "searchTasks": [
        {
            "query": "restaurants",
            "location": "Manhattan, NY",
        },
        {
            "query": "dentists",
            "location": "Brooklyn, NY",
        },
    ],
    "placesPerQuery": 20,
    "excludeClosed": True,
    "fetchEmails": False,
    "includeImages": True,
    "leadRequirePhone": True,
    "language": "en",
    "country": "us",
    "maxItems": 10000,
    "includeRaw": False,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("b2b_leads/google-maps-scraper-lead-gen-emails-multi-city-search").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 '{
  "enableSearch": true,
  "searchTasks": [
    {
      "query": "restaurants",
      "location": "Manhattan, NY"
    },
    {
      "query": "dentists",
      "location": "Brooklyn, NY"
    }
  ],
  "placesPerQuery": 20,
  "excludeClosed": true,
  "fetchEmails": false,
  "includeImages": true,
  "leadRequirePhone": true,
  "language": "en",
  "country": "us",
  "maxItems": 10000,
  "includeRaw": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call b2b_leads/google-maps-scraper-lead-gen-emails-multi-city-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=b2b_leads/google-maps-scraper-lead-gen-emails-multi-city-search",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/ZmxcXmLJ3kXb6HCnL/builds/6cgdr40AjNgWYOfTb/openapi.json
