Skip to main content
View as Markdown

Rate limits

The Content API limits how much work your requests can do, to protect Swapcard servers from excessive or abusive calls. Check these limits before you run bulk imports or exports.

With GraphQL, one call can replace many REST calls: a single complex query can do the work of thousands of REST requests. The Content API therefore applies two kinds of limits:

Cost-based limit​

The Content API gives each query a cost in points, based on its complexity (see how cost is calculated). By default, you can spend 60,000 points per minute.

Every API response includes headers that show your current usage:

HeaderDescription
X-RateLimit-CostThe number of points the query cost.
X-RateLimit-UsedThe number of points you have used in the current rate limit window.
X-RateLimit-RemainingThe number of points remaining in the current rate limit window.
X-RateLimit-LimitThe maximum number of points you can use per window.
X-RateLimit-ResetThe time at which the current window resets, in UTC epoch seconds.
tip

During bulk jobs, read X-RateLimit-Remaining on each response and pause until X-RateLimit-Reset when it runs low.

Query limits​

Each query must stay within the following limits:

LimitMaximumNotes
Cost10,000 pointsA mutation costs 1,000 points, an object 2 points and a scalar 1 point. A depth factor of 1.5x is applied.
Depth20 levelsLevels of nested objects.
Aliases50 aliases
Tokens2,000 tokensA token is a field, an argument or an alias.
Directives20 directives

Additional limits​

  • The request body must not exceed 1 megabyte.

Request higher limits​

If your integration needs different limits, submit a request with details about your queries and use case.

warning

To guarantee service and prevent abuse, Swapcard may temporarily change the rate limit for some users without notice.