Advanced/Rate Limits

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

Requests/min10
Requests/month100
Burst limit5

Pro

Requests/min60
Requests/month5,000
Burst limit20

Enterprise

Requests/min300
Requests/monthUnlimited
Burst limit100

* 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-Limit

Maximum requests allowed per minute

X-RateLimit-Remaining

Requests remaining in current window

X-RateLimit-Reset

Unix timestamp when the limit resets

Retry-After

Seconds to wait before retrying (only on 429)

Example Response Headers

Response Headers
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1705320060

Handling Rate Limits

When you exceed the rate limit, the API returns a 429 Too Many Requests response:

JSON
429 Too Many Requests
{
  "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:

Node.js
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.