0

On some domains Google Maps returns instead of image this error message: The Google Maps Platform server rejected your request. 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

Domains where it does not work:

Domains where it works:

The image I display on web is from http://maps.googleapis.com/maps/api/staticmap URL. It is Google Maps Stati API https://developers.google.com/maps/documentation/maps-static/intro

Why on some domains it works and some not? If it wil not work for any domain, then I think I need to add "key=YOUR_API_KEY" parameter.

I spent many hours trying to find out the reason, but did not succeeded. Any help is very welcome.

Pavel
  • 25
  • 1
  • 8
  • In the past (and this is probably still the case), domains that were using the API before keys became **required** were "grandfathered" with keyless access (they will work without a key). When were the domains above created? When did they start using maps? Keys are now required, so regardless whether the domains "work" without keys or not, it is best to add a valid key to the request. – geocodezip Jul 30 '18 at 18:37
  • possible duplicate of [The Google Maps API server rejected your request](https://stackoverflow.com/questions/19408066/the-google-maps-api-server-rejected-your-request) – geocodezip Jul 30 '18 at 18:40
  • @geocodezip Thank you very much for your advice. You are true. I have about 150 websites each running on separate domains - the are listed https://en.car-moto-club.com/ On those which are created 2002-200x there is no need of API key. Those registered 201x does not work without API key. My first impression was it is somehow related to how old is the website / domain. Or what is the Page rank - I found that allmost all most visited websites works without API key. – Pavel Jul 31 '18 at 09:10
  • @geocodezip Concerning domain / website how old it is registered - there are exceptions - ie. club-honda.eu or rover-club.net which is registered in 2006. SO maybe it will be Page rand / visitors count related? – Pavel Jul 31 '18 at 09:19
  • @geocodezip I found one interesting thing - you can test if Google Static Map API works on any domain - even foreign domains. I test it by editing the page in Chrome right mouse popup click / Inspect. Adding IMG element on the site. Ie. on this website stackoverflow.com it works without API key, too. – Pavel Jul 31 '18 at 09:35
  • Stackoverflow.com is definitely grandfathered on keyless access to the Google Maps APIs – geocodezip Jul 31 '18 at 09:39
  • @geocodezip if you add your comment as an answer, I will accept it as an answer. – Pavel Jul 31 '18 at 09:41

2 Answers2

0

Google rejects all the requests for static images that does not include api key in URL.

Google replies answer

I don't know Google's threshold, but en.aston-martin-club.com is blocked by Google obviously. You must include api key in URL at least.

wf9a5m75
  • 6,100
  • 3
  • 25
  • 59
  • Thank you very much for your advice. But Google does not rejects all the requests for static images that does not include api key in URL. As you can see ie. on http://en.renault-club.cz/test_mapa.php .. there is no API key and it works. Same for around 20 other domains. It will be somehow related to age of domain / website as @geocodezip mentioned .. or Page rank / visitors count. – Pavel Jul 31 '18 at 09:26
  • Anyway I tried to generate new API key. It has to use Static API - HTTP referer restriction. I used it in this format and it works: *.ktm-club.cz/* – Pavel Jul 31 '18 at 09:37
0

In the past (and this is probably still the case), domains that were using the API before keys became required were "grandfathered" with keyless access (they will work without a key).

Keys are now required, so regardless whether the domains "work" without keys or not, it is best to add a valid key to the request.

The things that determine whether or not the domains are "grandfathered" to keyless access are:

  • When the domain was created
  • When the domain started using the Google Maps APIs
geocodezip
  • 158,664
  • 13
  • 220
  • 245