Skip to content

Instantly share code, notes, and snippets.

@tluyben
Created January 6, 2021 16:24
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 tluyben/5fd4ce92f225610d4f34c1576d82712b to your computer and use it in GitHub Desktop.
Save tluyben/5fd4ce92f225610d4f34c1576d82712b to your computer and use it in GitHub Desktop.
Google places api search in Python
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