A Python package for scraping Google Maps reviews without browser dependencies using curl_cffi.
- π Browser impersonation (Chrome 99-136, Edge, Safari, Chrome Android)
- π Proxy support with authentication
- β‘ Async and sync interfaces
- πΎ Incremental saving (auto-saves during scraping)
- π JSON and CSV output formats
- π UTF-8 encoding for all languages
pip install gmaps-review-scraperimport asyncio
from gmaps_review_scraper import GoogleMapsReviewsScraper
async def main():
scraper = GoogleMapsReviewsScraper(
proxy="http://username:password@ip:port", # Optional
request_interval=0.5,
random_impersonate=True
)
reviews = await scraper.scrape_reviews(
url="https://www.google.com/maps/place/...",
n_reviews=100, # None for all available reviews
hl="en",
output_format="json", # or "csv"
output_file="reviews.json"
)
print(f"Scraped {len(reviews)} reviews")
asyncio.run(main())from gmaps_review_scraper import GoogleMapsReviewsScraperSync
scraper = GoogleMapsReviewsScraperSync(
proxy="http://username:password@ip:port", # Optional
request_interval=0.5
)
reviews = scraper.scrape_reviews(
url="https://www.google.com/maps/place/...",
n_reviews=100,
output_format="csv",
output_file="reviews.csv"
)
print(f"Scraped {len(reviews)} reviews")No Reviews Found Error?
- You have to select the proper url from place page.
- Go to the place page and click on the "Reviews" tab.
- The url will be like this:
https://www.google.com/maps/place/.../reviews- Copy the url and paste it in the code.
JSON Output:
reviews = scraper.scrape_reviews(
url=url,
output_format="json",
output_file="reviews.json"
)CSV Output:
reviews = scraper.scrape_reviews(
url=url,
output_format="csv",
output_file="reviews.csv"
)scraper = GoogleMapsReviewsScraper(
proxy="http://username:password@ip:port"
)Supported proxy types: HTTP, HTTPS, SOCKS5
Each review contains:
{
"review_id": "unique_id",
"user_name": "John Doe",
"user_url": "https://...",
"user_reviews": 42,
"rating": 5.0,
"relative_date": "2 weeks ago",
"text": "Great place!",
"text_date": "2024-01-15T10:30:00",
"response_text": "Thank you!",
"response_text_date": "2024-01-20T14:00:00",
"retrieval_date": "2024-02-01T12:00:00"
}Data is automatically saved to a temporary file during scraping in a tmp folder in your current working directory:
- Location:
./tmp/gmaps_reviews_temp_<feature_id>.<format> - Auto-creation: The
tmpfolder is automatically created on first run if it doesn't exist
If the script is interrupted, your data is safe in the temporary file and can be recovered from the tmp folder.
scraper = GoogleMapsReviewsScraper(
proxy="http://user:pass@ip:port", # Proxy URL (optional)
request_interval=0.5, # Seconds between requests
n_retries=10, # Retry attempts on failure
retry_time=30, # Wait time before retry (seconds)
random_impersonate=True, # Random browser rotation
log_level="INFO" # Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
)Control logging verbosity:
# Minimal output (only errors)
scraper = GoogleMapsReviewsScraper(log_level="ERROR")
# Standard output (default)
scraper = GoogleMapsReviewsScraper(log_level="INFO")
# Detailed debugging
scraper = GoogleMapsReviewsScraper(log_level="DEBUG")
# Completely quiet (no progress bar, no logs)
reviews = scraper.scrape_reviews(url, verbose=False)You can also customize the logger directly:
from gmaps_review_scraper import setup_logger
import logging
# Setup custom logger
setup_logger(level=logging.WARNING, colored=True)
# Then use scraper
scraper = GoogleMapsReviewsScraper()MIT License - see LICENSE file for details.
This tool is provided for educational and research purposes only.
- This scraper is intended for learning about web scraping techniques and API interactions
- Users must comply with Google's Terms of Service and robots.txt
- Scraping may violate Google's Terms of Service
- Use at your own risk
- Respect Rate Limits: Use reasonable request intervals (0.5-1 second minimum)
- Don't Overload Servers: Avoid excessive requests that could impact Google's services
- Data Privacy: Handle scraped data responsibly and respect user privacy
- Commercial Use: This tool should not be used for commercial purposes without proper authorization
- Legal Compliance: Ensure compliance with applicable laws and regulations in your jurisdiction
This software is provided "as is", without warranty of any kind. The authors and contributors:
- Are not responsible for any misuse or damages caused by this tool
- Do not guarantee the accuracy or completeness of scraped data
- Do not guarantee the tool will work continuously (Google may change their API)
- Are not liable for any legal consequences resulting from use of this tool
β Acceptable Use:
- Educational purposes and learning
- Research and academic studies
- Personal projects with limited scope
- Testing and development
β Unacceptable Use:
- Large-scale commercial data collection
- Violating Google's Terms of Service
- Excessive requests that impact Google's infrastructure
- Any illegal activities
- Selling or distributing scraped data without authorization