# Google Maps Extractor (`scraply/google-maps-extractor`) Actor

🚀 Google Maps Extractor (google-maps-extractor) streamlines extracting business listings, contacts, and locations from Google Maps. 🏪 Perfect for market research, lead generation, and outreach. 📈 Fast, reliable, and easy to use.

- **URL**: https://apify.com/scraply/google-maps-extractor.md
- **Developed by:** [Scraply](https://apify.com/scraply) (community)
- **Categories:** Lead generation, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 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/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 Extractor

Google Maps Extractor is an Apify Actor built for bulk business discovery, lead generation, and local market research directly from Google Maps. It automates grid-based coverage for every location you give it, adds an automatic proxy ladder (direct → datacenter → residential with sticky fallback), and writes clean, deduplicated results to both the Apify Dataset and a final `maps.json` file in the Key-Value Store.

### Why teams pick this extractor
- Bulk inputs: mix locations, keywords, and direct Google Maps URLs in one run.
- Reliable harvesting: retries and proxy escalation when Google rate-limits or blocks.
- Wide coverage: grid-based viewports keep searches from missing pockets of businesses.
- Clean outputs: deduplication by `place_id` and optional review capture.
- Ready to use: sorted dataset, final merged JSON, and clear Apify logs for progress.

### What the extractor collects
- Core business details: name, website, tags, phone, address, lat/long, place_id.
- Quality signals: rating, review counts, optional detailed reviews (text, author, rating, timestamps).
- Hours and metadata: opening hours (best-effort), notes, success flag.

### Input reference
Minimal example:
```json
{
  "locations": ["New York"],
  "keywords": ["coffee shops"],
  "urls": [],
  "sortOrder": "relevance",
  "maxComments": 0,
  "maxResults": 200,
  "gridSize": 15,
  "proxyConfiguration": { "useApifyProxy": false }
}
````

Field details:

- `locations` (array): City/region names used to build grid viewports. Optional if `urls` are provided.
- `keywords` (array, required): Search keywords/terms.
- `urls` (array): Direct Google Maps search URLs (bulk supported).
- `sortOrder` (string): `relevance` | `rating` | `review_count` | `distance` | `name`.
- `maxComments` (integer): Reviews per place. `0` disables review scraping.
- `maxResults` (integer): Cap on total places across the whole run.
- `gridSize` (integer): Grid dimension per viewport; larger values increase coverage but take longer.
- `proxyConfiguration` (object): Default is direct. Actor escalates to datacenter and then residential (sticky) on blocks.

### Output formats

- Dataset: one item per place with address, rating, reviews count, phone, tags, hours, lat/long, `place_id`, and `success`.
- Key-Value Store: `maps.json` containing the final, sorted list.

Sample dataset item:

```json
{
  "name": "Sample Coffee",
  "website": "https://samplecoffee.com",
  "avg_rating": 4.6,
  "total_reviews": 128,
  "street_address": "123 Main St",
  "city": "New York",
  "state": "NY",
  "zip": "10001",
  "country_code": "US",
  "full_address": "123 Main St New York NY 10001 US",
  "tags": ["Coffee shop"],
  "notes": null,
  "place_id": "abcd1234",
  "phone": "+1 212-555-0100",
  "lat": 40.75,
  "long": -73.99,
  "hours": [],
  "success": true
}
```

### How to run on Apify

1. Open https://console.apify.com and select Google Maps Extractor.
2. Provide inputs: locations plus keywords, or paste Google Maps search URLs.
3. Leave proxy blank to start direct; the actor will auto-fallback to proxies if blocked.
4. Run and monitor logs for grid coverage, proxy switches, and review progress.
5. Download results from Dataset (table/JSON/CSV) or from Key-Value Store as `maps.json`.

### Best use cases

- Local lead lists by category and city for sales outreach.
- Competitive scans across multiple regions.
- Enriching existing place records with ratings, phones, and addresses.
- Building marketing prospect lists for franchises or multi-location brands.
- Market validation for site selection and territory planning.

### FAQ

- **Will it always collect reviews?** Reviews are best-effort; set `maxComments > 0` to enable.
- **What if Google blocks me?** The actor escalates from direct to datacenter to residential (sticky) with retries and logs each change.
- **How many results can I fetch?** Up to `maxResults` total; `gridSize` controls coverage vs speed.
- **How is sorting applied?** Final results in `maps.json` are sorted by the chosen `sortOrder`.
- **Can I mix URLs and keywords?** Yes. The actor processes location/keyword combos first, then direct URLs.

### Compliance

- Data comes from public Google Maps pages.
- Always follow local laws and Google’s terms; you are responsible for how the data is used.

# Actor input Schema

## `locations` (type: `array`):

🏙️ Examples: *New York*, *Texas*, *Downtown Chicago* — mix and match for bulk coverage.

## `keywords` (type: `array`):

☕ Describe the businesses or places you care about — *coffee shops*, *dentists*, *coworking*, *hotels near airport*, and so on. 📝 Add many keywords to multiply your searches!

## `urls` (type: `array`):

🌐 Bulk-friendly list of map links. ✨ Great when you’ve bookmarked exact searches.

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

🔢 Total unique places across **all** locations, keywords, and URLs (duplicates are merged automatically). ✨ Default is friendly for quick tests; raise it for big lists.

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

🎛️ Optional Apify Proxy — leave off for simple runs; turn on for heavier jobs or picky networks.

## Actor input object example

```json
{
  "locations": [
    "New York"
  ],
  "keywords": [
    "coffee shops"
  ],
  "urls": [],
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "locations": [
        "New York"
    ],
    "keywords": [
        "coffee shops"
    ],
    "urls": [],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraply/google-maps-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 = {
    "locations": ["New York"],
    "keywords": ["coffee shops"],
    "urls": [],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("scraply/google-maps-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 '{
  "locations": [
    "New York"
  ],
  "keywords": [
    "coffee shops"
  ],
  "urls": [],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call scraply/google-maps-extractor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Maps Extractor",
        "description": "🚀 Google Maps Extractor (google-maps-extractor) streamlines extracting business listings, contacts, and locations from Google Maps. 🏪 Perfect for market research, lead generation, and outreach. 📈 Fast, reliable, and easy to use.",
        "version": "0.1",
        "x-build-id": "DkJbOFOelzyCo43t1"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scraply~google-maps-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scraply-google-maps-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/scraply~google-maps-extractor/runs": {
            "post": {
                "operationId": "runs-sync-scraply-google-maps-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/scraply~google-maps-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-scraply-google-maps-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": [
                    "keywords"
                ],
                "properties": {
                    "locations": {
                        "title": "📍 Cities, regions, or neighborhoods",
                        "type": "array",
                        "description": "🏙️ Examples: *New York*, *Texas*, *Downtown Chicago* — mix and match for bulk coverage.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "keywords": {
                        "title": "🔎 What to find (keywords)",
                        "type": "array",
                        "description": "☕ Describe the businesses or places you care about — *coffee shops*, *dentists*, *coworking*, *hotels near airport*, and so on. 📝 Add many keywords to multiply your searches!",
                        "items": {
                            "type": "string"
                        }
                    },
                    "urls": {
                        "title": "🔗 Optional: Google Maps links",
                        "type": "array",
                        "description": "🌐 Bulk-friendly list of map links. ✨ Great when you’ve bookmarked exact searches.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "🎯 How many places to collect",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "🔢 Total unique places across **all** locations, keywords, and URLs (duplicates are merged automatically). ✨ Default is friendly for quick tests; raise it for big lists.",
                        "default": 20
                    },
                    "proxyConfiguration": {
                        "title": "🌐 Connection & reliability",
                        "type": "object",
                        "description": "🎛️ Optional Apify Proxy — leave off for simple runs; turn on for heavier jobs or picky networks."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
