I get 429 Too Many Requests
What to do when the Opttab API answers 429 RATE_LIMITED.
Each API key can make 60 requests per 60 seconds. Request 61 gets 429 with "code": "RATE_LIMITED" and a Retry-After header.
Fix it
- Wait and retry. Read the
Retry-Afterheader and wait that many seconds before the next request. - Fetch more per request. Use
pageSize=100on list routes instead of the default 20. - Spread requests out. Space calls about one second apart, and back off longer each time you get
429again. - Check for shared keys. The limit counts per key. Several servers or scripts using one key share the same 60 requests.
Give each tool its own key. It keeps their limits apart and lets you revoke one without breaking the others.
See also: Authentication, limits and errors.
Was this page helpful?