I've been using Google Maps API v3 for some time without an API key, and it worked well.
It still works, but I get a warning in the console:
Google Maps API warning: NoApiKeys
https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
I include the script the standard way:
<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
And google.maps.version indicates that I'm using 3.24.2.
In the Google documentation I can only see the different ways to obtain a key, but there is no indication if it's required or not. I noticed the warning today and I'm quite sure it didn't appear a few weeks ago.
Everything is working fine for now, but I'm afraid that maps access without an API key will be ceased in the future. I'm reluctant to register for a key if I don't absolutely need to.
Should I worry about it?
Creating and using the key is the way to go.
The usage is free until your application reaches 25.000 calls per day on 90 consecutive days.
BTW.: In the google Developer documentation it says you shall add the api key as option {key:yourKey} when calling the API to create new instances.
This however doesn't shush the console warning.
You have to add the key as a parameter when including the api.
<script src="https://maps.googleapis.com/maps/api/js?key=yourKEYhere"></script>
Get the key here: GoogleApiKey Generation site
A key currently still is not required ("required" in the meaning "it will not work without"), but I think there is a good reason for the warning.
But in the documentation you may read now : "All JavaScript API applications require authentication."
I'm sure that it's planned for the future , that Javascript API Applications will not work without a key(as it has been in V2).
You better use a key when you want to be sure that your application will still work in 1 or 2 years.
I had the same problem and I found out that if you add the URL param ?v=3 you won't get the warning message anymore:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3"></script>
Reproduction online
As pointed out in the comments by #Zia Ul Rehman Mughal
Turns out specifying this means you are referring to old frozen version 3.0 not the latest version. Frozen old versions are not updated with bug fixes or anything. But this is good to mention though.
https://developers.google.com/maps/documentation/javascript/versions#the-frozen-version
Update 07-Jun-2016
This solution doesn't work anymore.
Google maps requires an API key for new projects since june 2016. For more information take a look at the Google Developers Blog. Also more information in german you'll find at this blog post from the clickstorm Blog.
Related
API key for Google maps on the project http://kislorod123.ru does not work
At the same time we added the domain name in 3 versions: http://joxi.ru/BA0N8P7UMqal8m
At the moment, we have removed the restrictions for the maps to work on the sites, because we are a web studio and customers are complaining, but the map does not work either.
Tell me how to solve the problem with the operation of the API in the mode of limited access and without restrictions
You may try using the recommended format of http referrers. Remove all the restrictions for kislorod123.ru then add the following restrictions below:
kislorod123.ru
*.kislorod123.ru
These two will allow your API key to be used in all subdomains and paths in your website.
Also note to remove any duplicate restrictions as this will affect the restriction and may cause error. Also the http:// is not necessary.
I have just generated an API Key to enable us to display a Google map on our website but I'm getting the ExpiredKeyMapError. This is the exact same issue as this stackoverflow query from 8 months ago, but that has never received a solution: Google Maps ExpiredKeyMapError with recently created API Key
When the page first loads, the map shows for a split second and then it disappears, to be replaced with a grey box that says:
"Sorry! Something went wrong. This page didn't load Google Maps
correctly. See the JavaScript console for technical details"
And when I pull up the console, this is the error message I get:
Google Maps API error: ExpiredKeyMapError
https://developers.google.com/maps/documentation/javascript/error-messages#expired-key-map-error
SCRIPT12008: WebSocket Error: Incorrect HTTP response. Status code
403, Forbidden
and that last line just keeps repeating.
Any help much appreciated because I have no idea how to solve this myself.
I had the same error after generating a new API key, but I had JavaScript API already enabled and everything correctly setup.
While searching for an answer and checking what else I can do, the key started to work. So every single time you create a new key, be patient and expect it to work within 1-8 minutes.
I discovered that it was not working because I hadn't separately enabled the Google maps javascript API. Once I'd done that, the map started working a few minutes later.
I discovered that it was not working because I hadn't separately enabled the Places API. Once I'd done that, the map started working a few minutes later.
We ported our site to Google maps, but we get different errors when loading a map using the JavaScript Maps API (v3 of course). Other times the map loads correctly. The two most prominent errors are:
"Google has disabled use of the Maps API for this application. See the
Terms of Service for more information
http://www.google.com/intl/en_US/help/terms_maps.html." (JS Alert)
And:
"This site has exceeded its daily quota for maps. If you are the
creator of this site, please visit the documentation to learn more."
(this is a DOM overlay)
Live minimal example:
This code is not yet live but there's a minimal example here: http://mappat.com/maptest.php. It is simply Google's own Hello World example with our key filled in and even that gives problems.
Network traffic inspection:
I noticed the first error is shown when 'AuthenticationService.Authenticate' fails (returns [0,5,0]), the second when 'QuotaService.recordEvent' returns [0,null,0]. These are remote calls from within the SDK and I don't know if these details are relevant.
What we tried:
Billing is enabled by the way and we stay way below our quota limits. I tried a lot of things already, new key, waiting a few days, turning the Maps API off and on again in the console, etc. I filled in the allowed referrers but also left it open to allow others. No difference.
I don't dare to start a new project in de dev console because this whole thing started when I did actually just that because I had (different) problems with the server-key. That server part is now working flawlessly btw, kind of ironically.
[Edit: I just tried to leave out the API key when loading the JS maps file, which, fingers crossed, seems to work. But now the server-side calls to places/searchtext start to give random "The provided API key is expired." errors, again (same reason we created the new project). Coincidence? Also, I don't like this option, especially with regards to the future (reaching 25k, going beyond and going Business Account)].
So, I'm stuck. Hence my first SO question ever. Could it be that we are blacklisted? Perhaps because of the duplicate project? Is there a way to find that out and/or to get us 'reset'? Or am I simply overlooking something?
Any help is appreciated because until we solve this, this is a deal-breaker.
Sidenote: I also filed a bug report because I think giving random errors on itself is not expected behaviour. It's up to the dev team to decide if they agree. If not, we still have a problem, hence this SO question.
I think you have a syntax error in your php var dump:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDYuWR5wqux1_iTmfIWPveheIOr5PhqjEs&?>sensor=FALSE&language=en">
</script>
you have ?> just before sensor
This issue magically disappeared after a week or so.
I didn't get any response from Google, but they may have change/reset something behind the scenes, of course. The bug is still marked 'new', by the way.
My advice to others having this issue is to first check some basic things, since the individual errors I got could also result from actual things you're doing wrong (ie mistake in allowed-referers). If all seems okay after triple checking, just remove the API key from the request, test along like that for a while and retry in a couple of days.
Just came across this error today intermittently:
Google has disabled use of the Maps API for this application. See the Terms of Service for more information: http://www.google.com/intl/en-US_US/help/terms_maps.html.
somehow when I refresh the page, the map comes back again. I thought if it's a violation, it would have revoke the key permanently and not allow the map loads using this key anymore. Also, the error always happens at page load. I have yet to hit the error if it's already successfully loaded. I briefly read through the terms but couldn't find anything suspicious. Anyone can advise on how to go about this error? Should I be checking for some js error or the map terms? Thanks.
This is how the map script looks like:
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false&libraries=places&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" type="text/javascript"> </script>
You could try the documented URL for the maps API script:
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=SET_TO_TRUE_OR_FALSE">
</script>
Where key is recommended but not mandatory and sensor is required.
(so this should work):
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?sensor=SET_TO_TRUE_OR_FALSE">
</script>
I noticed the same issue this morning as well, I thought it was because I was using a subdomain of the domain registered with the API service, but it is happening to my actual domain as well.
I have removed the api key from the library url which seems to have fixed the problem for now, I will put it back when it starts working again. This must be an issue with Google's licensing servers since it is affecting their own websites as well.
Long ago I've setup a Google Maps project using the old API version(v2). I know Google Maps API v2 is being deprecated and I'm working on rewriting it for the new version, but I need this working until then.
Suddenly, the map stopped working throwing this error in an alert box:
Google has disabled use of the Maps API for this application. This
site is not authorized to use the Google Maps client ID provided. If
you are the owner of this application, you can learn more about
registering URLs here:
http://code.google.com/apis/maps/documentation/premier/guide.html#URLs
I haven't changed anything in the current app and the requests per day are less than 1000(way far from the daily quota). The first thing I've noticed is that there was no allowed referrers specified. But even after they was set to(replacing sitename.com with my domain):
sitename.com
sitename.com/*
www.sitename.com
www.sitename.com/*
*.sitename.com
*.sitename.com/*
There was no result whatsoever even after couple of hours. The reason why this application suddenly stopped working is still a mystery to me (once again - nothing has been changed in my code or the google account), but most importantly I need really fast solution.
Any ideas?
Sounds like you might be using v2.x. There was a release of v2 very recently. If you aren't using v2.s; you might try that (or v=2) to see if it resolves your problem (for now, they have gone to a 2 week upgrade cycle on v2: "We have updated v=2.x to 2.441. v=2 will be updated in 2 weeks and v=2.s will be updated in 4 weeks.")