"The key provided is not a valid Google API Key" - eh?! It's showing up OK in the API Console...

10,949 views
Skip to first unread message

Jack W-H

unread,
Jan 9, 2012, 4:43:24 AM1/9/12
to Google Maps JavaScript API v3
Hi Googlers,

This morning I noticed on my site the following message in the Chrome
Javascript Console:

"The key provided is not a valid Google API Key or it is not
authorised for the Google Maps JavaScript API v3 on this site. If you
are the owner of this application, you can learn about obtaining a
valid key here: http://code.google.com/apis/maps/documentation/javascript/tutorial.html#Obtaining_Key"

Here is a screenshot of my API Access console to confirm this is
correct: http://i.imgur.com/sVq69.png (I have blurred out the personal
details). I would provide a link to test and debug - but I can't. This
is for a private client who would rather I did not share it at the
moment whilst the site is still in development.

I can show you that this is how I'm loading the snippet, blanking out
the last part of my key:

<script src="https://maps.googleapis.com/maps/api/js?
key=AIzaSyD_On9NiqOTjMdRZvgWXXXXXXXXXXXXXXX&sensor=false"></script>

I'm using the V3 API. I was not noticing this the other day, but maps
still seem to be being displayed. Also, I am seeing all the requests
count up in the API Console, implying it does seem to be able to
connect. Any advice?

Thanks!

Jack

Rossko

unread,
Jan 9, 2012, 2:31:19 PM1/9/12
to Google Maps JavaScript API v3
> Any advice?

Check you are not loading the API twice (the usual cause behind key
error but still with map)

Apart from that, there's probably not much help in the face of such
secrecy.
Perhaps you could set up a simplified public test site to demonstrate
your problem.

Jack W-H

unread,
Jan 10, 2012, 5:27:01 AM1/10/12
to Google Maps JavaScript API v3
Thanks for the advice. Interestingly enough, I came back to it a few
hours later to find the problem had magically disappeared, despite the
fact I didn't change any code or anything. Odd - a temporary glitch at
Google's end?

Tomek Wasiak

unread,
Jan 10, 2012, 8:55:39 AM1/10/12
to google-map...@googlegroups.com
Today I have the same problem on my wesite. I didn't change anything in my code.

Tomek Wasiak

