REQUEST_DENIED when using the Google Places API

20,372

Solution 1

IMPORTANT: Go to the api console here, then to SERVICES and check if your 'Places API' is turned ON

Solution 2

Maybe you should Add "&sensor=true /false " on the end of the Url which you are sending.

Solution 3

NOTE: - I had implemented it in Android APP.

I was facing the same problem with this API..

Most of the solutions/ suggestions available on net are regarding the wrong key.

But how to get the appropriate key? very little help is there regarding this.

The sole reason behind it in my case was wrong KEY.

I was using my Android Key (The one we use for google Maps) to access google places, that's why it was giving me ACCESS DENIED response.

After Struggling for some hours I noticed in Google API Documentation somewhere there was a screenshot how to create KEY

in that I noticed they key they were using was in "Key for browser apps (with referers)"

whereas the one I was using was in "Key for Android apps (with certificates)"

.....

and to get the respective key We need to create a Browser Key.

They key I was using initially was

enter image description here

The required key is enter image description here

to get the required key :- just click on "Browser Key" and click again the input it askes for regarding some url is not a mandatory field

enter image description here

For further detail how to use it in ANDROID refer this link

Don't forget to Turn On on the Services "Places API" from API Console

Solution 4

Great to see these many solutions. let me add another to the list. You can also try changing the Port address to 443 to get response from Places API

Solution 5

In my case, the problem was I tried to use the API key for Android (which seems fairly logical) but then I tried to change it for the browser's API key and it finally works right now. Why? Don't ask me. :)

Hope that helped.

Share:
20,372
Admin
Author by

Admin

Updated on July 24, 2022

Comments

  • Admin
    Admin almost 2 years

    I'm trying to make a request to the Google Places API, using the following url: https://maps.googleapis.com/maps/api/place/search/xml?location=37.77264,-122.409915&radius=500&types=educational%20services&name=everest%20college%20san%20francisco&sensor=false&key=YourApiKey

    This is the response I get:

    <PlaceSearchResponse>
      <status>REQUEST_DENIED</status>
    </PlaceSearchResponse>
    

    Any idea what could be wrong with the above URL?

  • Zero
    Zero about 12 years
    This worked for me. In the browser (not an android project) have sensor as true.
  • djangofan
    djangofan almost 12 years
    This is not the solution, IMHO. While the documentation says that is likely the cause, other things can cause this as well.
  • Nawaz
    Nawaz almost 11 years
    What does that mean? Could you please elaborate?
  • Jonathan
    Jonathan over 10 years
    I have no idea why this fixes it, but it worked for me. As soon as I put :443 in front of the domain name, it immediately worked, but the browser (Chrome) removed the :443 from the address. But subsequently, I could just use the normal address without the :443 and it still worked. Weird!!
  • Admin
    Admin over 10 years
    The "accept requests from these HTTP referrers" part is important, you have to leave it blank when you're working on a development site (or locally).
  • Campinho
    Campinho about 7 years
    Sensor parameter is not required anymore.