开发者

Google maps geocoding API inconsistent

开发者 https://www.devze.com 2023-03-11 04:19 出处:网络
I have a server application that calls the google maps geocoding API at http://maps.googleapis.com/maps/api/geocode/json

I have a server application that calls the google maps geocoding API at http://maps.googleapis.com/maps/api/geocode/json

I experience that 开发者_开发知识库when the server application invokes such an URL, the response is sometimes ZERO_RESULTS.

If I take the exact same URL and paste in a browser, I get a valid result back.

Any ideas to what differences can cause this? HTTP headers? Something else?


In the link you provided it is missing the address, components, latlng or place_id parameters, besides the Google Map API KEY.

You need at least one of the parameters and the Key to get a proper response.

e.g.

https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJ1xwGTLE1K4gRmzFDd_1HzPc&key=xxx

Just add your KEY and it should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号