-1

I am using google maps API to get all the place information like phone number , opening hours .. when I test with the placeid in the developers site I get all the details but when I send send my placeid I get just the address_components details.

developers : https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=AIzaSyBz2O-udgMv8PnaY-2tW118Uz1182ApEiw

My link: https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJ2xEZitrOUUYR0a9wjkKF9_g&key=AIzaSyBz2O-udgMv8PnaY-2tW118Uz1182ApEiw

2 Answers2

2

The place ID ChIJ2xEZitrOUUYR0a9wjkKF9_g from second request returns result of type route. Places API can return addresses as well, not only businesses.

You can easily check it with Geocoding API request:

https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJ2xEZitrOUUYR0a9wjkKF9_g&key=YOUR_API_KEY

or open it in Geocoder tool:

https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/utils/geocoder/#place_id%3DChIJ2xEZitrOUUYR0a9wjkKF9_g

The route is not a business, so it doesn't have phone, open hours, etc.

xomena
  • 31,125
  • 6
  • 88
  • 117
0

I found the problem it was with the place_id and not the request , as xomena saying the the request returns result of type route, but I tried what 2 requests you wrote and it returns the same data I got with my request because of the placeId.

thank you all anyway :)