# Google Maps Places Scraper (`scrapeai/google-maps-places-scraper`) Actor

Retrieve verified business data directly from the Google Maps API. Search by keyword and location to collect structured details such as business name, phone number, address, website, ratings, reviews, and more—ideal for B2B lead generation, market research, and business intelligence

- **URL**: https://apify.com/scrapeai/google-maps-places-scraper.md
- **Developed by:** [ScrapeAI](https://apify.com/scrapeai) (community)
- **Categories:** Lead generation, Developer tools, Automation
- **Stats:** 31 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$4.99/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## 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 Places Scraper - API Based

This Apify actor retrieves verified business data exclusively through the Google Maps API. Search by keyword and location to collect structured business information including name, phone, address, website, ratings, reviews, and more. Perfect for B2B lead generation, market research, and business intelligence.

### ✅ Use Cases

- 📇 Generate local business leads with verified ratings
- 💬 Build contact lists for cold outreach campaigns
- 🏙️ Conduct market research by city and category
- 🧭 Perform competitive analysis in your niche
- 📊 Gather structured business intelligence

### 📥 Input Configuration

You can customize the actor using the following input fields:

```json
{
    "searchStringsArray": ["software companies", "tech startups"],
    "locationQuery": "Bangalore, India",
    "maxCrawledPlacesPerSearch": 50,
    "skipClosedPlaces": true,
    "placeMinimumStars": "4.0",
    "language": "en"
}
````

#### 🧾 Fields Explained

| Field | Type | Description |
|-------|------|-------------|
| `searchStringsArray` | array | Array of search terms (e.g., "restaurants", "software companies") |
| `locationQuery` | string | Geographic location to search in (e.g., "Bangalore, India") |
| `maxCrawledPlacesPerSearch` | number | Maximum number of places to retrieve per search query (1-500) |
| `skipClosedPlaces` | boolean | Whether to exclude closed places or those with no opening hours |
| `placeMinimumStars` | string | Minimum star rating for places (e.g., "4.0") |
| `language` | string | Language code for results (e.g., "en" for English) |

### 📤 Output

The actor returns a dataset containing structured business records. Each record includes comprehensive details about the business, suitable for lead generation, analytics, and market research.

#### 🧩 Sample Output

```json
{
    "title": "Tech Park Bangalore",
    "categoryName": "Technology Company",
    "address": "123 Innovation Street, Bangalore, Karnataka 560001, India",
    "city": "Bangalore",
    "state": "Karnataka",
    "postalCode": "560001",
    "countryCode": "IN",
    "phone": "+91 80 4000 1000",
    "phoneUnformatted": "+918040001000",
    "website": "https://techpark.example.com",
    "totalScore": 4.7,
    "reviewsCount": 245,
    "location": {
        "lat": 12.9716,
        "lng": 77.5946
    },
    "placeId": "ChIJ_example_1",
    "openingHours": [
        {"day": "Monday", "hours": "9:00 AM - 6:00 PM"},
        {"day": "Tuesday", "hours": "9:00 AM - 6:00 PM"}
    ],
    "reviewsDistribution": {
        "oneStar": 5,
        "twoStar": 3,
        "threeStar": 10,
        "fourStar": 42,
        "fiveStar": 90
    }
}
```

#### 📋 Output Fields

| Field | Type | Description |
|-------|------|-------------|
| `title` | string | Business name |
| `categoryName` | string | Business category/type |
| `address` | string | Complete business address |
| `city` | string | City name |
| `state` | string | State/Province |
| `postalCode` | string | Postal/ZIP code |
| `countryCode` | string | ISO country code (e.g., "IN") |
| `phone` | string | Formatted phone number |
| `phoneUnformatted` | string | Phone number without formatting |
| `website` | string | Business website URL |
| `totalScore` | number | Average rating (0-5) |
| `reviewsCount` | integer | Total number of reviews |
| `location` | object | Geographic coordinates (lat/lng) |
| `placeId` | string | Unique Google Places ID |
| `openingHours` | array | Business operating hours |
| `reviewsDistribution` | object | Count of reviews by star rating |

### 🔍 Data Source

- ✓ Data fetched exclusively via Google Maps API (HTTP GET requests)
- ✓ No HTML scraping or DOM parsing
- ✓ Verified business information directly from Google Maps
- ✓ Automatic filtering and deduplication

### 🔒 Proxy Configuration

This actor uses standard HTTP headers with optional proxy support for:

- Avoiding IP-based rate limiting or bans
- Accessing location-specific data
- Ensuring stable data retrieval at scale

Configure proxy settings in Apify:

```json
{
  "useApifyProxy": true,
  "apifyProxyGroups": ["RESIDENTIAL"],
  "apifyProxyCountry": "IN"
}
```

### 🚀 How to Use

1. Open the actor in Apify Console
2. Click "Try actor" or create a new task
3. Enter your search terms and location
4. Configure optional filters (minimum rating, closed places)
5. Run the actor
6. Download results in JSON, CSV, or Excel format

### ⚙️ Advanced Input Example

```json
{
    "searchStringsArray": ["restaurants", "hotels", "cafes"],
    "locationQuery": "Mumbai, India",
    "maxCrawledPlacesPerSearch": 100,
    "skipClosedPlaces": true,
    "placeMinimumStars": "3.5",
    "language": "en"
}
```

### 🛠️ Tech Stack

- **Apify SDK** — actor orchestration and data handling
- **Node.js 18+** — runtime environment with native fetch API
- **Google Maps API** — exclusive data source for business information

### 📊 Data Processing Features

- ✓ Automatic duplicate detection using Place IDs
- ✓ Filtering by minimum rating and open status
- ✓ Structured data parsing and normalization
- ✓ Comprehensive logging and error handling
- ✓ Schema validation for all output records

### 🔧 Local Development

#### Installation

```bash
npm install
```

#### Running the Actor

```bash
npm start
```

#### Validation

Validate all generated datasets against the schema:

```bash
node validate-datasets.js
```

#### Code Quality

Format code:

```bash
npm run format
```

Check linting:

```bash
npm run lint
```

### 📂 Project Structure

```
.
├── .actor/                          # Actor configuration
│   ├── actor.json                  # Actor metadata
│   ├── input_schema.json           # Input parameters schema
│   ├── dataset_schema.json         # Output dataset schema
│   ├── input.json                  # Default input
│   ├── input-local.json            # Local development input
│   └── input-production.json       # Production input
├── src/
│   └── main.js                     # Main actor script
├── storage/
│   └── datasets/default/           # Generated datasets
├── package.json                    # Dependencies
├── validate-datasets.js            # Dataset validator
└── README.md                       # This file
```

### 🤝 Support

For issues, questions, or feature requests, please refer to the Apify documentation or contact support.

# Actor input Schema

## `searchStringsArray` (type: `array`):

Array of search strings to query Google Maps (e.g., restaurants, software companies, tech startups)

## `locationQuery` (type: `string`):

Geographic location to search in (e.g., 'Bangalore, India', 'New York, USA')

## `maxCrawledPlacesPerSearch` (type: `integer`):

Maximum number of places to retrieve per search query

## `skipClosedPlaces` (type: `boolean`):

Whether to exclude places that are currently closed or have no opening hours information

## `placeMinimumStars` (type: `string`):

Minimum star rating (1-5) to include places. Leave empty for no filter.

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

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

## `useProxy` (type: `boolean`):

Use Apify Proxy for requests. Highly recommended for production to avoid rate limiting.

## `proxyConfig` (type: `object`):

Proxy configuration. Leave default for best results. Using Indian IPs for optimal Flipkart access.

## Actor input object example

```json
{
  "searchStringsArray": [
    "restaurants"
  ],
  "locationQuery": "Bangalore, India",
  "maxCrawledPlacesPerSearch": 10,
  "skipClosedPlaces": true,
  "placeMinimumStars": "",
  "language": "en",
  "useProxy": true,
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "IN"
  }
}
```

# 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 = {
    "searchStringsArray": [
        "restaurants"
    ],
    "locationQuery": "Bangalore, India",
    "maxCrawledPlacesPerSearch": 10,
    "skipClosedPlaces": true,
    "proxyConfig": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "IN"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeai/google-maps-places-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchStringsArray": ["restaurants"],
    "locationQuery": "Bangalore, India",
    "maxCrawledPlacesPerSearch": 10,
    "skipClosedPlaces": True,
    "proxyConfig": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "IN",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapeai/google-maps-places-scraper").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 '{
  "searchStringsArray": [
    "restaurants"
  ],
  "locationQuery": "Bangalore, India",
  "maxCrawledPlacesPerSearch": 10,
  "skipClosedPlaces": true,
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "IN"
  }
}' |
apify call scrapeai/google-maps-places-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Maps Places Scraper",
        "description": "Retrieve verified business data directly from the Google Maps API. Search by keyword and location to collect structured details such as business name, phone number, address, website, ratings, reviews, and more—ideal for B2B lead generation, market research, and business intelligence",
        "version": "2.0",
        "x-build-id": "sXDPmEbXLMEb1iG2v"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapeai~google-maps-places-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapeai-google-maps-places-scraper",
                "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/scrapeai~google-maps-places-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapeai-google-maps-places-scraper",
                "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/scrapeai~google-maps-places-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapeai-google-maps-places-scraper",
                "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": [
                    "searchStringsArray"
                ],
                "properties": {
                    "searchStringsArray": {
                        "title": "Search Strings Array",
                        "type": "array",
                        "description": "Array of search strings to query Google Maps (e.g., restaurants, software companies, tech startups)",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "restaurants"
                        ]
                    },
                    "locationQuery": {
                        "title": "Location Query",
                        "type": "string",
                        "description": "Geographic location to search in (e.g., 'Bangalore, India', 'New York, USA')",
                        "default": "Bangalore, India"
                    },
                    "maxCrawledPlacesPerSearch": {
                        "title": "Max Places Per Search",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of places to retrieve per search query",
                        "default": 10
                    },
                    "skipClosedPlaces": {
                        "title": "Skip Closed Places",
                        "type": "boolean",
                        "description": "Whether to exclude places that are currently closed or have no opening hours information",
                        "default": true
                    },
                    "placeMinimumStars": {
                        "title": "Minimum Stars",
                        "type": "string",
                        "description": "Minimum star rating (1-5) to include places. Leave empty for no filter.",
                        "default": ""
                    },
                    "language": {
                        "title": "Language",
                        "type": "string",
                        "description": "Language code for Google Maps interface (e.g., 'en', 'es', 'fr').",
                        "default": "en"
                    },
                    "useProxy": {
                        "title": "Use Proxy",
                        "type": "boolean",
                        "description": "Use Apify Proxy for requests. Highly recommended for production to avoid rate limiting.",
                        "default": true
                    },
                    "proxyConfig": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy configuration. Leave default for best results. Using Indian IPs for optimal Flipkart access.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ],
                            "apifyProxyCountry": "IN"
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
