简体   繁体   中英

Google Maps API Key - Get one for everyone of my users programmatically?

I saw that one has not to obtain a Google Maps API key if you want to use their maps api in general, only if you want to use their web services and statistics etc.

Now I have two questions regarding this:

  1. If I have a public website which uses the Google Maps API to display a map with default options. How does Google count the API calls if I don't use an API key? (Maybe with the help of the domain which requests the map?)

  2. If they do so and my site exceeds the 25k calls/day, is there a possiblity that my users can login with their Google account on my site and some backend logic will get them an API key from Google that I store eg in a database. So I could use the API keys of my users to bypass the API usage limits only for my site.

Assuming you are using the Javascript API v3:

This SO question partially answers your queries.

Have a look at the usage limits , it looks like that you cannot use more than one API key:

Can I use more than one API key to increase my available usage over the documented limits? Google reserves the right to withhold access to the Maps API from any site that attempts to use more than the permitted number of map loads of the Maps API without permission, and fails to respond when contacted by Google.

Though this may be debatable, to me it seems a bad idea using your user's API key. For sure you need to ask the permission, then you have to monitor their quotas and so on, a minefield...

TL;DR if you exceed constantly the daily quota you should purchase a larger quota.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM