Map usage: Sessions vs requests

MapTiler offers two models of measuring map traffic and other service usage: sessions and requests. Each pricing plan, including the free one, defines a monthly limit on sessions and requests. When you hit either of these two limits, you get charged extra (on a paid plan) or your maps get suspended for the rest of the month (on a free plan).

Idea

To see which plan you’re on and how many sessions and requests you get, go to your Account settings. To check your current usage stats, see the Analytics page.

Requests

A request (or API request, more specifically) is a single call to our API services. These APIs are the mechanism that makes all our online services work: they display your maps, make it possible to search places, send coordinates, calculate elevation, or show weather animations.

In case of map usage, requests counts each individual API request for map tiles (pieces of the map). When the user is moving around the map and zooming in and out, the map application needs to load more tiles to show the required areas or details. This happens by requesting new tiles via an API call, and each of these API calls counts as a tile request. To see how exactly it works, check out our interactive tile request counter.

Some of our services, like geocoding, don’t necessarily involve a map. Geocoding makes it possible to search a place by its name or coordinates in any app, be it a map or a delivery form. The number of requests to the respective API depends on configuration; for example, in case of predictive search where each key stroke gives the user new place suggestions, each key stroke also means a new API request to our API to get those suggestions.

Sessions

A session, sometimes also called map load, starts when a user opens a webpage with the map. Then they can freely interact with the map, zoom, pan, change map theme, and it all counts as a single map session. Similarly, in case of geocoding, a session includes all interactions with a search field in one sitting.

For billing purposes, a new session starts when:

  • User reloads the browser tab (with F5, Ctrl+R, Reload button),
  • A single continuous session duration exceeds 6 hours,
  • The session reaches a total of 10,000 requests.

Sessions are generally much easier to estimate. One session equals one page view, so it’s easy to check your web analytics and estimate traffic or usage costs. Sessions also tend to be more cost-effective than requests, because a single session typically includes many API requests: a few tile requests to load the initial map view, then requesting additional tiles as the user interacts with the map, or requesting place search results as the user types in the search field.

Map sessions and geocoding sessions are tracked and billed as separate products. Interaction with a map and a search box on the same page will count as one map session and one geocoding session respectively.

Comparison

  Sessions Requests
What’s measured (Re)load of a web page with map or place search Each individual API call for a map tile or place search
Duration Until page refresh (F5, Ctrl+R) or up to 6 hours/10k requests N/A (usage is per request)
Availability Only with MapTiler SDK JS or MapTiler plugin for Leaflet General availability with MapTiler API
Benefits Much easier to predict (1 session = 1 user visit), reduced costs for heavy user interaction, protection from usage spikes More granular, works with all tools and libraries
Best use case Applications with heavy user interaction per map view Many map page views with little user interaction

Are you using sessions or requests?

Each of your map apps can be measured differently, per session or per request; there’s no global setting for the model used. So which one applies? That depends on implementation:

  • If your map app is implemented with MapTiler SDK JS (or the MapTiler plugin for the Leaflet library which also uses the MapTiler SDK), then the usage is by default tracked by session. For special use cases where it makes sense, you can optionally switch to requests.

  • If you built your map app using MapTiler API combined with 3rd party clients and libraries, then the traffic is tracked by request. Switching to sessions is not technically possible in this case.

Switching to requests in MapTiler SDK

If you’re using MapTiler SDK JS, you’re by default using sessions but can optionally switch to requests. This might be the preferred way to track your map usage in special cases where you expect many map views with little interaction. For example, you’re building a holiday booking app in which users browse many pages to see available options, but they don’t interact with the maps on those pages.

Switching from sessions to requests is done per map. Use the map config option session and add this line to the code of each map which you want tracked per request: maptilersdk.config.session = false