Measure MapAPI

Rate limits

The limits that protect your account's tokens and guest projects, and how to back off when you reach one.

Most endpoints have no fixed limit. A few that can cost you money, or that sit behind public pages, are limited per account:

WhatLimitAnswer when reached
Embed and access tokens (Create an access token, Create an embed token)600 an hour, together429 too_many_requests
Guest projects started with tokens (Open Guest)300 an hour429 too_many_requests
Projects started from your no-code guest link20 a minute for the linkThe visitor is asked to try again

The hours are clock hours: the count starts again at the top of each hour.

Back off and retry#

When you get a 429, wait before trying again, and wait longer each time:

JavaScript
async function withRetry(send, attempts = 5) {
  for (let i = 0; ; i++) {
    const response = await send();
    if (response.status !== 429 || i === attempts - 1) {
      return response;
    }
    // 1 s, 2 s, 4 s, 8 s ... with a little randomness.
    const wait = 1000 * 2 ** i + Math.random() * 250;
    await new Promise(resolve => setTimeout(resolve, wait));
  }
}

Under very heavy traffic the API can also answer 429 or 503 on any endpoint, for a moment. The same backoff covers it.

Use fewer tokens#

  • An embed with your key in its address (key=) needs no token at all; use a key with Embed access only, restricted to your websites.
  • A token from Create an access token can last up to 24 hours: one token can serve many page views.