Why Google places API key not works?

2019-01-20 18:20发布

I want to use Places API for show near by location.I have added service for it and use below url. https://maps.googleapis.com/maps/api/place/search/json?location=22.7253,75.8655&radius=500&sensor=true&types=bar&key=mykey

It returns the following error. { "error_message" : "This IP, site or mobile application is not authorized to use this API key.", "html_attributions" : [], "results" : [], "status" : "REQUEST_DENIED" }

1条回答
孤傲高冷的网名
2楼-- · 2019-01-20 18:54

It looks like you try to use Web Service, not Places API for Android. In this case you cannot apply an API key with Android app restriction. Web Service requires a different API key. You can generate the new one, the only restriction that you can use with web services is by IP.

I can suggest following Places API web service documentation:

https://developers.google.com/places/web-service/get-api-key

查看更多
登录 后发表回答