Google Maps API warning: NoApiKeys
Google MapsGoogle Maps-Api-3Google Maps Problem Overview
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?
Google Maps Solutions
Solution 1 - Google Maps
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][1]
[1]: https://developers.google.com/maps/documentation/javascript/get-api-key "Google Api Genrator Site"
Solution 2 - Google Maps
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.
Solution 3 - Google Maps
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>
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.
Solution 4 - Google Maps
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.