This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console
Asked Answered
L

23

337

I have a latitude, and longitude : "-27.0000,133.0000". I want produce a map base on that.

I've tried go to this link

https://maps.googleapis.com/maps/api/geocode/json?latlng=-27.0000,133.0000&key=******

I keep getting this error on the browser

{
   "error_message" : "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console",
   "results" : [],
   "status" : "REQUEST_DENIED"
}

But I think I already enable that API. I log-in to my Google Console, and double check.

When I go to : https://console.developers.google.com/project/75423435770063/apiui/apis/enabled

I see :

Geocoding + Geolocating is enable.

enter image description here

I'm a little stuck now. Is there anything that I missed here?

Lashandralashar answered 7/10, 2015 at 14:14 Comment(2)
when it is like said it seems to be a bug. Check if you have enabled the API for the correct project(the project where the used key belongs to, you may have multiple projects).Radman
Enabling is not enough. Check whether the API key is restricted by API. Do this by going to Navigation Menu > APIs & Services > Credentials then clicking the API key.Unni
S
607

From the picture you posted, it say it's disabled...

Go to the Developer Console

Navigate to Google Maps -> APIs

Search for Geocoding and click on Google Maps Geocoding API -> Enable API. Do the same thing for Geolocating

Shrove answered 7/10, 2015 at 17:20 Comment(7)
I understand why you think that, but When it is enable, google will give you a disable button, that is exactly what you see there.Lashandralashar
Plus, if you take a look at my enable URL : https://console.developers.google.com/project/75423435770063/apiui/apis/enabled this is a list of my enabled APILashandralashar
'From the picture you posted, it say it's disabled'. No it doesn't. That would be a link to disable it. Meaning that it's saying it's actually enabled.Occlusion
I enabled both "Google Maps Geocoding API" and "Google Maps Geolocation API" but still i am unable to get any places. The URL from which i am fetching data is maps.googleapis.com/maps/api/place/search/…Misdate
Additionally you need to enable places api for places auto suggestionSandpit
Places API also need to be addRoyer
Additionally, add Embed APIAnnelleannemarie
E
76

If you are using get method to fetch the places, you need to enable

Google Places API Web Service

I was facing the same issue and resolved after enabling it.

EDIT: According to https://developers.google.com/places/web-service/get-api-key

Note: The Google Places API Web Service does not work with an Android or iOS restricted API key.

So you have to create new key if or remove restricted access of existing key to work it properly.

Epigrammatist answered 29/9, 2016 at 18:33 Comment(2)
This is the correct answer for the Google reviews FYI. Note, Another thing that can happen, if you have a previous to June 2016 account you may not need this for those domains. I ran into this issue and needed the key for the new ones.Lint
It now works fine with Google Places API Web Service, thx a lot !!Hupp
C
55

Need to enable Directions API as well in the Google API Console. I have the following enabled:

  • Directions API
  • Geocoding API
  • Maps Javascript API

I also have Geolocation API enabled but the console doesn't show it as being used (0 requests). But maybe it's not real-time reporting so doesn't hurt to enable anyway.

Canaille answered 17/5, 2018 at 17:59 Comment(0)
H
27

I am late, but here's another gotcha : Google shows the API as enabled, but in fact they are not. Disable then re-enable it.

Herra answered 3/4, 2017 at 14:36 Comment(6)
But I need to do this every timeFootball
really ? This actually solved my issue. Turn it on and off seems to always be the go to solution, thanksFlense
Very true. It all shows enabled API services, but none of it is. You have to click each service and then enable it. This actually makes more sense but the message is not helping.Gerri
Worked for me. December 2019 and this is still an issueClaytonclaytonia
This worked for me. This is still an issue on September 2020.Notation
Worked for me. This is still an issue till August 2021.Margaret
R
25

It's probable that the OP enabled some, but not all, of the APIs they needed and ALSO didn't specify the enabled APIs that the key can call. There's a somewhat tricky UX feature in the Google Cloud Console for restricting access to API keys that can potentially lead to issues.

The following steps resolve the errors every time for me:

