Tech With Galvan
Back to Articles
AutomationMar 22, 2029 • 5 min read

How to Scrape Business Leads From Google Maps (Legally)

Scrape business leads from Google Maps with Python — names, phones, addresses, and ratings. Legal considerations and ethical best practices included.

Galvan
Galvan

Founder & Creator

Introduction

Google Maps is the largest database of local businesses. If you’re a B2B freelancer or agency, scraping business leads from Maps can fill your pipeline. But scraping Google Maps requires care — both technically and legally.

This post shows you how to scrape business leads ethically and effectively.

What’s allowed

  • Scraping publicly available business information (name, address, phone, website)
  • Using the data for your own outreach (B2B sales)
  • Storing and organizing the data

What’s NOT allowed

  • Scraping personal data (individuals’ names, personal emails)
  • Republishing the data (selling it as a database)
  • Violating Google’s Terms of Service (automated scraping is against ToS)
  • Spamming scraped contacts

The ethical approach

  1. Use the Google Places API (official, legal, paid) instead of scraping
  2. Respect robots.txt and rate limits
  3. Don’t scrape personal data — only business info
  4. Use the data responsibly — personalized outreach, not spam
  5. Check local laws — GDPR (EU), CCPA (California), etc.

Recommendation: Use the Google Places API for production. Use scraping for prototyping/research only.

import googlemaps
import os

gmaps = googlemaps.Client(key=os.environ["GOOGLE_PLACES_API_KEY"])

def search_businesses(query, location, radius=5000):
    """Search for businesses near a location."""
    results = gmaps.places_nearby(
        location=location,
        radius=radius,
        keyword=query,
        type="establishment",
    )
    return results.get("results", [])

def get_details(place_id):
    """Get detailed info for a business."""
    return gmaps.place(place_id, fields=[
        "name", "formatted_address", "formatted_phone_number",
        "website", "rating", "user_ratings_total", "opening_hours",
    ])["result"]

# Usage
businesses = search_businesses("restaurants", (22.3072, 73.1812), radius=10000)
for b in businesses:
    details = get_details(b["place_id"])
    print(f"{details['name']} | {details.get('formatted_phone_number', 'N/A')} | {details.get('website', 'N/A')} | {details.get('rating', 'N/A')}⭐")

Cost: $17 per 1,000 place details requests. Free tier: $200/month credit.

Method 2: Scraping with Playwright (for prototyping)

from playwright.sync_api import sync_playwright
import json, time

def scrape_google_maps(query, location):
    """Scrape Google Maps search results (for prototyping only)."""
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=True)
        page = browser.new_page()
        
        # Search Google Maps
        search_url = f"https://www.google.com/maps/search/{query}+in+{location}"
        page.goto(search_url)
        page.wait_for_selector('[role="feed"]', timeout=10000)
        
        # Scroll to load more results
        feed = page.locator('[role="feed"]')
        for _ in range(5):
            feed.evaluate("el => el.scrollTop = el.scrollHeight")
            time.sleep(2)
        
        # Extract business data
        businesses = []
        cards = page.locator('[role="article"]').all()
        for card in cards:
            try:
                name = card.locator('.fontHeadlineSmall').text_content()
                rating = card.locator('.MW4etd').text_content()
                reviews = card.locator('.UY7F9').text_content()
                address = card.locator('.W4Efsd').nth(1).text_content()
                
                businesses.append({
                    "name": name,
                    "rating": rating,
                    "reviews": reviews,
                    "address": address,
                })
            except Exception:
                continue
        
        browser.close()
        return businesses

# Usage
results = scrape_google_maps("restaurants", "Vadodara")
for r in results:
    print(f"{r['name']} | {r['rating']}⭐ ({r['reviews']}) | {r['address']}")

Warning: This violates Google’s ToS. Use for prototyping/research only. For production, use the Places API.

Step 3: Enrich the data

After scraping, enrich with additional info:

import requests

def enrich_business(business):
    """Add website, email, and social media info."""
    # Check if they have a website
    if business.get("website"):
        # Scrape the website for email
        try:
            r = requests.get(business["website"], timeout=10)
            # Extract email with regex
            import re
            emails = re.findall(r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}", r.text)
            business["emails"] = list(set(emails))[:3]
        except Exception:
            business["emails"] = []
    return business

Step 4: Qualify leads

Not all scraped leads are good. Filter by:

Criteria Good lead Bad lead
Rating 4.0+ stars <3.0 stars (may not pay)
Reviews 10+ (established business) 0-2 (too new)
Website Has a website (can improve it) No website (may not have budget)
Category Matches your service Unrelated

Step 5: Outreach

Don’t spam. Send personalized, value-first outreach:

def generate_outreach(business):
    return f"""Hi {business['name']} team,

I noticed your {business['category']} business on Google Maps. 
I help businesses like yours [specific service — e.g., "improve their website and get more customers from Google"].

I put together a quick audit of your online presence. Here's what I found:
- [Specific observation 1]
- [Specific observation 2]

Would you be open to a 10-minute chat to discuss?

Best,
[Your Name]
[Portfolio link]"""

Ethical guidelines

  1. Only use for B2B outreach — not for spamming consumers
  2. Personalize every message — no mass emails
  3. Respect opt-outs — if they say no, stop
  4. Don’t scrape personal data — only business info
  5. Use official APIs when possible — Places API for production
  6. Check local laws — GDPR, CCPA, etc.
  7. Don’t resell the data — use it for your own outreach only

Common mistakes

  • Scraping without rate limiting — gets your IP banned
  • Not enriching data — phone numbers alone aren’t enough; add website, email, social
  • Mass emailing — “Dear Business Owner” emails get deleted. Personalize.
  • Ignoring ToS — Google can ban your account for scraping
  • Not qualifying leads — 1000 bad leads are worse than 50 good ones
  • No follow-up system — scraped leads need a CRM and follow-up sequence

Key Concepts

  • Google Places API = official API for business data (legal, paid)
  • Web scraping = extracting data from websites (often against ToS)
  • Lead qualification = filtering leads by quality criteria
  • Enrichment = adding additional data to leads (email, social, etc.)
  • Outreach = contacting potential clients

What to Try Next

FAQ

Scraping publicly available business information is generally legal, but it violates Google’s Terms of Service. Google can ban your account/IP. For production, use the Google Places API (official, legal, paid). Use scraping for prototyping/research only.

How much does the Google Places API cost?

$17 per 1,000 place details requests. Free tier: $200/month credit (enough for ~11,000 requests). For a small lead generation campaign, the free tier is usually sufficient.

Can I scrape at scale?

Not with scraping — Google will block you. The Places API is designed for scale (with rate limits). For large-scale lead generation, use the API or a specialized service (Apollo, ZoomInfo, etc.).

What’s the best alternative to scraping?

The Google Places API (official). Or use business directories (Justdial, IndiaMART, Yelp) which often have APIs or are easier to scrape. Or use lead generation services (Apollo, Hunter, ZoomInfo) which provide verified business data. See Capture Leads Into Google Sheets.