-2

I'm looking for a way to take a rough location string (ex. "Buddy's Pub in City, State"), and convert it to the best-guess set of coordinates. I've looked at GeoPy and Google's Geocoding API, but they are not exactly what I'm looking for. Any help would be appreciated.

dburenok
  • 93
  • 7

1 Answers1

0

Solved it thanks to @aminrd tip.

Google Places API is the answer.

import googlemaps
API_KEY = "your google API key goes here"
gmaps = googlemaps.Client(key=API_KEY)
place_result = gmaps.find_place(input='Buddy\'s Pub in City, State', input_type='textquery', fields=["geometry/location"])
print(place_result)

Output looks like

{'candidates': [{'geometry': {'location': {'lat': XX.2804533, 'lng': -XXX.1195808}}}], 'status': 'OK'}
dburenok
  • 93
  • 7