Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
156 views
in Technique[技术] by (71.8m points)

json - google maps API to get all the place information like phone number , opening hours

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...