jolt jolt - 9 months ago 37
Javascript Question

How the quota and it's consumption works?

I am a little lost in the quota allocation and quota consumption of the Google Maps JS API.

  1. Places WebService API, per user quota hint @ JS API:

    If you are developing a web based application that only needs to search for places, and does not submit new places, you should use the Places Library of the Google Maps Javascript API rather than the Google Places API Web Service. The Places library assigns a quota to each end user rather than to each key. This means that your available quota increases with your user base rather than being capped at a fixed amount.

    Nice! But how exactly does it work? What is considered an end user, and how much quota does he get?

  2. JavaScript API, maploads:

    Does it consume the quota per key, per user?

  3. JavaScript API, Places Library, Searching:

    Note that each search counts as a single request against your usage limits.

    Okay, but that is mentioned in the part about search responses (to Nearby Search, Text Search, Radar Search) - is it the same for Place Details requests?

  4. Other libraries/features:

    JS API provides a lot of sub-libraries, so does the Places Library - those are also undocumented, do they consume per-user basis or per-key basis?

Have I missed a detailed table of usage consumption rules?

Of course, I assume, that every single request eats one request from the quota, which sounds about right, but when and how does the per-user quota kick in?

Answer Source

An end user is the user which visits your webpage.

When you use the maps-javascript-API(including any service/library) there is only 1 quota relevant for you, the mapLoads-quota (25k per day ).

What constitutes a 'map load' in the context of the usage limits that apply to the Google Maps Web APIs?

A single map load occurs when:

  • a map is displayed using the Google Maps JavaScript API when loaded by a web page or application;
  • a Street View panorama is displayed using the Google Maps JavaScript API by a web page or application that has not also displayed a map;
  • a single request is made for a map image from the Google Static Maps API; or

  • a single request is made for a panorama image from the Google Street View Image API.

This quota is related to the domain of the webpage(or to the project when you use a key)

Any subsequent request to a service/library(e.g. places, geocoding, directions etc.) via the Javascript-API will affect the quota of the end-user(visitor). Usually the only relevant end-user-quota is requests per second (about 10 requests per seconds), so you must take care that your webpage will not send too much requests too fast.