Created
January 6, 2021 16:24
-
-
Save tluyben/5fd4ce92f225610d4f34c1576d82712b to your computer and use it in GitHub Desktop.
Google places api search in Python
This file contains hidden or 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
import googlemaps | |
gmaps = googlemaps.Client(key='YOUR_KEY') | |
test = gmaps.find_place('nice company', 'textquery') | |
if 'candidates' in test and len(test['candidates'])>0: | |
first = test['candidates'][0]['place_id'] | |
details = gmaps.place(first) | |
if 'result' in details and 'adr_address' in details['result']: | |
print(details['result']['adr_address']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment