Google Nearby Searchから場所を取得するために次のコードを試しました。
from googleplaces import GooglePlaces, types, lang
YOUR_API_KEY = 'AIzaSyAiFpFd85eMtfbvmVNEYuNds5TEF9FjIPI'
google_places = GooglePlaces(YOUR_API_KEY)
query_result = google_places.query(
location='London, England', keyword='Fish and Chips',
radius=20000, types=[types.TYPE_FOOD])
if query_result.has_attributions:
print query_result.html_attributions
for place in query_result.places:
# Returned places from a query are place summaries.
print place.name
print place.geo_location
print place.reference
# The following method has to make a further API call.
place.get_details()
# Referencing any of the attributes below, prior to making a call to
# get_details() will raise a googleplaces.GooglePlacesAttributeError.
print place.details # A dict matching the JSON response from Google.
print place.local_phone_number
print place.international_phone_number
print place.website
print place.url
指定された場所と半径の場所のリストの json 出力を取得しました。jsonから名前、住所、緯度、経度を取得しました。その場所の距離も必要ですが、見つかりません。誰か助けてください。