Is it possible to retrieve place details for multiple places?
https://maps.googleapis.com/maps/api/place/details/json?placeid=[ArrayInsteadOfJustOnePlaceId]
The documentation does not mention anything regarding the resolving of multiple places.
google places doc
Go to APIs & Services → Dashboard → Enable APIs & Services at the top and Choose Maps Javascript API from the API Library. This will open up the Map JavaScript API page, and Enable it.
So no, you are not allowed to store this data indefinitely. Recent policy changes removed the 30 days caching statement and added a statement about not cacheing any ratings data. When asked for clarification from Google, Google stated any and all data cached from Places API must be deleted.
You can't do it in a single request. You have to iterate over a list of place id and make a call for each.
Here is a sample code to do it using this python wrapper: /slimkrazy/python-google-places
pip install python-google-places
from googleplaces import GooglePlaces, GooglePlacesAttributeError, GooglePlacesError
GOOGLE_API_KEY = 'AIzaSyDRcaVMH1F_H3pIbm1T-XXXXXXXXXXX'
GOOGLE_PLACE_IDS = [
"ChIJC4Wu9QmvthIRDmojjnJB6rA",
"ChIJuRFUv33Ew0cRk0JQb2xQOfs",
"ChIJ9yGYrIwd9kcRlV-tE8ixHpw"
]
def main():
google_places = GooglePlaces(GOOGLE_API_KEY)
for place_id in GOOGLE_PLACE_IDS:
try:
place = google_places.get_place(place_id)
print('{0} place_id has name {1}'.format(place_id, place.name))
except (GooglePlacesError, GooglePlacesAttributeError) as error_detail:
print('Google Returned an Error : {0} for Place ID : {1}'.format(error_detail, place_id))
pass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With