27

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.

Community
  • 1
  • 1
mplungjan
  • 169,008
  • 28
  • 173
  • 236

5 Answers5

23

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.

miguev
  • 4,481
  • 21
  • 41
  • Thanks That sounded like an excellent idea. However that did not solve the issue at all. I asked for a new key and STILL got the error – mplungjan Jan 30 '12 at 21:04
  • Would you mind posting here the whole URL you're using to load the API? Feel free to omit the last, say, 5 characters in the key. – miguev Jan 31 '12 at 18:17
  • Erm, I forgot to save it. I went to your site and clicked request new key and that is what I used. – mplungjan Jan 31 '12 at 18:56
  • Sorry, maybe I should have mentioned this before: there actually two kinds of keys you can create in the API console (Server vs Browser). Did you hit "Create new Server key..." or "Create new Browser key..."? For the JavaScript APIs, you need a Browser key. If that still doesn't work, please let us see the whole URL minus the last few characters of your key. – miguev Jan 31 '12 at 21:34
  • 5
    My apologies, I hadn't realized (until now) you were trying to use the Places API. I actually have the same problem, I can use API keys in all Maps API (JavaScript, Geocoding, Directions, etc.) but not on the Places API. Still haven't figure out why, will let you know when I do. – miguev Feb 01 '12 at 15:31
  • It works for me know, with both a Server key and a Browser key. My keys are not restricted though. – miguev Feb 01 '12 at 18:21
  • Check your api in the link to know the reason for place api. https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Food%20Sh&sensor=false&radius=500&location=0,0&key=YOUR_KEY_HERE – Kyaw San Oo Aug 18 '21 at 17:57
5

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.

dkfischer
  • 51
  • 1
  • 3
5

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.

Swapnil Sudhir
  • 231
  • 1
  • 3
  • 11
2

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.

Prakash
  • 75
  • 6
-2

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

Community
  • 1
  • 1
Sagi
  • 981
  • 11
  • 15
  • 2
    I know and none of the threads match my issue. I am not sending too many requests, I am loading 1 URL into the browser's location bar once – mplungjan Jan 30 '12 at 09:38