This IP, site or mobile application is not authorized to use this API key.

Am I using https://maps.googleapis.com/maps/api/geocode/json ? a link with the server key and user ip to find the latitude and longitude of any address when I try to find an error like

I have a server access key from Google, and I put my server IP address in my whitelist.

URL I'm trying to get through PHP CURL:

https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true&key=XXXXXXXXXXXX

The result that I get:

Array ([error_message] => This IP, site or mobile application is not authorized to use this API key. [results] => Array ( ) [status] => REQUEST_DENIED) 

Is there something I need to set up. Geocoding api is also included.

+84
google-places-api google-api
Feb 21 '14 at 11:30
source share
10 answers

I had the same problem and found this.

In the url, this requires a server key, not the api key for the application.

Basically, you simply add the server key at the end of the URL, for example:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=yourlatitude,yourlongitude&radius=5000&sensor=true&key=SERVERKEY

Now, to get the server key, simply follow these steps:

1) Go to the developer console https://code.google.com/apis/console/

2) In the credentials in the "Open API Access" section, create a new key

3) Select a server key from the option.

4) Enter your IP address in the box and, if you have more IP addresses, you can simply add each line. NOTE. Enter only the IP address when you want to use it for testing purposes. Else leave the IP address field blank.

5) After you are finished, click "Create" and your new server key will be generated, and you can add this server key to your URL.

The last thing, instead of putting the sensor = true in the middle of the URL, you can add it at the end as follows:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=yourlatitude,yourlongitude&radius=5000&key=SERVERKEY&sensor=true

This will solve the problem and remember to use the server key for the Places API .

Hope this answer helps you and other viewers. Good luck .. :)

+140
Jun 16 '14 at 1:30
source share

In addition to the API key that is assigned to you, Google also checks the source of the incoming request by looking at either the REFERRER or the IP address. To run the example in curl, create a new Server Key in the Google API console . When you create it, you must specify the IP address of the server. In this case, it will be your local IP address . After creating the Server Key and the white address of your IP address, you can use the new API key in curl.

I assume that you probably created your API key as a Browser Key , which does not require a whitelist of your IP address, but uses the REFERRER HTTP header tag REFERRER for verification. curl does not send this tag by default, so Google was unable to validate your request.

+14
Mar 11 '14 at 21:18
source share
  1. Choose a key
  2. API Restriction Tab
  3. Choose API Key
  4. Save
  5. Select Application Restrict → None.
  6. Save

enter image description here

enter image description here

enter image description here

enter image description here

+14
Sep 21 '18 at 8:03
source share

The Google Places API does not currently support Android or iOS keys created in the Google API console. Currently, only server and browser keys are supported.

+5
Jun 24 '16 at 9:10
source share

You create a key without a link do not enter the referrer address

+2
May 26 '14 at 13:23
source share

The Google Place API requires the HTTP referrer header to be included when calling the API.

Include the HTTP header "Referer: yourdomain.com" and this should fix the response problems.

+2
Mar 04 '15 at 5:49
source share

Also, the corresponding API must be enabled for this project.

https://console.developers.google.com/apis/library?project=projectnamehere

+1
Nov 19 '15 at 18:09
source share

For the latest version of the API, the opposite is true for me.

When calling the URL https://maps.googleapis.com/maps/api/geocode/json?address=<address>&key=<key> I got the following error

You must use the API key to authenticate each request to the Google Maps Platform API. For more information, please refer to http://g.co/dev/maps-no-account

As soon as I switched the order to https://maps.googleapis.com/maps/api/geocode/json?key=<key>&address=<address> it worked fine.

Please note that the error message received above was the message I received when navigating directly to the URL in the browser. When I called the API from the software, I received an HTML response with the following message:

Sorry ... but your computer or network may send automatic requests. To protect our users, we cannot process your request right now.

0
Feb 06 '19 at 16:17
source share

I had a problem because I did not enable the APL key in the Google console.

-one
Dec 19 '16 at 10:29
source share
  url = https://maps.googleapis.com/maps/api/directions/json?origin=19.0176147,72.8561644&destination=28.65381,77.22897&mode=driving&key=AIzaSyATaUNPUjc5rs0lVp2Z_spnJle-AvhKLHY 

add only in appdelegate as

  GMSServices.provideAPIKey("AIzaSyATaUNPUjc5rs0lVp2Z_spnJle-AvhKLHY") 

and delete the key in this URL.

now url

 https://maps.googleapis.com/maps/api/directions/json?origin=19.0176147,72.8561644&destination=28.65381,77.22897&mode=driving 
-2
Aug 21 '18 at 11:43
source share



All Articles