Rate limits
No rate limit is currently applied to the review and review request endpoints. That may change, so build a client that degrades gracefully rather than one that depends on unlimited throughput.
Recommended client behaviour
- Back off on
5xx. Retry with exponential backoff and jitter rather than immediately. - Honour
Retry-After. If a response ever carries that header, wait as long as it says. - Do not poll for new reviews. Subscribe to webhooks instead of
calling
GET /api/v2/reviewson a timer. - Page in sequence. When walking pages, request them one after another rather than firing every page in parallel.
- Cache what does not change. A review fetched by
idrarely changes, so store it rather than re-fetching.
Backoff example
retry.js
async function withRetry(request, { attempts = 5 } = {}) {
for (let attempt = 0; attempt < attempts; attempt++) {
const response = await request()
if (response.status !== 429 && response.status < 500) {
return response
}
const retryAfter = Number(response.headers.get('retry-after'))
const backoff = Number.isFinite(retryAfter) && retryAfter > 0
? retryAfter * 1000
: 2 ** attempt * 500 + Math.random() * 250
await new Promise(resolve => setTimeout(resolve, backoff))
}
throw new Error('Giving up after repeated failures.')
}Last updated on