Skip to main content

Official Python SDK for the gmapsscraper.io API — scrape Google Maps business data: names, emails, phones, websites, ratings, reviews.

Project description

gmapsscraper

PyPI version Python versions license

Official Python SDK for the gmapsscraper.io API — a Google Maps scraper for lead generation. Extract business names, addresses, phone numbers, emails, websites, ratings, review counts, categories and coordinates from Google Maps in a few lines of Python.

  • 🪶 Zero dependencies — pure standard library (urllib + csv)
  • 🐍 Python 3.9+, fully type-hinted (py.typed)
  • 📧 Email extraction — crawls business websites for contact emails
  • 🗺️ Auto-geocoding — just write "dentist in Chicago IL", no coordinates needed

Install

pip install gmapsscraper-sdk

The import name is simply gmapsscraper:

Get a free API key (10 credits = 5 searches, no credit card) at gmapsscraper.io/dashboard.

Quick start

from gmapsscraper import GMapsScraper

client = GMapsScraper("YOUR_API_KEY")

# One call: submit → poll → download parsed results
leads = client.scrape("coffee shop in Austin TX", email=True)

print(len(leads), "businesses found")
print(leads[0])
# {
#   "title": "Houndstooth Coffee",
#   "address": "401 Congress Ave ...",
#   "phone": "+1 512-...",
#   "email": "hello@...",
#   "website": "https://...",
#   "rating": "4.7",
#   "reviews_count": "1912",
#   "category": "Coffee shop",
#   "latitude": "30.2672", "longitude": "-97.7431",
#   "google_maps_url": "https://www.google.com/maps/place/...",
#   "opening_hours": "..."
# }

Step-by-step API

If you want control over each stage (e.g. queue jobs and collect later):

# 1. Submit a job (costs 2 credits, multiple keywords = same cost)
job = client.create_job(
    ["plumber in Miami FL", "plumbing service in Miami FL"],
    email=True, depth=2,
)

# 2. Wait for completion (polls every 10s)
client.wait_for_job(job["id"], on_progress=lambda j: print("status:", j["status"]))

# 3a. Parsed dicts…
records = client.download_records(job["id"])

# 3b. …or the raw CSV
csv_text = client.download_csv(job["id"])

# Check your balance
balance = client.credits()  # {"credits": 8}

Options

All options for scrape() / create_job() (names match the REST API wire format and are stable):

Option Type Default Description
email bool False Extract business emails from websites
depth int (1–2) 2 Higher = more results, same credit cost
zoom int (1–21) 15 Map zoom level
radius int (meters) 20000 Search radius
lang str "en" ISO 639-1 result language
fast_mode bool True Skip deep website crawling
max_time int (s) 3600 Job timeout on the backend
lat/lon str | float Coordinates (auto-geocoded from keywords if omitted)

scrape() and wait_for_job() also accept poll_interval (seconds, default 10 — the API minimum; keep it there to avoid rate limits), timeout (seconds, default 3600) and on_progress(job).

Error handling

All failures — HTTP errors, network failures, failed jobs and timeouts — raise GMapsScraperError with status and body. Invalid arguments raise TypeError:

from gmapsscraper import GMapsScraper, GMapsScraperError

try:
    client.scrape("dentist in Chicago IL")
except GMapsScraperError as err:
    # 401 invalid key · 402 out of credits · 422 bad params · 429 rate limited
    print(err.status, err)
Status Meaning
401 Invalid API key
402 Insufficient credits — top up at gmapsscraper.io
422 Invalid parameters
429 Rate limited (1000 req/day) or too many concurrent jobs (max 10)
502 Backend temporarily unavailable

Tips for better results

  • Be specific: "vegan restaurant in Brooklyn NY" beats "restaurant in New York".
  • Pass several related keywords in one job — broader coverage, same 2 credits.
  • Set email=True whenever you need contact info for cold outreach.
  • Jobs typically finish in 30–120 seconds.

Related resources

License

MIT © gmapsscraper.io

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gmapsscraper_sdk-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gmapsscraper_sdk-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file gmapsscraper_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: gmapsscraper_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for gmapsscraper_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab52cd62c42591ef8fac3d0ba556924b929b1144932e36d4ff83a60afef8978d
MD5 a81d09202364e18d67c252f2b8860827
BLAKE2b-256 629d215fb088558376cc4ae2a3e0ef792fd1c56e0092a40cccd856f80439cc83

See more details on using hashes here.

File details

Details for the file gmapsscraper_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gmapsscraper_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c4946dddc4b9944b046711134a8426c6c10963c930b64034b805ad22feea61e
MD5 62089e50e76685c69a4454e3dff5903e
BLAKE2b-256 3162a1e88a29af4cb5724a507a570fd1f0a765d5fc2b24f5396ff298f584bada

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page