The key provided is not a valid Google API Key

I have the similar problem as you today and I think I solved it.

First I am assuming that you have a google map api key already. I think what you need to do is to to go API Console – Google Code and click on API access on the left. You can see your api key and just below the key, Referers: shows your allowed referers. What you need to do is click Edit allowed referers... and then add

localhost/*

to allowed referers.

I am using a MAMP to host my html, and I monitor the request my browser sent to google for api and I get this header:enter image description here

showing Referer as localhost/*

It takes several minutes for Google to process after you changed your Referer but it works fine for me afterwords.

Leave a Comment