A FastAPI service for scraping Google Maps data based on search queries. Ideal for n8n users.
Very high performance, watch out for rate limiting!
Use variables to replace URL parameters
scrape-get?query=hotels%20in%2098392&max_places=100&lang=en&headless=true"
If using n8n or other automation, use the /scrape-get endpoint for it to return results
simple install, copy files and run docker compose up -d
Intened to be used with this n8n build: https://github.com/conor-is-my-name/n8n-autoscaling
Parameters:
query
(required): Search query (e.g., "hotels in 98392")max_places
(optional): Maximum number of results to returnlang
(optional, default "en"): Language code for resultsheadless
(optional, default true): Run browser in headless mode
Alternative GET endpoint with same functionality
Health check endpoint
curl -X GET "http://localhost:8001/scrape" \
-H "Content-Type: application/json" \
-d '{
"query": "hotels in 98392",
"max_places": 10,
"lang": "en",
"headless": true
}'
curl "http://localhost:8001/scrape-get?query=hotels%20in%2098392&max_places=10&lang=en&headless=true"
or
curl "http://gmaps_scraper_api_service:8001/scrape-get?query=hotels%20in%2098392&max_places=10&lang=en&headless=true"
docker-compose up --build
- Install dependencies:
pip install -r requirements.txt
- Run the API:
uvicorn gmaps_scraper_server.main_api:app --reload
The API will be available at http://localhost:8001
or for docker:
http://gmaps_scraper_api_service:8001
- For production use, consider adding authentication
- The scraping process may take several seconds to minutes depending on the number of results
- Results format depends on the underlying scraper implementation