Reputation: 178375
What this is NOT
a) a "sensor=true_or_false" issue
b) a key is wrong issue (unless the key I got has limitations)
c) too many requests (since I only make one request)
d) cross domain (since I load the url from the browser location bar)
What I did
Tried the example on that page in the location bar (I know about cross domain from script)
works fine
Read the documentation
Pasted their example exchanging their key for mine
returns
{
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}
So far all entries failed due to wrong key or sensor=true_or_false
And for example the url in this one Google Places API jQuery.ajax() request fails with working URL
also gives me error when pasted into the browser.
What did I miss?
UPDATE
So I went to get some keys
Key for browser apps (with referers)
API key:
AIzaSyCStj9m5LNTu9mCf6cQGDVAFKZC7Y?????
Referers:
Any referer allowed
Activated on: Jan 30, 2012 1:03 PM
Activated by: me
and tried again. Still does not work.
Upvotes: 28
Views: 56262
Reputation: 260
Ohkay this worked for me and i know it will work as we are making the same mistake.
First go to API's and enable the google places api for web. After that, go to credentials and in the credentials where your key is showing, click on it. After clicking, in the restrictions tab, choose what will be the API will be doing.
Set that up, restart your script and voila... it will be done.
Upvotes: 6
Reputation: 73
I faced the same issue. But was able to resolve it after enabling the Places API from Google console. I used the 'server' key to make a call from application. Hope this helps for others looking for solution.
Upvotes: 2
Reputation: 61
I just got a REQUEST_DENIED response when making an autocomplete request in a Ruby app. It turned out that I had not specifically switched on the Places API in my google api console.
Go to: https://console.developers.google.com and login. In the left menu go to "APIs & auth" -> "APIs" Then find the "Places API" option and click on the status to the right to toggle it to "on"
This fixed the problem immediately for me.
Upvotes: 6
Reputation: 4865
This is actually (b): wrong key. Actually, you're using the wrong kind of key (from Sign Up for the Google Maps API which is only good for the JavaScript V2 API).
Please see Obtaining an API Key for how to get a new API key, of the new kind.
Edit: At the time this question arose, valid API keys that worked on Geocoding API did not work on Places API, but now seem to work fine. Looks like some issue on Google side.
Upvotes: 24
Reputation: 1009
This issue has been discussed on many threads here... but the bottom line is you should check your code to see if u are sending out too many requests at a time to the google API. You are only allowed to send 1 request per 1 minute.
Upvotes: -2