5

I am currently working with Google Place API, I have a problem with it whenever I am going to access this link

https://maps.googleapis.com/maps/api/place/search/json?location=latitude,longitude&radius=1&sensor=false&key=apikey

with entering the information like latitude,longitude and API key and set sensor equal to false,but it always shows :

{
   "debug_info" : [],
   "html_attributions" : [],
   "results" : [],
   "status" : "REQUEST_DENIED"
} 

I already searched for that kind of error and I saw that some of the post suggests to check sensor value and check the API key. I already checked it and also checked the service is enabled for Google Maps API v3. But nothing works for me. I am new to this, I don't get what I am doing wrong, Please help.

user2182010
  • 121
  • 2
  • 9

2 Answers2

8

You are using http(s) for calling Google API, is your html also hosted under http(s). If not try changing google url to http.

Otherwise every thing else kinda looks ok so that makes me think you might wanna check your api console again, go to SERVICES and check if your 'Places API' is turned ON.

You can also try changing the Port address to 443 to get response from Places API

varun
  • 4,522
  • 33
  • 28
  • 1
    I have tried every possible combination of the three suggestions made here and have had no success. My API key is good (it works for Maps), and Places API is enabled in console. Using port 443 gives a bad response with either http or https. What about this answer helped you? – dm78 Oct 03 '13 at 16:48
  • @David Mays Try to delete and recreate your key if possible or create a new one. Paste your request here if possible, what I have posted above has been working for me and friends all the time. – varun Oct 07 '13 at 09:45
0

The "status": "REQUEST_DENIED" is returned by the Places API when:

You have not activated the Places API Service in the services tab of the APIs console.
The sensor parameter is missing from your request, or is set to something other than true or false.
The key parameter is missing from your request.
The key parameter does not match the your API key in the API Access tab of the APIs console.
Your API key has not been correctly set up in the API Access tab of the APIs Console:
    If you are using a Browser key, check that your allowed Referer(s) are correct.
    If you are using a Server key, check that your allowed IP(s) are correct.
    Android and iOS keys are not supported, please use a Browser or Server key.
The request was not sent as an HTTPS request, HTTPS is required for all Web Service requests.
The incorrect HTTP method was used to send the request:
    All requests must be sent as a GET request except for Place Actions.
    All Place Actions must be sent as a POST request.
Shefali Soni
  • 1,234
  • 14
  • 26