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

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

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

Google places json denial

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

Youtube API permission 403 Forbidden error

I'm following the tutorial on this page but I keep getting a 403 Forbidden error when I run the app and try to do a search.
I enabled Youtube Data API v3 on the https://console.developers.google.com/ page and I created an Android API key.
Any suggestions? Thank you.
Could not search: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "usageLimits",
"message" : "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.",
"reason" : "ipRefererBlocked",
"extendedHelp" : "https://console.developers.google.com"
} ],
"message" : "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed."
}
I have resolved the problem by creating a Browser key instead of an android key. The browser key needs to have no entry so that it'll say "all refered allowed"
Used this for iOS app and received same error so I removed bundle identifier and it worked
I have resolved the problem by creating a Server key instead of an iOS key
I had the same problem and after a lot of wasted time my hosting service figured out the API request was being generated by a different IP address than the one associated with my website.
For anyone who finds this that couldn't solve it with the answers above, my problem was the way I entered the domain into the API restriction. I had put *.example.com/*, but my requests were coming from https://example.com. When I removed the *. at the beginning, my requests began working.

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