unread,
Jan 10, 2012, 11:04:21 AM1/10/12
to google-map...@googlegroups.com
OK, I may figured it out.
In API Console in my allowed refferrals I had: *.myapp.appspot.com/*
I changed it to
myapp.appspot.com/* and error message doesn't apear anymore.

Jesse

unread,
Jan 10, 2012, 3:08:39 PM1/10/12
to google-map...@googlegroups.com
Hi Everybody,

I have figured out a solution to this problem:

So apparently Google updates their versions quite frequently. To solve this, a little bit of code needs to be put into the javascript code below, since Version 3.6 is the latest, we will add it.

Replace ......... with "js?v=3.6&"
<script type="text/javascript" src="http://maps.google.com/maps/api/.........sensor=false&amp;key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"></script>

It should look like this:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.6&sensor=false&amp;key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"></script>

You will have to replace in each instance this code appears within your site.

Luke Mahé

unread,
Jan 10, 2012, 3:20:49 PM1/10/12
to google-map...@googlegroups.com
This isn't really the right solution. You should instead make sure that you have generated a key in the apis console (https://code.google.com/apis/console/b/0/?pli=1) and make sure that the allowed referrals matches your domain(s).

Setting the version to 3.6 will only delay the warning and not fix it.

-- Luke



--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/DixSsmlTyu4J.

To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Andrew Leach

unread,
Jan 10, 2012, 5:02:25 PM1/10/12
to google-map...@googlegroups.com
On 10 January 2012 20:20, Luke Mahé <lu...@google.com> wrote:
> This isn't really the right solution. You should instead make sure that you
> have generated a key in the apis console
> (https://code.google.com/apis/console/b/0/?pli=1) and make sure that the
> allowed referrals matches your domain(s).
>
> Setting the version to 3.6 will only delay the warning and not fix it.

Interesting answer.

If v3.6 is not specified, and the key is correctly generated in the
API console, why are there so many queries here about invalid key
messages which are intermittent? It's that apparently random
inconsistency which setting the version is intended to avoid. Once the
key system is working consistently, there's no reason not to use it;
while it isn't, there's every reason not to use it.

Jeremy Geerdes

unread,
Jan 10, 2012, 5:53:15 PM1/10/12
to google-map...@googlegroups.com

There is apparently an issue in the APIs Console with validating keys. It has affected Translate, Custom Search, and Maps APIs. It may affect,more, but those are by far the highest volume APIs, so the others may go unnoticed yet. The dev team behind the Console (i.e., the Google APIs team) is almost undoubtedly aware of the situation, which has been reported on the AJAX APIs Group as well, but they have not as yet provided a complete solution.

Jg

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.

Luke Mahé

unread,
Jan 10, 2012, 6:24:26 PM1/10/12
to google-map...@googlegroups.com
Jeremy,

Can you please email me directly your project id that you are seeing these issues on?

Thanks

-- Luke

Jeremy Geerdes

unread,
Jan 10, 2012, 6:47:45 PM1/10/12
to google-map...@googlegroups.com
I don't have a project that is directly affected, but I am active in the AJAX APIs Group, which has seen a number of these reports for the Translate API and a handful for the Search API.

Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

For more information or a project quote:

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

Tomek Wasiak

unread,
Jan 11, 2012, 8:36:29 AM1/11/12
to google-map...@googlegroups.com
As I posted earlier, I think the problem is that API Console stopped allowing wildcard subdomains in allowed referers. Can someone confirm this?

sterrish

unread,
Jan 11, 2012, 11:36:26 AM1/11/12
to Google Maps JavaScript API v3
Change your Api call to http://maps.google.com/maps/api/js?v=3.6&sensor=false&key=xxxxx
where xxxx is your existing Api key.

This worked for me.

Luke Mahé

unread,
Jan 11, 2012, 5:35:30 PM1/11/12
to google-map...@googlegroups.com
As I said before, setting the version to 3.6 isn't a solution. You should instead check that your referrals are set correctly. We are looking into the possible wildcard subdomain problem. 

-- Luke


--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.

Barbs

unread,
Jan 19, 2012, 10:56:33 PM1/19/12
to google-map...@googlegroups.com
Hi Luke,

Do you have any suggestions for those who have checked the API Console and confirmed that it is correct however still displays this error?

ATM the v=3.6 suggestion is the only one that works for me.  If the key was incorrectly setup in the console why would this fix work?  I would hazard a guess that the v=3.6 would have little effect if the console setup was incorrect.


Vlad Fratila

unread,
Jan 21, 2012, 6:05:32 AM1/21/12
to Google Maps JavaScript API v3
v3.6 works for me as well. my console looks good.

Luke Mahé

unread,
Jan 22, 2012, 7:54:26 PM1/22/12
to google-map...@googlegroups.com
Hi Barbs,

I suggest making sure that the referrals are set correctly and that your expressions cover all your domains.

Keys were introduced in 3.7 so that is why you do not get any warnings if you set your version to 3.6.

-- Luke


--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.

ross%gete...@gtempaccount.com

unread,
Apr 25, 2012, 8:12:16 PM4/25/12
to google-map...@googlegroups.com
We're seeing this same issue, on an intermittent basis, on our website today.  I checked the API console and everything is in order.  Referrer is fine.  Nothing has been changed here in months.  Is Google having server problems today?

Ross

ross%gete...@gtempaccount.com

unread,
Apr 25, 2012, 8:13:55 PM4/25/12
to google-map...@googlegroups.com
We're seeing the same problem, on an intermittent basis, starting some time today on our website.  Had a look at the API console and everything seems in order, including Referrer.  Is Google having some server problems today?

Ross

Vivek Kumar

unread,
Apr 27, 2012, 4:19:36 AM4/27/12
to google-map...@googlegroups.com
Yesterday we too had issues with loading maps using KEY parameter...problem exists through out the day.... looks like there was some issue with google APIs....

Craig Phillips

unread,
May 7, 2012, 8:41:34 PM5/7/12
to google-map...@googlegroups.com
We setup a Google Maps page on a client website back in March and it's been running happily up until recently, now the account is constantly giving the message described at the start of this thread. It's an extremely low volume page about 200 map loads a month. Based on the API access report Google started rejecting the app on 26 April 2012 - ie. thats when the traffic drops to zero...

To test it out we created the simple maps "Hello World" example using the current API key (which we regenerated yesterday when the client first reported the problem to us). That page exhibits exactly the same problem all the time, so clearly theres a problem when even the simple "Hello World" example doesn't work.

We've been through and tried all of the "solutions" discussed here to no avail, to get it up and running for the client we've had to revert to v2, so help would be appreciated.

If there's any information we can provide/do to help track down this issue please let us know.

Cheers

Craig

On Monday, 23 January 2012 10:54:26 UTC+10, Luke (Google Employee) wrote:
Hi Barbs,

I suggest making sure that the referrals are set correctly and that your expressions cover all your domains.

Keys were introduced in 3.7 so that is why you do not get any warnings if you set your version to 3.6.

-- Luke


On Fri, Jan 20, 2012 at 2:56 PM, Barbs <barbs...@gmail.com> wrote:
Hi Luke,

Do you have any suggestions for those who have checked the API Console and confirmed that it is correct however still displays this error?

ATM the v=3.6 suggestion is the only one that works for me.  If the key was incorrectly setup in the console why would this fix work?  I would hazard a guess that the v=3.6 would have little effect if the console setup was incorrect.



--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/UjN5Wl0FP5AJ.

To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-api-v3+unsub...@googlegroups.com.

Craig Phillips

unread,
May 8, 2012, 8:43:36 AM5/8/12
to google-map...@googlegroups.com
Further investigation found that the problem was restricted to our 3 networks (our offices in Brisbane & Sydney and the clients network) - although the problem was first reported by a member of the public.

We were able to successfully connect via a 3G connection with a roaming IP address and not have any problems on a MacBook Pro or iPad - this lead me to removing the default domains listed in the restrictions on the Simple API Access keys. Now we can apparently access the maps from anywhere without the "not a valid Google API Key" turn up.

Craig

Rossko

unread,
May 8, 2012, 10:50:51 AM5/8/12
to Google Maps JavaScript API v3
> If there's any information we can provide/do to help track down this issue
> please let us know.

A page exhibiting the problem would be good (be the first in this
thrad!)
http://www.bathurst.nsw.gov.au/mapshelloworld.html comes up 404 for me

Craig Phillips

unread,
May 8, 2012, 6:06:35 PM5/8/12
to google-map...@googlegroups.com
Sorry about that as it was a testing page it got cleaned up automatically when the site staging process replicated new content across. I've added back through the staging site so it won't disappear again - the problem is that with our current "fix" its now working so there's nothing to see.

If we can replicate it reliably on a dev server I'll post a link.

Cheers

Craig

ross%gete...@gtempaccount.com

unread,
May 8, 2012, 6:13:49 PM5/8/12
to google-map...@googlegroups.com

Craig,


Don't know if this applies in your case, but as it turned out, the problem we had was that our Referrer URL pattern was missing a trailing asterisk (for matching all URLs in our domain).  Not sure why it worked the way it did for 3 months, but there you go.  I'm guessing Google fixed it around Apr 26th.  After all, a closer read of the documentation suggested that the asterisk was needed.


Ross

Andrew Leach

unread,
Jun 4, 2012, 6:30:40 AM6/4/12
to google-map...@googlegroups.com
On 2 June 2012 05:24, Danny Pryor <d...@rodanmedia.net> wrote:
> This issue seems to persist. We have a site we put together for a client in
> Georgia, and we also use the same code for a domain in Florida. The Florida
> test domain is working just fine, but the exact same code on the Georgia
> site does not, even though both domains are authorized, e.g.:
> *.example.com/* and *.example2.com/*. What I suspect with the Georgia site,
> fitnessforumgainesville.com, is that we just threw the switch on a new DNS,
> and the domain is presently repropagating around the web.  However, I won't
> know that for certain unless someone shoots down that theory (I'm not
> certain that issue would even affect Google's read in anyway, as the correct
> code is loaded on both servers) or until I know the propagation is
> absolutely concluded.
>
> Either way, this issue is one that I was able to duplicate on the Florida
> domain, then rectify later by reverting the code. Nothing I have been able
> to do fixes the problem on the Georgia domain, so I'm at a loss. If any new
> ideas have materialized since the last posts, prior to mine, I'd be quite
> grateful to hear some ideas.

One idea is to give real urls which demonstrate the problem. There's
nothing above which anyone can use to help -- what's particularly
frustrating is having rooted around on the one real domain you quote,
I find that you've removed the map code entirely.

Danny Pryor - Rodan Media

unread,
Jun 4, 2012, 8:51:31 AM6/4/12
to google-map...@googlegroups.com
Here you go: http://fitnessforumgainesville.com/contact/directions-V3.php.

Realistically, I was only making a comment. I know the code is correct because it's copied and pasted directly from Google, substituting only my key in the code. However, if there is something that I'm missing, I'd sure like to know it.

Danny Pryor
Vice-President
Rodan Media Group

www.rodanmedia.net
d...@rodanmedia.net

PO Box 30136
Fort Lauderdale, FL
33303

T | 954-561-0600
F | 954-333-6345
> --
> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.

Danny Pryor

unread,
Jun 29, 2012, 11:51:44 AM6/29/12
to google-map...@googlegroups.com
We just made a modification on our permitted sites, in the API console, to include domains with the starting asterisk AND without. The prefix asterisk would work with the "www" appended at the beginning of a domain, but not without the "www"; the moment we added the second condition, the API worked just fine. So for each site, we are now setting up the permitted referrers as follows:


This is the arrangement that seems to cover the most bases, for now.

:)

On Wednesday, June 13, 2012 7:09:49 AM UTC-4, sw45859 wrote:
Figured i would let you know what worked just now for me.

i had my referrer set up for a client as:
*.clientDomain.com/*

and i was getting the errors, now that i just reset it to:
clientDomain.com/*  - without the beginning *.

i guess googles rule parser is having an issue with the documented *. for the subdomain wildcard
it just loaded fine, hope this helps.

Enoch Lau (Google Employee)

unread,
Mar 5, 2013, 9:57:53 PM3/5/13
to google-map...@googlegroups.com
Can you please provide the hostnames that you put into the API Console, and also the full URL of the page that's accessing the API?

On Wednesday, March 6, 2013 6:14:48 AM UTC+11, Brandon Chambers wrote:
Is there any official word on this?

It seems people are having trouble all over the map with this thing.

I tried entering a whole set of hostnames with and without wildcards. None worked. I still get the "access not configured" error even with a basic curl -i call.

What's with this??? I'd be happy to share more specific details if Google is willing to support their API.

On Tuesday, November 6, 2012 1:30:37 AM UTC-8, Guillaume Chata-Simoni wrote:
Hi all,

Also got this issue, 3-4 times in two weeks...

I've entered referrers with *, without *...

tag-all.com/* *.tag-all.com/* m.tag-all.com/ dev.tag-all.com:28880/build/TagAll/production/* *.tag-all.com:28880/build/TagAll/production/* dev.tag-all.com:28880/TagAll/tagall/applications/mobile/* *.tag-all.com:28880/TagAll/tagall/applications/mobile/*

Thing is : 

- application is working fine one my Desktop iMac (using Chrome), but doesn't on my colleague iMac (same network).
- application doesn't works since yesterday (at night - France) when connected from devices (iPhone and Android), even at home and even at office (not the same Wifi).

This issue seems to be "chaotic", and, i ask help, since we got an official opening of our application today !

Thanks for response
Reply all
Reply to author
Forward
0 new messages