Skip to content
GROWTH DEPT.MTA
DocsRate limits

Concepts

Rate limits

Limits are counted per API key. Two of them apply to the export endpoints; the endpoints that take data in limit the size of each request instead.

Limits by endpoint#

EndpointLimit per keyCounted
POST /exports/data-export60 exports a minuteAcross all of MTA's servers, from the exports the key created in the last 60 seconds.
GET /exports/account, attribution-models, metrics, breakdowns, and data-export/result/{id}100 requests a secondOn each server instance separately.
GET /exports/data-export/download/…NoneSigned links take no key.
POST /orders, POST /spend, POST /viewsNoneSee the size limits below.

Creating an export does not count toward the 100 a second, and the other export endpoints do not count toward the 60 a minute.

When you hit a limit#

The request is refused with 429 and nothing happens. Retry-After says how many seconds to wait; X-Nb-Limit-Retry-After carries the same number for clients that read it. The body says which limit you hit.

Response 429
HTTP/2 429
content-type: application/json
retry-after: 12
x-nb-limit-retry-after: 12

{ "detail": "Rate limit exceeded: 60 data-export requests per minute per API key. Retry after 12 seconds." }

Wait the given seconds, then send the same request again.

Request size limits#

EndpointPer requestOver the limit
POST /orders1 to 1,000 orders; at most 20 MB400 for too many orders, 413 for a body over 20 MB
POST /spend1 to 10,000 rows400
POST /viewsUp to 10,000 views and 50 coverage ranges; at most 20 MB400 for too many items, 413 for a body over 20 MB
POST /exports/data-exportA period of at most 731 days422

A download has up to 300 seconds on the server. Export files are sized so that each finishes well inside that; see Files and pagination.

Staying under the limits#

  • Ask for one export that covers the whole period rather than one per day. An export of up to two years is a single request.
  • Poll an export's result every few seconds. Exports of up to 31 days have usually finished by the time the create request returns.
  • Read GET /exports/metrics once per job. The list is the same for every brand and changes only when the API does.
  • Batch orders, spend and views up to the size limits.

Questions about the API: support@growthdept.ai.