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.
Legal considerations
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
- Use the Google Places API (official, legal, paid) instead of scraping
- Respect robots.txt and rate limits
- Don’t scrape personal data — only business info
- Use the data responsibly — personalized outreach, not spam
- Check local laws — GDPR (EU), CCPA (California), etc.
Recommendation: Use the Google Places API for production. Use scraping for prototyping/research only.
Method 1: Google Places API (recommended, legal)
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
- Only use for B2B outreach — not for spamming consumers
- Personalize every message — no mass emails
- Respect opt-outs — if they say no, stop
- Don’t scrape personal data — only business info
- Use official APIs when possible — Places API for production
- Check local laws — GDPR, CCPA, etc.
- 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
- Capture leads into Google Sheets for the full pipeline
- Score and sort leads automatically
- Automate lead follow-up emails for consistent outreach
- Build a simple CRM in Google Sheets
FAQ
Is scraping Google Maps legal?
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.