← All builds
Automation

Lead Generation Scraper — Google Places API

Python tool that queries the Google Places API to build structured business contact lists. Configurable by location and category — a 1,019-record Queensland run shown here completed in under 20 minutes.

Lead Generation Scraper — Google Places API
PythonGoogle Places APIRequests

I needed a targeted contact list for a side project and wasn't going to build it manually. This scraper wraps the Google Places API with configurable location and category parameters, deduplicates results across geography boundaries, and exports structured CSV output — business name, address, phone, website.

The locations and categories are just config variables. Pointing it at a different city or vertical takes seconds — the same script works for Melbourne law firms, Sydney yoga studios, or Perth accountants.

End result for this run: 1,019 records with contact info, ready for outreach.

Under the Hood

Building search queries from config

LOCATIONS = [
    "Sunshine Coast, Australia",
    "Noosa, Australia",
    "Brisbane, Australia",
    "Gold Coast, Australia",
    "Byron Bay, Australia",
]

CATEGORIES = [
    # Health
    "physiotherapist", "nutritionist", "naturopath", "osteopath",
    # Wellness
    "personal trainer", "life coach", "psychologist", "counsellor",
    # Professional services
    "family lawyer", "mortgage broker",
    # Aesthetics
    "beauty clinic", "cosmetic clinic", "medispa",
]

MAX_RESULTS_PER_SEARCH = 20

def collect_leads(client):
    leads = []
    for location in LOCATIONS:
        for category in CATEGORIES:
            results = client.places(
                query=f"{category} near {location}",
                type="establishment"
            ).get("results", [])[:MAX_RESULTS_PER_SEARCH]
            leads.extend(results)
    return leads  # 5 locations × 13 categories × 20 results = up to 1,300

Deduplication and export

# Google Places returns duplicates across location boundaries
def deduplicate_leads(leads):
    seen = set()
    unique = []
    for lead in leads:
        place_id = lead.get("place_id")
        if place_id and place_id not in seen:
            seen.add(place_id)
            unique.append(lead)
    return unique

leads = deduplicate_leads(collect_leads(client))
# Export to CSV: name, address, phone, website, place_id

Why this matters

Most contact list tools are either expensive, geography-locked, or return dirty data. Building directly on the Places API gives full control over query logic, deduplication, and output format — and runs in minutes at effectively zero cost.