1
votes

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
have you read the api carefully? You need to generate an API key...read the description complete and follow the instructions.developers.google.com/places/android-api/?hl=enOpiatefuchs
In mu url i'm not showing my Api key which i already have. Yes i created new project and got api key for android places apiShai Shamai
At the end instead of mykey i'm adding api key like alzagsg566Shai Shamai
As i wrote above i already have api key i can show it but i am getting the error. I gave my package name and then my SHA1 and saved it. Then i received the api key.Shai Shamai
are you testing with debug or release build ? you need to add key separately for both build types in android studio.Jayakrishnan

1 Answers

3
votes

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