Ten projekt interfejsu API nie jest upoważniony do korzystania z tego interfejsu API. Upewnij się, że ten interfejs API jest aktywowany w konsoli interfejsów API


195

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?


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).
Dr.Molle

Odpowiedzi:


392

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


14
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.
cyber8200

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 API
cyber8200

2
'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.
Lee

2
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/…
iPhoneDeveloper

4
Additionally you need to enable places api for places auto suggestion
Moumit

64

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.


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.
Mike Q

1
It now works fine with Google Places API Web Service, thx a lot !!
Jaggana

30

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.


23

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.


But I need to do this every time
Akshatha Srinivas

naprawdę? To faktycznie rozwiązało mój problem. Włączanie i wyłączanie wydaje się zawsze być rozwiązaniem, dzięki
OneOuGu

Bardzo prawdziwe. Wszystko pokazuje włączone usługi API, ale żadna z nich nie jest. Musisz kliknąć każdą usługę, a następnie ją włączyć. To faktycznie ma większy sens, ale przesłanie nie pomaga.
chidimo,

Pracował dla mnie. Grudzień 2019 i nadal jest to problem
SomeGuyFortune

8

Oto kroki, które działały dla mnie:

  1. Włącz interfejs API kierunków; Geokodowanie API; Gelocation API console.cloud.google.com/google/maps-apis
  2. Włącz APIS i usługi, aby wybrać interfejsy API console.developers.google.com/apis/library

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





2

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.


2

Dla mnie musiałem włączyć Maps Embed API .

W Google Cloud Console

Przejdź do karty API, przejrzyj sekcję Dodatkowe interfejsy API i spróbuj włączyć dowolne interfejsy API związane z mapą.

enter image description here


1

Ten sam problem wystąpił na stronie Drupal. Po włączeniu interfejsu API geokodowania na Google Cloud Platform działa dla mnie. W mojej konfiguracji potrzebuję dwóch interfejsów API, Geocoding i API Javascript.


1

Od czasu aktualizacji zasad Google musisz włączyć rozliczenia, aby uzyskać dostęp do interfejsu API Map.



1

Miałem ten sam problem, interfejs API został włączony dla mojego projektu, ale nie dla określonego klucza API, którego używałem.

Powinieneś zobaczyć klucze API tutaj: https://console.cloud.google.com/apis/credentials

Następnie kliknij używany klucz i włącz do tego interfejs API. Dla mnie zmiany zajęły ~ 5 minut.


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.


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.

Korzystając z naszej strony potwierdzasz, że przeczytałeś(-aś) i rozumiesz nasze zasady używania plików cookie i zasady ochrony prywatności.
Licensed under cc by-sa 3.0 with attribution required.