(Feb-07-2019, 01:38 PM)barry76 Wrote: Hi, is it possible to search the results "where am I" or "places nearby me" using google API in pythonThat depend of what doc for API say,this may be for mobile(GPS on).
A little rewrite to make it look better,with
f-string
and get rite of range(len(y))
.import requests api_key = 'your_api_key' url = "https://maps.googleapis.com/maps/api/place/textsearch/json?" query = 'Hotel in California' response = requests.get(f'{url}query={query}&key={api_key}') json_data = response.json() for place json_data['results']): print(place['name'])