# Google Maps Scraper (`crawlerbros/google-maps-scraper`) Actor

Extract business data from Google Maps including ratings, reviews, contact info, prices, coordinates, and images. Fast scraper with automatic pagination for any location or search query.

- **URL**: https://apify.com/crawlerbros/google-maps-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Other, Real estate, Automation
- **Stats:** 268 total users, 8 monthly users, 95.6% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $3.00 / 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Maps Business Scraper

A powerful Apify Actor for scraping business listings from Google Maps using browser automation with Playwright. Extract comprehensive business information including ratings, reviews, contact details, locations, and more.

### 🚀 Features

- 🎯 **Comprehensive Data Extraction**: Names, ratings, reviews, addresses, phones, websites, descriptions, and more
- 📍 **Location Flexibility**: Search any location worldwide (cities, neighborhoods, addresses)
- 🔍 **Any Search Query**: Restaurants, hotels, cafes, pharmacies, shops, services, etc.
- 💰 **Price Information**: Extract price levels and ranges where available
- 📸 **Image URLs**: Get business images from Google Maps
- 🗺️ **Geographic Data**: Extract coordinates, Place IDs, and Plus Codes
- 🌐 **Clean Data**: Automatic text cleaning (addresses, websites, descriptions)
- 💾 **Structured Output**: JSON format with all fields properly formatted

### 📋 Input Parameters

The actor accepts the following input parameters:

| Parameter     | Type    | Required | Default        | Description                                            |
| ------------- | ------- | -------- | -------------- | ------------------------------------------------------ |
| `searchQuery` | string  | Yes      | `"restaurant"` | What to search for (e.g., 'cafe', 'hotel', 'pharmacy') |
| `location`    | string  | Yes      | `"New York"`   | Where to search (e.g., 'Manhattan, NY', 'Los Angeles') |
| `maxResults`  | integer | No       | `20`           | Maximum number of businesses to scrape (1-100)         |

#### Example Input

```json
{
  "searchQuery": "restaurant",
  "location": "Manhattan, New York",
  "maxResults": 50
}
```

### 📊 Output Fields

Each business listing in the output dataset contains:

#### Basic Information

- `index` - Sequential index in results (e.g., `0`, `1`, `2`)
- `name` - Business name (e.g., `"Gramercy Tavern"`)
- `category` - Business type (e.g., `"New American restaurant"`)
- `url` - Google Maps URL for the business

#### Ratings & Reviews

- `rating` - Average rating from 1-5 stars (e.g., `4.7`)
- `review_count` - Total number of reviews (e.g., `4642`)

#### Contact Information

- `address` - Full street address (e.g., `"42 E 20th St, New York, NY 10003, United States"`)
- `phone` - Phone number with country code (e.g., `"+1 212-477-0777"`)
- `website` - Business website URL (cleaned from Google redirects)

#### Description & Pricing

- `description` - Business description and services (cleaned text)
- `price_level` - Price range indicator (e.g., `"$$"`, `"$50–100"`, `"$100+"`)

#### Location Data

- `latitude` - Geographic latitude (e.g., `40.7384555`)
- `longitude` - Geographic longitude (e.g., `-73.9885064`)
- `place_id` - Google Maps Place ID (e.g., `"0x89c259a1820824bd:0x2b79dcdc251b8415"`)
- `plus_code` - Plus Code location (e.g., `"P2Q6+9H New York, USA"`)

#### Media

- `images` - Array of image URLs from Google Maps

#### Metadata

- `scraped_at` - ISO timestamp when data was scraped (e.g., `"2025-10-22T16:20:31.874079"`)

#### Example Output

```json
{
  "index": 0,
  "url": "https://www.google.com/maps/place/Gramercy+Tavern/...",
  "scraped_at": "2025-10-22T16:20:31.874079",
  "name": "Gramercy Tavern",
  "rating": 4.6,
  "review_count": 4642,
  "category": "New American restaurant",
  "address": "42 E 20th St, New York, NY 10003, United States",
  "phone": "+1 212-477-0777",
  "website": "https://www.gramercytavern.com/",
  "description": "Michelin-starred Flatiron District tavern featuring a menu of modern, seasonal American dishes. Dine-in Takeaway Delivery",
  "price_level": "$100+",
  "place_id": "0x89c259a1820824bd:0x2b79dcdc251b8415",
  "plus_code": "P2Q6+9H New York, USA",
  "latitude": 40.7384555,
  "longitude": -73.9885064,
  "images": [
    "https://lh3.googleusercontent.com/...",
    "https://lh3.googleusercontent.com/..."
  ]
}
```

