Rate limits

The LinkinLegal API allows 120 requests per minute per account. Read the rate limit headers, handle a 429 with backoff, and ask for a higher limit.

Your account can send 120 requests per minute by default. The window is 60 seconds. The count is per account, not per key: ten keys share one budget.

A plan does not cap the number of calls. This limit does.

Read the headers

Every response carries the current state of your budget.

RateLimit-Policy: 120;w=60
RateLimit-Limit: 120
RateLimit-Remaining: 119
RateLimit-Reset: 60
HeaderMeaning
RateLimit-PolicyThe limit and the window in seconds. 120;w=60 is 120 requests per 60 seconds.
RateLimit-LimitYour limit for this window.
RateLimit-RemainingRequests left in this window.
RateLimit-ResetSeconds until the window resets.

Watch RateLimit-Remaining in your client. When it falls low, slow down before you get a 429.

Handle a 429

Over the limit, the API returns 429 with the code rate_limit_exceeded:

{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded.",
    "request_id": "48004b7c-e8ec-4346-be2c-0fe35eab9999"
  }
}

The response also carries Retry-After with the number of seconds to wait:

Retry-After: 6
RateLimit-Remaining: 0
RateLimit-Reset: 6

Wait that long, then retry. Add a small random delay on top, so your workers do not all come back in the same second.

async function callWithRetry(url, options, attempts = 3) {
  for (let attempt = 1; ; attempt += 1) {
    const response = await fetch(url, options);
    if (response.status !== 429 || attempt === attempts) return response;

    const retryAfter = Number(response.headers.get("Retry-After")) || 1;
    const jitter = Math.random();
    await new Promise((resolve) => setTimeout(resolve, (retryAfter + jitter) * 1000));
  }
}

Retry 429 and 503 only

A 429 and a 503 index_unavailable are worth a retry. A 400, a 401, a 402 and a 403 are not: the same request fails again. Fix the request or the plan instead.

A batch counts as one request

POST /sanctions/match/batch with 100 subjects costs one request, not 100. For bulk screening this is the cheap path: 120 batch calls per minute screen up to 12,000 subjects.

Keep your batches near the maximum of 100 items and run them one after the other.

Rate-limited requests are rejected before the work starts, so a 429 never screens a part of your batch.

The per-IP ceiling

One IP address can send up to 1,200 requests per minute, over all accounts and before the key is read. It protects the service; it is not your budget. If you run many servers behind one NAT address, keep this number in mind.

Ask for a higher limit

We can raise the limit on your account. Write to support@linkinlegal.com with:

  • The rate you need, in requests per minute.
  • What drives it (for example: a nightly rescreening of 400,000 customers).
  • The hours when your traffic peaks.

Before you ask, check that you use match/batch for bulk work. It often removes the need for a higher limit.

Last updated on

On this page