
Google Maps Scraper
- epctex/google-maps-scraper
- Modified
- Users 26
- Runs 185
- Created by
epctex
Effortlessly gather places data from Google Maps using our advanced scraper. Search by keyword or location, retrieve reviews, and analyze insights for informed decisions. Fast, customizable, and reliable. Get valuable location information with ease.
To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running Actors via the API in Apify Docs.
from apify_client import ApifyClient
# Initialize the ApifyClient with your API token
client = ApifyClient("<YOUR_API_TOKEN>")
# Prepare the Actor input
run_input = {
"startUrls": [
"https://www.google.com/maps/search/cafe/@40.6976437,-74.3093257,10z/data=!3m1!4b1?authuser=0&hl=en&entry=ttu",
"https://www.google.com/maps/place/The+Museum+of+Modern+Art/@40.7614367,-73.9801965,17z/data=!3m2!4b1!5s0x89c258fbd5ec7547:0x7edf0a3ade84ad50!4m6!3m5!1s0x89c258f97bdb102b:0xea9f8fc0b3ffff55!8m2!3d40.7614327!4d-73.9776216!16zL20vMGhoams?authuser=0&hl=en&entry=ttu",
],
"search": "cafe",
"searchLocation": "San Francisco, USA",
"language": "en",
"reviewsSort": "mostRelevant",
"maxItems": 20,
"maxReviews": 20,
"extendOutputFunction": "($) => { return {} }",
"customMapFunction": "(object) => { return {...object} }",
"proxy": { "useApifyProxy": True },
}
# Run the Actor and wait for it to finish
run = client.actor("epctex/google-maps-scraper").call(run_input=run_input)
# Fetch and print Actor results from the run's dataset (if there are any)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)