Rate limits
InsurGrid limits how many API calls your account can make in a given window, to keep the API fast and fair for everyone. This guide covers how limits are communicated and how to back off cleanly when you hit one.
Limits are applied per account, across all your API tokens combined.
Exact limits (requests per window) aren't printed here — they're shared with you during onboarding and can vary by account. Design your integration to handle
429gracefully rather than hard-coding a number.
When you're over the limit
A request over your limit returns 429 Too Many Requests with the standard error envelope, plus these headers:
Retry-After
Seconds to wait before your next request.
X-RateLimit-Limit
The ceiling for the current window.
X-RateLimit-Remaining
Calls left in the current window.
X-RateLimit-Reset
When the window resets, as epoch seconds.
New term — epoch seconds: the number of seconds since January 1, 1970 UTC — a common way to represent a timestamp as a plain number.
new Date(epoch * 1000)(Node) ordatetime.fromtimestamp(epoch)(Python) converts it to a normal date.
Back off using Retry-After
Don't retry immediately. Wait at least Retry-After seconds, then try again. A minimal retry wrapper:
Node:
// client.js
async function callWithBackoff(url, options, maxAttempts = 5) {
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
const res = await fetch(url, options);
if (res.status !== 429) return res;
const retryAfter = Number(res.headers.get("Retry-After") ?? "1");
console.warn(`Rate limited. Waiting ${retryAfter}s (attempt ${attempt}/${maxAttempts})`);
await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
}
throw new Error("Exceeded max retry attempts after repeated 429s");
}Python:
Tips
Check
X-RateLimit-Remainingproactively on high-volume jobs — like a full pagination sweep — and slow down before you hit0, rather than waiting for a429.If you're consistently hitting your limit, contact InsurGrid — limits can be raised for legitimate high-volume use.
Related
Support
