<iframe width="100%" height="427" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=place_id:[place_id]&key=[my_key]" allowfullscreen></iframe>
"Google Maps Platform rejected your request. This IP, site or mobile application is not authorized to use this API key. Request received from IP address xxx.xxx.xxx.xxx, with referer: https://xxx.xxx/"
In Google Dev I have enabled Maps Embed API and also Maps Static API. I have limited the key to work with my domain only, where the above code is included, like https://[asterisk].thedomain.com/[asterisk].
The map embed works and does not throw an error, when I do NOT limit the key to this single domain.
The issue is, that the key is plain readable in the code and thus I need to limit the key to my domain.
Any ideas?
Thank you.
My site in question is delivered like https://thedomain.com/.
Google Maps Platform does make a difference between https://www.thedomain.com/ and https://thedomain.com/.
Limiting my API to https://thedomain.com/*
worked for me, while https://*.thedomain.com/*
does not imply * to be nothing.
Make sure you have "Maps Embeded API" added to the key restrictions / api restriction section of the API Key you are using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With