### 🛠️ Usage Examples

#### 1. Find Restaurants in a City

```json
{
  "searchQuery": "restaurant",
  "location": "New York, NY",
  "maxResults": 50
}
```

#### 2. Find Hotels in a Specific Area

```json
{
  "searchQuery": "hotel",
  "location": "Manhattan, New York",
  "maxResults": 30
}
```

#### 3. Find Cafes and Coffee Shops

```json
{
  "searchQuery": "cafe",
  "location": "San Francisco, CA",
  "maxResults": 25
}
```

#### 4. Find Pharmacies or Medical Services

```json
{
  "searchQuery": "pharmacy",
  "location": "Los Angeles, CA",
  "maxResults": 20
}
```

### 🚀 Running the Actor

#### Via Apify Console

1. Go to [Apify Console](https://console.apify.com)
2. Find the actor in the Store or your Actors
3. Configure the input parameters
4. Click "Start" to run

#### Via Apify CLI (Local Development)

```bash
## Install Apify CLI
npm install -g apify-cli

## Run locally
apify run

## Run with custom input
apify run --input '{"searchQuery": "restaurant", "location": "New York", "maxResults": 20}'
```

#### Via API

```bash
curl -X POST https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQuery": "restaurant",
    "location": "New York",
    "maxResults": 20
  }'
```

### 🔧 Technical Details

#### Technology Stack

- **Language**: Python 3.11+
- **Framework**: Apify SDK 2.0+
- **Browser Automation**: Playwright (Chromium)
- **Data Parsing**: BeautifulSoup4, Regular Expressions
- **Data Cleaning**: Advanced text processing and URL parsing

#### How It Works

1. **Search Construction**: Builds Google Maps search URL from query and location
2. **Page Loading**: Navigates to search results with optimized wait strategy
3. **Scrolling**: Automatically scrolls to load all results up to maxResults
4. **URL Extraction**: Collects business URLs from search results
5. **Detail Extraction**: Visits each business page to extract comprehensive data
6. **Data Cleaning**: Cleans addresses, websites, descriptions, and price values
7. **Output**: Saves structured JSON data to Apify dataset

#### Data Quality Features

- ✅ **Address Cleaning**: Removes newlines and extra whitespace
- ✅ **Website Extraction**: Parses Google redirect URLs to get actual websites
- ✅ **Description Cleaning**: Removes formatting symbols and newlines
- ✅ **Price Extraction**: Flexible extraction supporting multiple formats ($$, $50-100, $100+)
- ✅ **Text Normalization**: Proper text formatting across all fields

#### Performance

- **Speed**: ~5-7 seconds per business (including page load and extraction)
- **Success Rate**: 95%+ data extraction success rate
- **Reliability**: Robust error handling with graceful fallbacks
- **Scalability**: Efficiently handles up to 100 businesses per run

### 🐛 Troubleshooting

#### Common Issues

**1. No Results Found**

- Verify the location exists and is spelled correctly
- Try a more specific location (e.g., "Manhattan, NY" instead of "NY")
- Check that the search query is valid for that location

**2. Missing Data Fields**

- Some businesses may not have all fields (website, phone, price, etc.)
- The actor extracts all available data - null values are expected
- Try different businesses or locations for more complete data

**3. Slow Performance**

- Google Maps pages can be slow to load
- Network speed affects overall runtime
- Consider reducing `maxResults` for faster runs

**4. Rate Limiting**

- Google may temporarily block excessive requests
- Wait a few minutes before retrying
- Use residential proxies if running frequently

### � Best Practices

1. **Start Small**: Test with `maxResults: 5-10` first
2. **Specific Locations**: Use detailed locations (neighborhood/city) for better results
3. **Relevant Queries**: Use search terms that match real businesses
4. **Monitor Output**: Check the dataset to ensure data quality meets your needs
5. **Respect Limits**: Don't scrape excessively - respect rate limits

### 📊 Use Cases

- 🏢 **Business Intelligence**: Market research and competitor analysis
- 📍 **Location Data**: Build location databases for apps
- 📞 **Contact Lists**: Generate business contact information
- � **Sales Leads**: Find potential customers by category/location
- 🗺️ **Mapping Projects**: Create custom maps with business data
- 📈 **Market Analysis**: Analyze business density and competition

### 📝 Version History

#### Version 2.0.0 (Current)

- Simplified scraping logic for better reliability
- Improved data cleaning (addresses, websites, descriptions)
- Flexible price extraction supporting all formats
- Removed unused fields (hours, menu\_url, reservations\_url, order\_online\_url)
- Enhanced error handling and logging
- Updated documentation and schemas

### 🗺️ Complete Google Maps Scraper Suite

This actor is part of a comprehensive Google Maps data extraction toolkit by **crawlerbros**. All actors run on the free Apify plan, use no proxy by default, and return clean, structured data.

| Actor | What it does |
|---|---|
| ⭐ [Google Maps Reviews Scraper](https://apify.com/crawlerbros/google-maps-reviews-scraper) | Scrape reviews with reviewer Local Guide level, photos, mentioned items, owner replies |
| 📸 [Google Maps Photos Scraper](https://apify.com/crawlerbros/google-maps-photos) | Extract all photos from any place — max-resolution URLs, contributor info, categories |
| 🕐 [Google Maps Business Hours Scraper](https://apify.com/crawlerbros/google-maps-business-hours) | Full 7-day hours, timezone, current local time, next open/close, holiday hours |
| 📊 [Google Maps Popular Times Scraper](https://apify.com/crawlerbros/google-maps-popular-times) | Busy hours histogram for all 7 days + current busyness + typical visit time |
| 📧 [Google Maps Email Extractor](https://apify.com/crawlerbros/google-maps-email-extractor) | Find business emails + social media links by crawling websites |
| 🗺️ [Google Maps Area Scanner](https://apify.com/crawlerbros/google-maps-area-scanner) | Geographic grid scanning — bypass the 120-place limit with bounding box / circle / polygon |
| 💼 [Google Maps Leads Scraper](https://apify.com/crawlerbros/google-maps-leads) | B2B lead generation with email + phone enrichment, US states + global countries |
| 🤖 [Google Maps MCP Server](https://apify.com/crawlerbros/google-maps-mcp) | Unified MCP server combining search + reviews for AI assistants |
| 🧭 [Google Maps Directions Scraper](https://apify.com/crawlerbros/google-maps-directions) | A→B routing — distance, duration, traffic, route alternatives for driving/walking/transit |
| 📍 [Google Maps Geocoding Scraper](https://apify.com/crawlerbros/google-maps-geocoding) | Bidirectional geocoding — address ↔ coordinates, with address components |
| 🔗 [Google Maps Similar Places Scraper](https://apify.com/crawlerbros/google-maps-similar-places) | "People also search for" / related place discovery — competitor & alternative finder |
| 🍽️ [Google Maps Menu Scraper](https://apify.com/crawlerbros/google-maps-menu) | Restaurant menu items, prices, descriptions, photos |
| 📌 [Google Maps Nearby Scraper](https://apify.com/crawlerbros/google-maps-nearby) | Find places near a coordinate point — lightweight POI search by category |
| 📋 [Google Maps Place List Scraper](https://apify.com/crawlerbros/google-maps-place-list) | Extract Google's curated "Top X in Y" lists — best hotels/restaurants/things to do |
| 🌍 [Google Maps Timezone Scraper](https://apify.com/crawlerbros/google-maps-timezone) | IANA timezone + current local time from coordinates |

### 🤝 Support

For issues, questions, or feature requests:

- Check this README for troubleshooting tips
- Review the output data structure
- Contact support through Apify Console

***

**Disclaimer**: This actor is for educational and research purposes. Always respect Google Maps' Terms of Service and robots.txt. Use responsibly and ethically.

# Actor input Schema

## `mode` (type: `string`):

Search mode uses a text query; placeUrls mode scrapes a list of specific Google Maps place URLs directly.

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

What to search for on Google Maps. Include location in the query for best results (e.g., 'coffee shop in New York'). Used when mode is 'search'.

## `location` (type: `string`):

Optional location to append to the search query (e.g., 'Los Angeles, CA'). Leave blank if location is already in the search query.

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

List of Google Maps place URLs to scrape directly. Used when mode is 'placeUrls'. Each URL should be a full Google Maps place URL.

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

Maximum number of places to scrape. For search mode, Google Maps typically returns up to 120 results per query.

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

Language for Google Maps interface and results.

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

Proxy settings for the scraper. Using Apify Proxy is recommended for reliable results.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "coffee shop in New York",
  "maxResults": 5,
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "searchQuery": "coffee shop in New York",
    "maxResults": 5,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/google-maps-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 = {
    "searchQuery": "coffee shop in New York",
    "maxResults": 5,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/google-maps-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQuery": "coffee shop in New York",
  "maxResults": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call crawlerbros/google-maps-scraper --silent --output-dataset

```

## MCP server setup

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

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7fBUMYcQgcMpqFqTG/builds/cRAYK3Z4imugJe96M/openapi.json
