Google places json denial - android

I am trying to create a sample app using Google Places Api. I have never used this api before,so I want to give it a try:).
The first thing I did was to enable Google Places Api for Android and to create an Android key from Google Console api with the keytool command in cmd(I am using Windows 8.1). Then I add my API_KEY into the following link as..
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=cruise&key=AIzaSyC8aJYaI9djrUoEMaMIa3sRF36buKPSV0M
and the json response I am getting is this.
{
"error_message" : "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console",
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}
Why do I have a request denied status?
Thanks

Related

Api key request denied

I am trying do that drawing path between two location,when I try do this I got a error this.
I shared below my url and error.I created Android api key,wht I got request denied error from google api
url: https://maps.googleapis.com/maps/api/directions/json?origin=41.050399,28.940599&destination=41.1119857,29.0186137&sensor=false&mode=driving&alternatives=true&key=AIzaSyB9LW3JNai1tGYtSVZrRGMGeJ71q7Y3DbA
json:{
"error_message" : "This IP, site or mobile application is not authorized to use this API key. Request received from IP address 78.186.62.169, with empty referer",
"routes" : [],
"status" : "REQUEST_DENIED"
}
I dont think that is the correct way of using it, try something like this
https://maps.googleapis.com/maps/api/js?key=<YOUR_API_KEY>&callback=initMap
and if it is in a variable then u will need " " like
src="https://maps.googleapis.com/maps/api/js?key=<YOUR_API_KEY>&callback=initMap"
Directions API web service requires a Server API key, not Android API key.
Please look at the documentation:
https://developers.google.com/maps/documentation/directions/get-api-key#get-an-api-key

unable to get the routes from the google api

I got the api key by following the usual steps.
Then I was able to get map and use some inbuilt things on it like search etc
Then later I tried routing, I was unable to get the routes. When I pasted the request:
https://maps.googleapis.com/maps/api/directions/json?origin=28.6100,2077.2300&destination=18.9750,72.8258&key=mykey
on the browser I got the following and realized that I don't have the permission. I searched for this problem but couldn't find the solution, please help.
Response on browser:
{
"error_message" : "This IP, site or mobile application is not authorized to use this API key. Request received from IP address xxxxxxxx, with empty referer",
"routes" : [],
"status" : "REQUEST_DENIED"
}
Make sure you are using server API key, not an Android key (mobile development). See this post:
Google Places API request denied for Android autocomplete, even with the right api key .
Also make sure you are sending the key to GooglePlaces instance.
If you are restricting use of API key by IP make sure your request is coming from an allowed address.

android how to get google API key for google places? [duplicate]

This question already has an answer here:
google maps android api v2 error "This IP, site or mobile application is not authorized to use this API key."
(1 answer)
Closed 7 years ago.
Hi I am working with google places API. But it causes error
URL:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=2500,25000&radius=5000&types=a&sensor=true&key=AIzaSyAt8zjW45u7rjH1la48kfvZNZ1nDpbCOAM
Error:
{ "error_message" : "This IP, site or mobile application is not authorized to use this API key.", "html_attributions" : [], "results" : [], "status" : "REQUEST_DENIED" }
You have missed something related to API_KEY generating and using. Please re-check if you have generated API_KEY properly for your package name. You can refer steps at : here

Google Places API giving exception invalid Api key for android app

In my android app i have added google api v2 for showing map and this is working fine,now 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
but it giving response-
{ "error_message" : "This IP, site or mobile application is not authorized to use this API key.",
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}
so why suce error is returns.where i am missing.
Thanks in advance.

Google Map API For Near By Place By Latitude and Longitude

I have an Api key, Api console and Sh1, and using EclipseIDE ANDROID -> preference, I
added all data in Api as below:
https://maps.googleapis.com/maps/api/place/radarsearch/json?location=48.859294,2.347589&radius=5000&types=food|cafe&sensor=false&keyword=vegetarian&key=AIzaSyCRQ2aFtbU2sOgO6fMvuM2edHPaWRDxbRg
But I get this error message:
{
"error_message" : "This IP, site or mobile application is not authorized to use this API key.",
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}
What am I doing wrong?
I request you to Use following API
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=48.859294,2.347589&radius=500&types=school&sensor=false&key=AIzaSyDN1QX-gWUR-mIYo_D21PNFLHHpNQkIkGU
So I had the same issue you were experiencing, I used the same api as you however what I found was that if you generate a new API key for android it does not work, but if you generate a new Server key and use that it works perfectly. I found some assistance on the following post REQUEST_DENIED with Google Places API browser key or app key?

Categories

Resources