Skip to content

Instantly share code, notes, and snippets.

@dimitryzub
Created June 22, 2022 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimitryzub/e613a5039f85b5f24678f0eb3dd04d49 to your computer and use it in GitHub Desktop.
Save dimitryzub/e613a5039f85b5f24678f0eb3dd04d49 to your computer and use it in GitHub Desktop.
Web Scraping Google Maps Place in Python | SerpApi
# video: https://www.youtube.com/watch?v=jqoNHXiGeZA
from serpapi import GoogleSearch
import json
params = {
"api_key": "your-serpapi-api-key", # Your SerpApi Api key
"engine": "google_maps", # SerpApi Parsing Engine
"google_domain": "google.com", # Google domain
"ll": "@47.6062572,-122.4086176,12z", # GPS Coordinates
"type": "place", # Type of the search result. `Search` or `Place`
"hl": "en", # Language of the search
"data": "!4m5!3m4!1s0x549041cdf279071f:0xb4634cde435eb7ec!8m2!3d47.5666806!4d-122.3299532" # https://serpapi.com/maps-place-results -> API Parameters Examples
}
search = GoogleSearch(params)
results = search.get_dict()
print(results["place_results"]["title"])
print(json.dumps(results["place_results"], indent=2, ensure_ascii=False))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment