Skip to main content

Google Maps Lead Generator

A high-performance Python library for extracting business leads from Google Maps using a stealth browser (Camoufox).

Features

  • Two-phase scraping architecture - Efficiently collects URLs first, then extracts data
  • Parallel processing - Uses multiple browser tabs concurrently
  • Resource optimization - Blocks heavy resources (images, media, fonts) during data extraction
  • Stealth browsing - Uses Camoufox to avoid detection
  • Flexible output - Save results to CSV or JSON

Installation

pip install google-map-leadgen

Or install from source:

pip install -e .

Usage

Command Line

# Basic usage
python -m google_map_leadgen.main "Restaurants in San Francisco"

# Specify number of leads and tabs
python -m google_map_leadgen.main "Plumbers in NYC" --leads 50 --tabs 4

# Output as JSON
python -m google_map_leadgen.main "Coffee shops" --json

As a Library

import asyncio
from google_map_leadgen import scrape

async def main():
    # You can specify target leads and concurrent tabs
    results = await scrape("Mobile Repair Shop in New York", target=10, max_tabs=3)
    
    for lead in results:
        print(f"Name: {lead['name']}")
        print(f"Address: {lead['address']}")
        print(f"Phone: {lead['phone']}")
        print(f"Website: {lead['website']}")
        print("---")

asyncio.run(main())

Configuration

Set environment variables to customize behavior:

export LEADS=50              # Number of leads to collect
export MAX_TAB_ALLOWED=4     # Concurrent browser tabs
export HEADLESS=true         # Run browser in headless mode
export DEBUG=false           # Enable debug logging

Output Format

Results are returned as a list of dictionaries:

[
    {
        "name": "Business Name",
        "address": "123 Main St, City, State",
        "phone": "+1 (555) 123-4567",
        "website": "https://example.com"
    },
    ...
]

Project Structure

google-map-leadgen/
├── .github/             # GitHub Actions workflows (CI/CD)
├── google_map_leadgen/  # Core package source
│   ├── __init__.py      # Package initialization
│   ├── config.py        # Configuration settings
│   ├── main.py          # CLI entry point
│   └── scraper.py       # Core scraping logic
├── tests/               # Unit and integration tests
├── pyproject.toml       # Package configuration and dependencies
└── README.md            # Project documentation

Development

Prerequisites

  • uv (Recommended) or Python 3.12+

Setup

# Clone the repository
git clone https://github.com/yourusername/google-map-leadgen.git
cd google-map-leadgen

# Install dependencies
uv sync --all-extras

Running Tests

uv run pytest tests/ -v

Linting

uv run ruff check .
uv run ruff format .

CI/CD

This project uses GitHub Actions for:

  • CI: Automated testing and linting on every push and pull request.
  • CD: Automated publishing to PyPI on GitHub release.

Requirements

  • Python 3.12+
  • Camoufox (stealth browser)

License

MIT License

Disclaimer

This tool is for educational purposes. Scraping Google Maps may violate their Terms of Service. Use responsibly and at your own risk.

Metadata

Release files for google-map-leadgen 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for google-map-leadgen 0.1.0
File Size Uploaded
google_map_leadgen-0.1.0.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for google-map-leadgen 0.1.0
File Interpreter ABI Platform
google_map_leadgen-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / google_map_leadgen-0.1.0.tar.gz

Download URL google_map_leadgen-0.1.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
29b9654ff63a4955faab7dddf310081cb30aa3986287288c8f40768b7f651637
BLAKE2b-256 checksum
How to use checksums
d7388352f5f512e3409103224b269bc065a95f6d9d546905ad20df49f949c8c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 21, 2026.

Transparency log

Release files / google_map_leadgen-0.1.0-py3-none-any.whl

Download URL google_map_leadgen-0.1.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c350f2645883246a266de3f30772659b3333c24e4fc776894c4077d854744fe
BLAKE2b-256 checksum
How to use checksums
127b9c1082312753a5b690cec7c8cc35d854f79d0a89926e17debfdf72b9be87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page