Which Google Maps API to enable to get http get to work - google-maps

I want to use this get in order to get Lat/Long for an address.
Currently, it always returns REQUEST_DENIED. This API project is not authorized to use this API.
I have ensured that my key is enabled, and currently, it has no restrictions for testing purposes. This is the url, with the actual key replaced with 12345.
https://maps.googleapis.com/maps/api/geocode/xml?address=123%2C%20Harbor%2C%20Woods%20Circle%2C%20Safety%2C%20Harbor%2C%20FLCA%2C%2034695&key=12345
I have tried Disabling the Google Maps API, and then Enabling it again, but I still get the same error message.
I am thinking that maybe I don't have the right API enabled on this, as it should be working.

To use the Geocoding Web Service you need to enable it in the Google API Console

I just found it, I needed to enable the Geocoding API.

Related

Google Maps API is never satisfied

If I use URL referrer authentication with Geocoding API it says:
There was an error while trying to fix the Venues geolocation information: API keys with referer restrictions cannot be used with this API.
Which after research I find that this means that Google Maps is looking for IP address authentication.
But if I use IP address authentication with Javascript Maps API it says:
JavaScript API error: RefererNotAllowedMapError
https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: https://example.com
What can be going on?
How can I fully satisfy the good ol'Google Maps?
It looks like you're using two different Maps APIs; the client-side JavaScript API and the server-side Geocoding API web service. This means you need 2 API keys; one restricted with HTTP referrers for client-side use, and the other one restricted by IP address for web services only.
To learn more on how API key restrictions work check out Google's documentation on API key best practices.
Hope this helps!
I know this is 3 months old now. But I had the same problem and I found out how to solve this.
As evan said, you need 2 API Keys. And annoyingly, The Events Calendar only have one field for the API Key.
BUT, I found a link here: https://support.theeventscalendar.com/ to https://support.theeventscalendar.com/716190-Using-Google-Maps-API-Key-Restrictions. The page redirects though... But I managed to screen shot parts of it before it redirects and found this snippet: https://gist.github.com/cliffordp/a2ec320313afbc1ffb5f0e5ac654b7fb
(I changed the code to use a define instead because I don't want my API key in git)
This filter will make it possible to have two API KEYS.

How can I reactivate the Google API key?

We've been sending addresses to Google for a while and then getting the coordinates from Google back and storing them.
This won´t work anymore.
From Google, we get the following error message:
You must use an API key to authenticate each request to
Google Maps Platform APIs. For additional information, please refer to
http://g.co/dev/maps-no-account
What must I change in the API settings, so it works again?
Welcome to the community!
You need to add a Billing Account, Maps API is not for free anymore.
https://cloud.google.com/maps-platform/

Google Direction APIs error: REQUEST_DENIED

We are developing and that needs the direction APIs to measure the distance between 2 addresses.
The only option I have is http as this part of the app doesn't have a map.
I am trying to understand the proper usage of the direction APIs, related Keys and quota.
First we were issuing the http call without a key.
maps.googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425&destination=43.63881%2C-79.42745
Sometimes we get back the proper response, but many times I get OVER_QUERY_LIMIT
(even though we are hardly issuing any calls, it is impossible that we are triggering any limit)
Then after visiting this link:
https://developers.google.com/maps/documentation/directions/usage-limits, we enabled the API key and added the key to the call.
So the call now looks like this
http://maps.googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425&destination=43.63881%2C-79.42745&key=AI***AQ
Every time, we issue the call, we get back REQUEST_DENIED
Ensure you have enabled the following APIs
Directions API
Distance Matrix API
Geocoding API
Geolocation API
Places API
In case its for Android, also enable the following
Maps SDK for Android
To resolve this issue use the https:// instead of http:// in your base url. I have been testing some items and got the same error message. Once I changed it to https:// I was able to make the call.
Hope this helps anyone else with this issue.
The error message I get with your request (including a valid key) is "Requests to this API must be over SSL. Load the API with https: instead of http:". You need to make the requests over https.
https://maps.googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425&destination=43.63881%2C-79.42745&key=VALID_API_KEY

The Google Maps API server rejected your request

I m working on an application which renders google maps on an image as below
<img alt="Google Maps (Scotland)" src="http://maps.google.com/staticmap?size=480x200&maptype=mobile\&markers=55.9368450758,-3.03604939504,reda|55.9454374538,-3.18124534297,redb&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
The map is not getting rendered and when I right click on the source of image and click the url, I get the following message
"The Google Maps API server rejected your request. This site or IP is not authorized to use this API key."
I have checked the API Access on https://code.google.com/apis/console the API key seems to be all correct. Just wondering how to fix the site and IP bit?
See below the settings in google API console
Make sure you have enabled "Static Maps API" service in addition to "Google Maps API".
Make sure you have enabled the Google Maps related Services ("Google Maps Embed API" and "Static Maps API") like bellow:
And then mark them:
In the new layout you find it here:
It works for me when I enable "Google Maps Embed API" and "Static Maps API"
Make sure you have a Browser key in the Simple API Access section, and make sure the Referers is set to Any referer allowed
Activate Google Map Key here: https://console.developers.google.com/apis/api/maps_embed_backend/overview?project=[your-project]
It will enable your map instantly.
I had the same issue. I used this instead of this and that resolved the issue. Some other api parameters didn't work on the second URL either (specifically marker styles), guessing the old API is deprecated
Would also recommend using https as opposed to http. This way your users wont get cert warnings if they view the page over SSL
Not only you need to enable google static API, but also you need to include your api_key in the link.
From june 2018 you have to configure a billing account to continue using Maps static API; google "donate" 200$/day of credit
Maps Static API Usage and Billing
add key in the url is not enough
As commented by Pointy, you need to use an API key with all referrers allowed in order to use Static Maps.
You can achieve that just by removing all the referrers from the list of authorized referrers. Or just create a new API key and use it without further configuration.
More info at the Documentation

Access Denied when attempting to use Google Maps Geocoding Service with a Console API Key

UPDATE: In an effort to give a more clear question. How do I use the Google Console API key with the Google Maps Geocoding Web Service API? At the moment the request comes back as denied, when I specify the key but even though it failed it is logged in the Google Console API site's reports section.
Original Question
I have an existing app that has been modified to start geocoding address at the time they are entered (for use within the app on a Google Map). The volume expected for this is expcted to be within the free offering's limites and does not require a key at this time. However now I have to geocode all of the existing addresses. I have a small windows app (C#) that will loop through them one at a time, request they be geocoded (via https://maps.googleapis.com/maps/api/geocode/json) and store the results in the database. However I keep running into the query limit. To help alleviate this I've setup an account on Google API Console (https://code.google.com/apis/console/) so that I get go over the limit and just be billed for the overages.
The problem is in order to do utilize this billing alternative I have to provide a Console API Key to the request, but every time I do so I get a response back with a status of REQUEST_DENIED.
My URL looks like this
https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA+94043&sensor=false&key=123abc
If I take off the key it works fine, but with it on it fails. Now, I have seen other questions similar to this when looking around but can find no answer to the issue.
I've tried various alternate domains including maps.google.com, maps.googleapis.com and maps-api-ssl.google.com all seem to have the same problem from what I can tell.
Here's what I've been able to find out so far:
The service is listed in the Google Console API's site as Google Maps API v3, (there is a separate entry for v2) so I don't think it's a problem with keys no longer being mandatory in v3.
I know the requests are getting through and being correctly logged against this API key because with each failed attempt the request count goes up by one on the Reports tab of the Google APIs Console.
*I know it's not a problem with it not being accessed via a web page because the Console API explicitly lets you generates keys intended for Server/Service use and you can restrict access to them via IP address, not URL Referrer.
*I've also verified the parameter syntax as it's outlined on this page, as are other usage
*These seem to be generic to the Console API system but there is no mention of exceptions to these practices when used for the Google Maps API.
I even tried to contact Google but apparently they don't offer support over the phone (I was hoping to be done with this today but that's not looking likely).
It seems the key is not necessary anymore, since it doesn't increase your limit of free geocodings.
It was a legacy of v2, but geocoding API v2 was fully deprecated last March, 8.
If you need to use more than the free limit, I think you must adquire the Enterprise license.
Regards,
Eduardo.
I ran into this same issue and solved it by enabling the Geocoding API on the Google apis dashboard. Even though I'm using the Google Maps JavaScript API v3, it still required me to enable the Geocoding API as well. Make sure you understand the google's quota limits and billing system before enabling any API access. Hope this helps!
Late to this answer, but just in case anyone else has issue. Billing needs to be setup first and like Dylan said you also have to enable Geocoding API(this got me). At least I did for my locations app that shows multiple store location addresses.