Prerequisites & Setup
Proxy (Required)
Warning: A residential proxy with sticky sessions is required. Without a proxy, requests to Google will silently fail -- you will get no error message, just zero results.
Google blocks datacenter IP addresses from accessing Maps data. You need a residential or mobile proxy that:
- Provides sticky sessions with at least 30 minutes of session lifetime
- Routes through residential IPs (not datacenter)
- Supports HTTP proxy protocol
Your proxy URL should follow this format:
Some providers use session parameters in the password field:
There are three ways to configure the proxy, covered in detail in Configuration:
-
Constructor argument (recommended for library usage):
-
Environment variables (recommended for CLI usage):
-
Config file (repo-clone users only):
Cookies
Google cookies are required for fetching reviews and place details. The library handles cookies automatically:
- It visits
google.com,consent.google.com, andmaps.google.comthrough your proxy - It captures the
NID,AEC, andSOCScookies from those visits - Cookies are cached for 1 hour and auto-refreshed when expired
You do not need to configure cookies manually. If automatic fetching fails (rare), you can provide them via the GMAPS_COOKIES environment variable or the cookies constructor parameter. See Configuration for details.
Next Steps
Once your proxy is ready, continue to the Quick Start.