Skip to content
Open Onsite

Get started

Stay within rate limits

How many requests an API key can make, the headers that show what's left, and what to do when you hit the limit.

Each API key has its own limits, so one busy script doesn’t slow down another. Every response tells you how much room is left.

What Limit per key
All requests 600 a minute
Requests that make changes (POST, PATCH, DELETE) 60 a minute, counted inside the 600

All of your team’s keys together also share a larger limit. You’ll only reach it with many busy keys at once.

Exports also use your team’s monthly credits, the same as exporting in Onsite.

Every successful response includes these headers, so your code can slow down before it reaches the limit:

RateLimit-Limitinteger

Requests the key can make in one window. 600.

RateLimit-Remaininginteger

Requests left in the current window.

RateLimit-Policystring

The limit and the window in seconds, such as 600;w=60.

Retry-Afterinteger

Only on a 429: seconds to wait before the next request.

The API answers 429 with the code rate_limited:

{
"error": {
"code": "rate_limited",
"message": "Too many requests for this key. Wait for the time in the Retry-After header, then try again.",
"requestId": "E-3PQ8-W2LC"
}
}

Wait for the Retry-After seconds, then send the request again. Errors has a retry example.

  • Ask for more rows at once. Lists take limit up to their maximum, so one request can replace several. See Pagination.
  • Filter on the server. Use parameters like query, page, country or device instead of fetching everything and filtering in your code.
  • Cache what doesn’t change often. A report for a period that has ended rarely changes, so keep its answer for a few hours.
  • Spread out scheduled jobs. If a script reads many sites, read them one after another instead of all at once.