i have a google maps api key set to "HTTP Referrer restriction" with also enabled geocode api and which is used in three plugins. But another plugin (booking) requires also geocode api but with "IP restriction" and that's why i get an error: " API keys with referer restrictions cannot be used with this API." So i deactivated geocode from the first api and made an new api key for geocode with IP restriction. So now in my site i have 2 api keys.One with HTTP referrer restriction and one with IP restriction. Is that correct?..because nothing has changed. Is there something else i have to do from scratch maybe? Thank you!
Asked
Active
Viewed 2,563 times
3
-
2Different APIs require different restrictions. If you use Maps JavaScript API you will need HTTP referrer restrictions. If you use Geocoding API web service, you will need IP address restrictions. Have a look at documentation to figure out which type of restriction is allowed for each API: https://developers.google.com/maps/faq#keysystem – xomena Jan 28 '18 at 16:56
-
hello and thank you for the answer.So in my case where the same plugin uses both Maps JavaScript API and Geocoding API but only one input table for google api key,what should i do?Obviously i have to create two different api keys but which will use? and can a site have multiple api keys?thank you – nick papas Jan 28 '18 at 23:38
-
The simplest way use unrestricted API key which will work with JS API and Geocoding API. However, if you need secure solution, you should modify the plugin to allow two different keys with corresponding restrictions. – xomena Jan 29 '18 at 09:46
-
thank you for the answer.if i leave it with no restrictions, what are the issues please? you mean that maybe another user, might use the same key on his/her own site?and he does so, is that so bad? – nick papas Jan 31 '18 at 00:39
-
yep, if somebody uses your unprotected API key they will consume your quota. – xomena Jan 31 '18 at 08:52
-
and is this uprotected api easily taken easily?what is ""will consume your quota?thank you – nick papas Feb 05 '18 at 19:53
-
It means someone can inspect your index.html page, look at the key you are using and then use it for their own project by using the same key in their index.html page. So you may be charged for their usage if it is unrestricted. – Dhruv Prakash Nov 08 '18 at 15:59