27
votes

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

  1. Signed up http://code.google.com/apis/maps/signup.html

  2. Tried the example on that page in the location bar (I know about cross domain from script)

    works fine

  3. Read the documentation

  4. 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.

5
Do not put "solved" or anything similar in the question title or the question itself. If anything, post as a comment or as an answer. - casperOne
Did you enable places API in services tab? - sites
This is more than a year ago. I have not looked since - mplungjan
Here is another worth looking at stackoverflow.com/questions/8427980/… - mplungjan

5 Answers

23
votes

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.

5
votes

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.

5
votes

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.

2
votes

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.

-2
votes

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.

MKErrorDomain error 4 iPhone