This API project is not authorized to use this API

2020-01-23 10:19发布

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?

16条回答
Animai°情兽
2楼-- · 2020-01-23 10:53

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.

查看更多
对你真心纯属浪费
3楼-- · 2020-01-23 10:54

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.

查看更多
我命由我不由天
4楼-- · 2020-01-23 10:54

You forget to enable your service in Developer console.

查看更多
Viruses.
5楼-- · 2020-01-23 10:58

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.

查看更多
萌系小妹纸
6楼-- · 2020-01-23 10:59

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.

查看更多
放荡不羁爱自由
7楼-- · 2020-01-23 11:03

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

查看更多
登录 后发表回答