Developers

Search the docs

Search guides and headings.

Rate limits

How many calls a key may make per minute, the headers that tell you where you stand, and how to handle a 429.

View as Markdown

You will know your limit, read it from response headers, and back off correctly when you hit it.

The limits#

Every limit is counted for each API key. There are four.

LimitSandboxProduction
Calls per minute25 by default100 by default
Burst120 in any 10 seconds600 in any 10 seconds
Report routes and the event list10 per minute30 per minute
Calls in progress at once1050

Calls per minute. Nurish'd sets this number per company, so yours may differ. GET /developer/v1/key/get/document returns it in rate_limit_per_minute. The console shows it too. To ask for more, email hello@nurishd.io.

Burst. Calls you do not use add up. A key that was quiet can go above its calls per minute for a moment, up to the burst line.

Report routes and the event list. These four routes have their own, lower line:

  • GET /care/v1/report/query/documents
  • GET /care/v1/report/{report_id}/get/document
  • GET /care/v1/report/{report_id}/section/{section_id}/file/get/document
  • GET /developer/v1/event/query/documents

A call to one of them counts against this line and against your calls per minute.

Calls in progress at once. This counts the calls Nurish'd is still answering for your key. Wait for answers before you send more, or cap your workers below the number.

Passing any of the four answers 429 rate_limited with a Retry-After header.

Headers#

Every authenticated answer, errors included, carries:

HeaderMeaning
RateLimit-LimitCalls per minute for this key.
RateLimit-RemainingCalls you can make right now. After a quiet moment it can be above the limit.
Retry-AfterSeconds to wait. Only on a 429.

On a report route and on the event list, both RateLimit headers describe that route's own line.

A 401 carries none of these, because the key could not be identified.

http
HTTP/1.1 429 Too Many Requests
RateLimit-Limit: 25
RateLimit-Remaining: 0
Retry-After: 12
X-Request-Id: req-0001
Content-Type: application/json

{"error": {"code": "rate_limited", "message": "Too many requests.", "request_id": "req-0001"}}

Handle a 429#

  1. Stop sending calls with that key.
  2. Wait Retry-After seconds.
  3. Retry the call.
python
import os
import time
import requests

def get(url, **kwargs):
    for _ in range(4):
        res = requests.get(url, headers={"X-Partner-API-Key": os.environ["NURISHD_API_KEY"]}, **kwargs)
        if res.status_code != 429:
            return res
        time.sleep(int(res.headers.get("Retry-After", "5")))
    return res

Stay under the limit#

  • Read RateLimit-Remaining and slow down before it reaches zero.
  • Do not send many calls at the same moment. Keep the calls in progress under the limit.
  • Fetch a report once and keep it. Report routes have the lowest limit.
  • Use size up to 50 to fetch fewer pages. See Pagination.
  • Poll events no more often than you need. Use a cursor on created. See Events.
  • Cache catalog data that rarely changes, such as vendors and products.
  • Spread work from several services over several keys only if each has its own job. Limits are per key.

Next#