Reputation: 47
I use an API key that I got from google maps in my swift project and it works perfectly. When I tried it on python it just gives me an error message. The code that I used and the error message I received are down below.
I already went on the Google cloud platform to get an api key for: - places api - map javascript api - Geolocation api - Geocoding api
Also with this api key I was not successful.
gmaps = googlemaps.Client(key='api-key')
geocode_result = gmaps.geocode('1600 Amphitheatre Parkway, Mountain View, CA')
I expect to get the location's id but I'm receiving: "googlemaps.exceptions.ApiError: REQUEST_DENIED (This API project is not authorized to use this API.)"
Upvotes: 1
Views: 2766
Reputation: 61
Is it possible that you are mixing up your IOS API Key with the API key for Web Services? I see there are at least two different 'Get an API Key' articles:
One for Web Services: https://developers.google.com/maps/documentation/geocoding/get-api-key
And one for IOS : https://developers.google.com/maps/documentation/ios-sdk/get-api-key
And if so, the solution is:
Sometimes Google will show an API as enabled, but it's actually not enabled. Try disabling and re-enabling the Web Services API key.
Another gotcha is that you might need to enable the Directions API as well.
Upvotes: 1