Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

REQUEST_DENIED with Google Places API browser key or app key?

Tags:

android

key

api

I'm writing an application in Android that needs the Google Places API. I have made a key through the Google console, for both my browser and my specific application. The application key already works with Google Maps. To do a request to the Google Places API, though, it seems I have to use the browser key for it to work. It won't work with the application key, because that results in a REQUEST_DENIED.

Somebody knows how this is possible? Or is this normal?

like image 916
Philippe De Croock Avatar asked Apr 25 '13 20:04

Philippe De Croock


People also ask

How can I get Google Places API key?

Go to the Google Maps Platform > Credentials page. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key. Click Close.

Do you need an API key to embed Google Maps?

You must include an API key with every Maps Embed API request.


1 Answers

Accessing Google places API involves a http/https request from the browser. The application key you created wouldn't work for the Google places as it needs a browser key. You need to create a new browser key on the Google API console clicking the "Create new Browser Key"

Also leave the Accept requests from these HTTP referers (web sites): blank so that it allows access to all referrers and include the key generated in your query URL.

like image 58
quirkystack Avatar answered Oct 12 '22 17:10

quirkystack