Google Place API - always return this status: "REQUEST_DENIED"

I am currently working with the Google Place API, I have a problem with it when 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

entering information such as latitude, longitude and API and set the sensor to false , but it always shows:

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

I was already looking for such an error, and I saw that some of the messages suggest checking the sensor value and checking the API key. I already checked it, and also verified that the service is enabled for the Google Maps API v3 . But nothing works for me. I am new to this, I do not understand what I am doing wrong, Please help.

+4
source share
2 answers

You use http to call the Google API, your html is also hosted under http (s). If not try to change google url to http.

Otherwise, everything else looks fine, so it seems to me that you will want to check your api console again, go to the SERVICES and check if your "Places" API is enabled.

You can also try changing the port address to 443 to get a response from the Places APIs

+7
source

"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. 
0
source

Source: https://habr.com/ru/post/1487288/


All Articles