How to scrape Google Maps
Pull business names, addresses, ratings, phone numbers and review counts from Google Maps as structured JSON, without wrestling with its single-page app.
- Site:
- google.com/maps
- Difficulty:
- Hard
- Rendering:
- Single-page app
- Anti-bot:
- Rate limiting, Bot detection, Consent walls
What you can extract from Google Maps
These are the fields teams most often pull from google.com/maps, and why a hand-written selector for each one tends to break over time.
| Field | Type | Why selectors break |
|---|---|---|
| name | string | Maps renders the business name inside a dynamically generated container whose class names are obfuscated and rotated, so any hard-coded selector stops matching after a deploy. |
| address | string | The address is shown next to an icon with no stable label, and its position in the panel shifts depending on which business attributes are present. |
| rating | number | The numeric rating sits inside an aria-label alongside the review count, forcing fragile string parsing that breaks across languages. |
| review_count | number | Review counts are wrapped in parentheses and localized, so the same selector returns "(1,234)", "1.234" or "1,2 mil" depending on the locale. |
| phone | string | The phone number only appears after the side panel finishes hydrating, so reading the DOM too early returns nothing. |
The schema-first approach
Instead of maintaining selectors, you hand Extracto a JSON schema describing the shape you want. Here is a schema that works for Google Maps:
{
"name": "string",
"address": "string",
"rating": "number",
"review_count": "number",
"phone": "string",
"category": "string"
} - 1
Describe the Google Maps fields you want
Write a small JSON schema listing the fields to pull from google.com/maps (for example name, address, rating). No CSS selectors or XPath needed.
- 2
Send the URL and schema to Extracto
POST the Google Maps page URL and your schema to the Extracto API. Extracto renders the page in a real browser, handling JavaScript and dynamic content automatically.
- 3
Get schema-validated JSON back
Extracto returns JSON that matches your schema exactly, validated before it leaves the API, so your pipeline never receives broken or partial data.
Common pitfalls when scraping Google Maps
- Google Maps is a single-page app, so the data you want does not exist in the initial HTML at all; it is fetched and rendered by JavaScript, which a plain HTTP request never triggers.
- A cookie-consent or sign-in interstitial frequently appears before the listing loads, and a scraper that does not handle it captures the consent wall instead of the business data.
- Class names in the rendered panel are obfuscated and change between releases, so selector-based scrapers need constant maintenance just to keep matching the same fields.
- Results and panel contents depend heavily on the visitor's locale, language and inferred location, so the same query returns different businesses and formats, making position-based extraction unreliable across sessions.
Is it legal to scrape Google Maps?
Google Maps is a single-page application governed by Google's Terms of Service, which restrict automated scraping. Business listing data such as name, address and rating is publicly visible, but reviewer names and review text are personal data and should be handled carefully under GDPR and CCPA. The sanctioned route for most listing data is the official Google Places API. Scrape only public listing fields, respect rate limits, and avoid collecting personal information about reviewers unless you have a clear legal basis.
Extracto follows robots.txt by default and rate-limits politely. You are responsible for compliance with Google Maps's terms and applicable law (GDPR, CCPA) in your use case.