Google Map API get address information by postal code, but it response result by street number

大憨熊 提交于 2021-02-17 07:15:08

问题


I am using google map api to get address information by Postal code around the world [ not specific country].

https://maps.googleapis.com/maps/api/geocode/json?address=610&key=[apiKey]

I expected zip code is 610, but google response result for street number 610.

Is there any ways to get address by zip code only?

Thank you guys in advance for supporting.


回答1:


How about something along with this query

https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:1441|country:PH&key=YOUR_API_KEY

This will get you the address kind of this format http://prntscr.com/ouwlq5

Key note here is the country. You need both of the postal_code and the country to make this work. Without country you'll get zero results.



来源:https://stackoverflow.com/questions/57566230/google-map-api-get-address-information-by-postal-code-but-it-response-result-by

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!