Web Scraping Google Maps Place in Python | SerpApi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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