Scrape business listings from Google Maps across every zip code in the US. Comes with a bundled database of 42,734 US zip codes — just pick a state and a business type, and go.
Give it a search query (e.g. "dentist") and a location (state, zip codes, or CSV file), and it returns structured data for every matching business:
- Business name, address, phone number
- Website domain
- Star rating and review count
- Worst review text (lowest-rated review per business)
- Google Place ID
Results are exported to CSV, deduplicated by business ID.
The data/us-zip-codes.csv file contains every US zip code with:
| Column | Example |
|---|---|
| zip | 90210 |
| primary_city | Beverly Hills |
| state | CA |
| timezone | America/Los_Angeles |
| area_codes | 310 |
| latitude | 34.09 |
| longitude | -118.41 |
| irs_estimated_population | 15,895 |
Use --state TX to automatically search every zip code in Texas. Use --min-pop 5000 to skip low-population zips and save API calls.
Sign up at RapidAPI and subscribe to the Google Maps Extractor API. The free tier works for testing.
git clone https://github.com/growthenginenowoslawski/google-maps-scraper.git
cd google-maps-scraper
pip install -r requirements.txtcp .env.example .env
# Edit .env and paste your RapidAPI keyOr export it directly:
export RAPIDAPI_KEY=your_key_here# All dentists in Texas
python google_maps_zip_scraper.py --query "dentist" --state TX
# Pizza restaurants in California, only zips with 5000+ population
python google_maps_zip_scraper.py --query "pizza restaurant" --state CA --min-pop 5000
# Specific zip codes
python google_maps_zip_scraper.py --query "gym" --zips 90210,90401,91101
# From a custom CSV file with a 'zip' column
python google_maps_zip_scraper.py --query "plumber" --file my_zips.csv
# Custom output path and more workers
python google_maps_zip_scraper.py --query "attorney" --state FL --output attorneys.csv --workers 10Just run it with no arguments:
python google_maps_zip_scraper.pyIt will prompt you for a search keyword and how to specify zip codes.
For large state-wide scrapes:
nohup caffeinate -i python3 google_maps_zip_scraper.py --query "dentist" --state CA > scraper.log 2>&1 &
tail -f scraper.log| Flag | Description |
|---|---|
--query, -q |
Business type to search (required in CLI mode) |
--state, -s |
2-letter US state code — searches all zips in that state |
--zips, -z |
Comma-separated zip codes |
--file, -f |
Path to CSV file with a zip column |
--min-pop |
Minimum population filter (use with --state) |
--output, -o |
Output CSV path (default: timestamped file) |
--workers, -w |
Concurrent threads (default: 5) |
Results are saved as CSV with these columns:
business_name— Name of the businessaddress— Full addressphone— Phone numberwebsite_domain— Website domainrating— Average rating (1-5)total_reviews— Number of Google reviewszip_code— Zip code that was searchedbusiness_id— Google Place IDreview_text— Text of the worst reviewreview_rating— Star rating of the worst reviewreview_date— Date of the worst review
With default settings (5 workers, 10 requests/second rate limit):
- ~5-10 zip codes per second depending on API response time
- Progress auto-saves every 1,000 zip codes
- Businesses are deduplicated across overlapping zip code results
google-maps-scraper/
data/
us-zip-codes.csv # 42,734 US zip codes (bundled)
google_maps_zip_scraper.py # Main scraper script
requirements.txt # Python dependencies
.env.example # Example environment file
zip_codes.csv.example # Example custom zip codes format
LICENSE # MIT
MIT — use it however you want.