Google Maps Scraper - Softotech

Google Maps Scraper: How to Get Business Data the Allowed Way

Business lists from Google Maps are useful for lead research. Scraping the Maps website is against Google terms, so this guide shows the allowed route: the official Places API with a short Python script.

Can you scrape Google Maps?

Google’s terms prohibit scraping or exporting Maps content outside its products and APIs, and tools that do it can get blocked and expose you to legal risk. The supported route is the Google Maps Platform, specifically the Places API. It returns business names, addresses, phone numbers, websites and ratings as structured data, and it is meant for this kind of lookup. Google also sets rules on how long you can store results and how they must be shown, so read the Maps Platform terms for your use.

Your options compared

OptionGood forWatch out for
Places API (Text Search)Lists like “plumbers in Austin TX” with phone and websiteNeeds a Google Cloud project, billing and an API key. Requests are billed per use
Your own Business ProfileExporting your own locationsOnly covers businesses you manage
Licensed data providersLarge lead listsCheck where the data comes from and the licence terms
Scraping the Maps websiteNothing we recommendBreaks Google terms, is brittle, and can get you blocked

Step 1: set up the Places API

  1. Create a Google Cloud project and enable billing.
  2. Enable Places API (New).
  3. Create an API key and restrict it to that API.
  4. Check current pricing and free usage on the Google Maps Platform pricing page before you run big searches. Costs depend on which fields you request, so ask only for what you need.

Step 2: the Python script

Install requests with pip install requests, add your key, and run. It searches by text, follows result pages and writes a CSV.

import csv
import requests

API_KEY = "YOUR_API_KEY"
URL = "https://places.googleapis.com/v1/places:searchText"
FIELDS = "places.displayName,places.formattedAddress,places.nationalPhoneNumber,places.websiteUri,places.rating,nextPageToken"

def parse(data):
    rows = []
    for p in data.get("places", []):
        rows.append({
            "name": p.get("displayName", {}).get("text", ""),
            "address": p.get("formattedAddress", ""),
            "phone": p.get("nationalPhoneNumber", ""),
            "website": p.get("websiteUri", ""),
            "rating": p.get("rating", ""),
        })
    return rows

def search(query, max_pages=3):
    headers = {"X-Goog-Api-Key": API_KEY, "X-Goog-FieldMask": FIELDS}
    body = {"textQuery": query, "pageSize": 20}
    rows = []
    for _ in range(max_pages):
        r = requests.post(URL, json=body, headers=headers, timeout=30)
        r.raise_for_status()
        data = r.json()
        rows += parse(data)
        token = data.get("nextPageToken")
        if not token:
            break
        body["pageToken"] = token
    return rows

if __name__ == "__main__":
    rows = search("plumbers in Austin TX")
    with open("places.csv", "w", newline="", encoding="utf-8") as f:
        w = csv.DictWriter(f, fieldnames=["name", "address", "phone", "website", "rating"])
        w.writeheader()
        w.writerows(rows)
    print(len(rows), "places saved")

The field mask tells Google which fields to return, which keeps cost down. The parsing function was tested on sample responses, including places with missing phone or website fields, which come back as empty cells instead of errors. The live request needs your own key, so test with a small search first.

Turn the list into leads

  • Open places.csv in Excel and remove duplicates.
  • Rate each lead and add notes in a simple tracker. Our project tracker template works for outreach lists.
  • Follow marketing laws such as CAN-SPAM and GDPR when you contact people, and use only contact details you are allowed to use.

For learning the general technique on a site that allows it, see our web scraping with Python tutorial.

Free pricing tips for your business

Get short, practical tips on pricing jobs and using our free calculators. No spam, unsubscribe any time.

    Frequently asked questions

    Is Google Maps scraping legal?

    Scraping the Maps website goes against Google terms of service. Using the official Places API within its terms is the allowed way. This is general information, not legal advice.

    Is there a free Google Maps scraper?

    The Places API has a free usage allowance that can change, so check the current pricing page. Free browser-based scrapers usually scrape the website, which we do not recommend.

    Can I export emails from Google Maps?

    No. The Places API returns names, addresses, phone numbers, websites and ratings, not email addresses. Emails would have to come from the business website or your own research.

    How many results can I get per search?

    The API returns results in pages of up to 20 and limits how many pages one search gives. Run several narrower searches, such as one per neighbourhood, for more coverage.

    Can you build this for me?

    Yes. We build lead research and data tools with clean Excel output. Use the contact page.

    Need lead research or a data tool built?

    Talk to us

    More free tools: All free tools · Web scraping with Python · Email extractor · Project tracker template