Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps Geocoding API - Request Denied using API Key

I'm trying to use the Google API geocode service as follows:

https://maps.googleapis.com/maps/api/geocode/json?&address=melbourne&key=xxx&sensor=false

The response I get is always:

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

I have both Google maps API v3 and Places API services enabled. I have even set up billing. I have tried deleting and recreating numerous keys - all with the same effect. I have tried the service from different networks, also with the same result.

In the reports section of the Google API dashboard I can see the number of request accumulating but the response is always Request_Denied.

Can anyone help?

like image 482
Heath Kelly Avatar asked Apr 17 '13 03:04

Heath Kelly


People also ask

How do I fix Google Maps API key?

Go to Theme Options > Other Options > Miscellaneous and paste copied API key to Google Maps API Key field: Click Save All Changes and you should be able to view Google Maps on your site.

Why is my API key not working?

API keys have multiple dependencies that can result in errors like: "The user is not authorized for this operation based on …". Please make sure you are using the correct credentials and endpoint with the correct API key.

How do you check if Google Maps API key is valid?

To confirm the key is associated with the project: Go to the Credentials section, which can be accessed from the left side bar under Google Maps Platform > Credentials. Check that the API key you currently use on your website is listed.


1 Answers

The REQUEST_DENIED status is returned by the Places API when:

  • You have not activated the Places API Service in the services tab of the APIs console.
  • 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.

I failed to whitelist my production server's IP address.

like image 167
Josh Avatar answered Oct 08 '22 19:10

Josh