Google Places API request denied for Android autocomplete, even with the right api key

Although this has been answered, I think the community could do better.

I was tearing my hair out about this, it just didn't make sense to me.. I was making an iOS/Android App, so I made an iOS/Android Key... Wrong.

With Google's Places API, your bundle identifier isn't even considered.

What you really want to do is this: (I'm using the new User Interface)

1. Log into https://cloud.google.com/console#/project

Select your Project Name, then go into API's & Auth > APIs

Make sure you have Places API Turned on. This is the only thing that needs to be turned on for Places-API to work. enter image description here

2. Go into Credentials

Click CREATE NEW KEY under Public API Access enter image description here

3. Select BROWSER KEY enter image description here

4. Click Create, Nothing Else

Leave the HTTP Refer box empty.

enter image description here

5. Use the Key Generated here

This key will allow ANY user from any device access to the API via your Developer login. You can try it out here: (Be sure to replace YOUR_KEY_HERE with your generated Key)

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Food%20Sh&sensor=false&radius=500&location=0,0&key=YOUR_KEY_HERE

6. Enjoy

Now you can use that URL above in your Android/iOS device.


The Google Places API does not currently support Android or iOS keys generated from the Google APIs Console. Only Server and Browser keys are currently supported.

If you would like to request this support, please file a Places API - Feature Request.


https://developers.google.com/places/training/autocomplete-android

Storing your API key

Although the above code demonstrates how to communicate directly between an Android app and the Places Autocomplete service, you should not store your Places API key with your app.

You should therefore build a web application that stores your API key and proxies the Places API services. In order to secure communication between your Android app and the proxy web service, you should require user authentication to your proxy web service. Your Android app can securely store user credentials and pass them to your web service, or the user can log into your web app via an Android WebView.

For the latter approach, your web app should create and return a user authentication token to your Android app, and your Android app should subsequently pass this token to your proxy web service.