First check that the APIs you need are enabled (I've included common APIs for most basic Maps implementations at the bottom of this answer) at https://console.cloud.google.com/google/maps-apis/api-list:

And if they aren't, go to the top-left Navigation Menu > APIs & Services > Library, then select the APIs you need and click the Enable button under each one.

enter image description here

Next, check whether the API key is restricted by API. Do this by going to Navigation Menu > APIs & Services > Credentials then clicking the API key. If you're restricting calls from the key by API, then make sure each one you need is checked in the API list on that screen:

enter image description here

The tricky UX is that this list will not display all of the available APIs by default. For example, if you haven't Enabled the Places API, it will not appear on the list of APIs that the key can call until you do:

enter image description here enter image description here

That's a minor gotcha that can lead to some confusion. The APIs that seem to get things running smoothly for most basic Maps implementations are:

  • Geocoding API
  • Geolocation API
  • Maps JavaScript API
  • Places API
Reformation answered 25/3, 2021 at 6:34 Comment(1)
This was very useful. Thank you. My issue was the API key was restricted to 3/4 available services.Bradfield
A
14

Here are the steps that worked for me:

  1. Enable Directions API; Geocoding API; Gelocation API console.cloud.google.com/google/maps-apis
  2. Enable APIS and Services to select APIs console.developers.google.com/apis/library
Anechoic answered 16/10, 2018 at 17:16 Comment(0)
B
10

You need to enable billing to access some of the Google Map APIs

Error messages | Google Map JavaScript API

Butterworth answered 15/2, 2019 at 8:5 Comment(1)
If your billing is disabled, you have got another error message.Arlie
U
8

For me, it was Maps Embed API that I had to enable.

In the Google Cloud Console

Go to API tab, look through the Additional APIs section and try to enable any map-related APIs.

enter image description here

Urdu answered 29/4, 2020 at 20:46 Comment(0)
R
7

In the API manager menu, you should be able to click overview, select the relevant API under the Google Maps APIs heading and map icon.

Your page might be using some other API's , like Places. Enable them all and see if it helps.

Google Places API Web Service Google Maps Geocoding API

Ranie answered 7/7, 2016 at 15:47 Comment(0)
H
5

You need to enable the APIs from link:

https://console.cloud.google.com/apis/library?

Haunch answered 24/9, 2019 at 17:40 Comment(0)
F
3

Sending a get request with axios from a webpage, I needed (finally) to enable also Geocoding API.

I also have Places API, Maps Javascript API, and Geolocation API.

Thanks to these guys

Failing answered 11/10, 2020 at 22:20 Comment(0)
C
2

You forget to enable your service in Developer console.

Cure answered 4/9, 2017 at 17:12 Comment(0)
T
2

Since the google policies update, you need to enable billing to access Map API.

Tamera answered 2/10, 2018 at 14:22 Comment(0)
S
2

This may help somebody in future that's why adding this answer.

In my Case for android studio project. I have to enable Places API as well to get suggestions

This works for me.

Sputnik answered 5/12, 2020 at 20:33 Comment(0)
F
2

In my case, I tried to solve with all of the above answers but can't solve the error.

  • Please check API restrictions in the Credentials.
  • There have 2 options "Don't restrict key" and "Restrict key".

I used the "Restrict key" option and only check the API "Maps SDK for Android" that why I got the error. Need to check what APIs do you want to use. After edit the restrict key you need to click save.

The "Don't restrict key" option should be ok (Google will be shown a security warning ⚠)
Following images show step by step.

enter image description here enter image description here enter image description here

Flyleaf answered 8/3, 2021 at 8:4 Comment(0)
H
1

If you don't have the API enabled, but have an API key, you won't get that error if you run an API from the browser (such as when displaying a map) or pass the request to the curl command. You only get that error if you call an API within code. In Python, it doesn't matter if you use urllib, pycurl, construct the curl command and pass it to subprocess.check_output(), or send the request using jQuery.get(); you still get that error. I wonder how Google knows the difference.

Highup answered 12/5, 2017 at 4:25 Comment(0)
P
1

I experienced the same issue on a Drupal site. After enabling the Geocoding API on the Google Cloud Platform, works for me. On my setup I require two APIs, Geocoding and Maps Javascript APIs.

Proto answered 27/9, 2018 at 14:6 Comment(0)
C
1

if faceing that error like geocoding access denied : so you can enable geocoding api service from getKey account.enter image description here

Checked answered 28/6, 2019 at 8:6 Comment(0)
I
1

Had the same issue, API was enabled for my project but not for the specific API key I was using.

You should be able to see your API keys here: https://console.cloud.google.com/apis/credentials

Then click on the key you're using and enable the API for that. For me it took ~5min for the changes to take effect.

Invincible answered 11/9, 2019 at 16:30 Comment(0)
I
1

It is also possible to enable APIs with the Cloud SDK. https://developers.google.com/maps/documentation/geocoding/cloud-setup#enabling_apis

gcloud services enable \
    --project "PROJECT" \
    "geocoding-backend.googleapis.com"

https://cloud.google.com/sdk/gcloud/reference/services/enable

Isbell answered 25/10, 2021 at 17:53 Comment(0)
A
0

Places API and Places SDK for Android are two different APIs . Android devs enable both of them.That worked for me!

No need to enable Geocoding and Geolocating APIs they have different purposes.

Absolutely answered 12/6, 2019 at 10:48 Comment(0)
G
0

For Angular developer:

When I need to use agm-direction package, the console shows that "you have to have a credential key first, please go to here", but I already have one so I can view the google map.

Aftet a while, I found the only thing you need to do is go to Direction API and enable it, then wait for about 10s, you are good to go. The whole thing sums up that the console log didn't tell what API is needed exactly.

Gonococcus answered 5/10, 2019 at 8:54 Comment(0)
E
0

{ "error_message" : "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console", "results" : [], "status" : "REQUEST_DENIED" }

Enabling Directions API made me this error fixed

https://console.developers.google.com/apis/library/directions-backend.googleapis.com

https://console.developers.google.com/apis/library/directions-backend.googleapis.com

Euplastic answered 20/7, 2020 at 1:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.