Rate Limits
Understand API rate limits and best practices for handling them.
Overview
Rate limits protect the API from abuse and ensure fair usage for all customers. Limits are applied per API key and vary by plan.
Limits by Plan
Free
Pro
Enterprise
* Burst limit is the maximum number of concurrent requests allowed.
Rate Limit Headers
Every API response includes headers to help you track your rate limit status:
X-RateLimit-LimitMaximum requests allowed per minute
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the limit resets
Retry-AfterSeconds to wait before retrying (only on 429)
Example Response Headers
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1705320060Handling Rate Limits
When you exceed the rate limit, the API returns a 429 Too Many Requests response:
{
"status": "error",
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please wait before retrying.",
"retryAfter": 30
}
}Implementing Retry Logic
Here's how to implement exponential backoff with retry logic:
async function enrichWithRetry(url, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
const response = await fetch('https://api.vera.com/enrich', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ url }),
});
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || 30;
console.log(`Rate limited. Retrying in ${retryAfter}s...`);
await sleep(retryAfter * 1000);
continue;
}
return response.json();
}
throw new Error('Max retries exceeded');
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}Best Practices
Use caching
Cache enrichment results locally. Company data doesn't change frequently, so caching for 24-48 hours is usually safe.
Batch requests
If you need to enrich many companies, use the Batch API (coming soon) instead of making individual requests.
Monitor usage
Track your API usage in the dashboard. Set up alerts to notify you when approaching limits.
Use webhooks
For async operations, use webhooks instead of polling. This reduces unnecessary API calls.