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

Search Google Maps by keyword and location to extract place details — name, category, rating, address, phone, website, and coordinates (when available) — with no API key, proxy, or Google login required. Reviews aren't included, since Google limits review content to signed-in sessions.

- **URL**: https://apify.com/forceful\_grossular/google-maps-places-scraper.md
- **Developed by:** [Raavo Konsa](https://apify.com/forceful_grossular) (community)
- **Categories:** Lead generation, Travel, E-commerce
- **Stats:** 2 total users, 1 monthly users, 96.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 place scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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 Places Scraper

An [Actor](https://apify.com/actors) built with `PlaywrightCrawler` that scrapes place listings from Google Maps search results.

For each entry in `keywords` (combined with the single `location`, e.g. keyword `"restaurants"` + location `"Tallinn, Estonia"` → search `"restaurants in Tallinn, Estonia"`), it opens the Google Maps search results, scrolls the results feed to collect up to `maxCrawledPlacesPerSearch` places, then visits each place's page to extract:

- `title`, `category`, `rating`
- `address`, `phone`, `website`, `plusCode`
- `coordinates` (latitude/longitude) and `placeUrl`

**Reviews are not scraped.** Google Maps only shows review content to signed-in sessions ("You're seeing a limited view of Google Maps — Sign in to get the most out of Google Maps"), and automating a Google account login is against Google's Terms of Service and out of scope for this Actor. If you need review data, the officially supported route is the paid [Google Places API](https://developers.google.com/maps/documentation/places/web-service/place-details) (Place Details returns up to 5 reviews per place).

This Actor runs without Apify Proxy or any paid API — just a direct connection, so it's free to run.

### Reliability

Google Maps' page markup and anti-bot behavior aren't under our control, so the Actor is built to fail loudly and specifically rather than silently:

- **Blocked requests**: if Google redirects a request to its `/sorry/` interstitial (its standard anti-automation page), the request throws and Crawlee retries it with a fresh session - this is usually transient.
- **Layout changes**: if the results feed (`div[role="feed"]`) or a place's `<h1>` doesn't show up, that's treated as a hard failure and retried too, rather than being logged and silently skipped - a missing `<h1>` in particular is a strong signal something broke, since every place page we've seen has one.
- **Slow/missing optional fields**: category, address, phone, website, and plus code lookups each use a 5s timeout instead of Playwright's 30s default. These fields are legitimately absent on some places, and waiting 30s per missing field was blowing through the crawler's request-handler timeout and burning retries on pages that had, in fact, loaded fine.
- **End-of-run reporting**: after the crawl finishes, the Actor checks its own results. If zero places were scraped and at least one search or place page failed after retries, it calls `Actor.fail()` with a specific message instead of exiting as if it succeeded with an empty dataset - so a real breakage (blocked, or Google changed its markup) is visible as a failed run rather than a quietly empty one. A partial run (some places scraped, some pages failed) exits successfully with a status message noting the failure count.

### Monetization (pay-per-event)

The Actor charges one `place-scraped` event (via `Actor.pushData(item, 'place-scraped')` in `src/routes.ts`) for every place it successfully pushes to the dataset. If the caller's spending limit is reached, the charge is skipped, no unpaid item is pushed, and the run stops gracefully.

Pricing itself isn't set in code — it's configured in **Apify Console → your Actor → Monetization** after publishing:

1. Select the **Pay per event** pricing model (the rental model is being retired by Apify in 2026, so this is the only model worth setting up for a new Actor).
2. Add the event `place-scraped` with a title/description and a price per event (e.g. $0.01–0.03 per place, based on your target margin over compute cost).
3. Leave the synthetic `apify-actor-start` event at its default price — it's charged automatically per run and doesn't need code changes.

#### Test monetization locally

```bash
ACTOR_TEST_PAY_PER_EVENT=true ACTOR_USE_CHARGING_LOG_DATASET=true npm run start:dev
```

This simulates PPE charging (all events default to $1 locally, since real pricing lives on the platform) and writes every charge to the `charging_log` dataset under `storage/datasets/charging_log/`, so you can verify exactly what would have been billed.

### FAQ and disclaimer

**Is this an official Google product?** No. This Actor is an independent, unofficial tool built with Crawlee and Playwright to read publicly visible Google Maps search results. It is not affiliated with, endorsed by, or sponsored by Google, and "Google Maps" is used here only to describe the target website.

**Is scraping Google Maps legal?** This Actor only extracts data that's publicly visible on Google Maps search and place pages, without logging in or bypassing any access control. That said, scraping is subject to [Google's Terms of Service](https://policies.google.com/terms), and you're responsible for checking those terms — along with any applicable laws in your jurisdiction (e.g. around personal data) — apply to your intended use before running it, especially for commercial purposes.

**Why are some fields empty?** Category, address, phone, website, and plus code are only scraped when Google Maps actually shows them for a given place - many listings legitimately don't have all of these (see [Reliability](#reliability)).

**Found a bug or have a feature request?** Open an issue on the Actor's Issues tab in Apify Console, or on the GitHub repository.

### Resources

If you're looking for examples or want to learn more visit:

- [Crawlee + Apify Platform guide](https://crawlee.dev/docs/guides/apify-platform)
- [Documentation](https://crawlee.dev/api/playwright-crawler/class/PlaywrightCrawler) and [examples](https://crawlee.dev/docs/examples/playwright-crawler)
- [Node.js tutorials](https://docs.apify.com/academy/node-js) in Academy
- [Scraping single-page applications with Playwright](https://blog.apify.com/scraping-single-page-applications-with-playwright/)
- [How to scale Puppeteer and Playwright](https://blog.apify.com/how-to-scale-puppeteer-and-playwright/)
- [Integration with Zapier](https://apify.com/integrations), Make, GitHub, Google Drive and other apps
- [Video guide on getting scraped data using Apify API](https://www.youtube.com/watch?v=ViYYDHSBAKM)
- A short guide on how to build web scrapers using code templates:

[web scraper template](https://www.youtube.com/watch?v=u-i-Korzf8w)

### Getting started

For complete information [see this article](https://docs.apify.com/platform/actors/development#build-actor-locally). To run the Actor use the following command:

```bash
apify run
```

### Deploy to Apify

#### Connect Git repository to Apify

If you've created a Git repository for the project, you can easily connect to Apify:

1. Go to [Actor creation page](https://console.apify.com/actors/new)
2. Click on **Link Git Repository** button

#### Push project on your local machine to Apify

You can also deploy the project on your local machine to Apify without the need for the Git repository.

1. Log in to Apify. You will need to provide your [Apify API Token](https://console.apify.com/account/integrations) to complete this action.

   ```bash
   apify login
   ```

2. Deploy your Actor. This command will deploy and build the Actor on the Apify Platform. You can find your newly created Actor under [Actors -> My Actors](https://console.apify.com/actors?tab=my).

   ```bash
   apify push
   ```

### Documentation reference

To learn more about Apify and Actors, take a look at the following resources:

- [Apify SDK for JavaScript documentation](https://docs.apify.com/sdk/js)
- [Apify SDK for Python documentation](https://docs.apify.com/sdk/python)
- [Apify Platform documentation](https://docs.apify.com/platform)
- [Join our developer community on Discord](https://discord.com/invite/jyEM2PRvMU)

# Actor input Schema

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

What to search for on Google Maps, e.g. "restaurants" or "plumbers". Each entry runs as a separate search, combined with Location below.

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

Where to search, e.g. "Tallinn, Estonia" or "Tartu". Appended to every keyword. Leave empty to let Google Maps use its default (IP-based) location.

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

Maximum number of places to scrape for each keyword.

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

Language code for Google Maps results (e.g. "en", "et").

## `maxRequestsPerCrawl` (type: `integer`):

Safety cap on total requests (search + detail pages) for the whole run. Leave empty to size it automatically from the keywords and max places per search.

## Actor input object example

```json
{
  "keywords": [
    "restaurants"
  ],
  "location": "Tallinn, Estonia",
  "maxCrawledPlacesPerSearch": 20,
  "language": "en"
}
```

# Actor output Schema

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

No description

# 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 = {
    "keywords": [
        "restaurants"
    ],
    "location": "Tallinn, Estonia"
};

// Run the Actor and wait for it to finish
const run = await client.actor("forceful_grossular/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 = {
    "keywords": ["restaurants"],
    "location": "Tallinn, Estonia",
}

# Run the Actor and wait for it to finish
run = client.actor("forceful_grossular/google-maps-places-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 '{
  "keywords": [
    "restaurants"
  ],
  "location": "Tallinn, Estonia"
}' |
apify call forceful_grossular/google-maps-places-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,forceful_grossular/google-maps-places-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/YZIx9l9dgUF7rdCTY/builds/ZNrQk08lCMYnP2QjO/openapi.json
