Skip to main content

Rate Limits

To ensure fair usage and maintain API performance for all users, the Enhancv API implements rate limiting.

Current Limits

PlanRequests per MinuteRequests per HourRequests per Day
Business601,00010,000
info

These limits apply per API key. If you need higher limits, please contact our support team.

Rate Limit Headers

Every API response includes rate limit information in the headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1640000000
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the current window
X-RateLimit-RemainingNumber of requests remaining in the current window
X-RateLimit-ResetUnix timestamp when the rate limit resets

Rate Limit Exceeded

When you exceed the rate limit, you'll receive a 429 Too Many Requests response:

{
"error": "Rate limit exceeded. Please try again later.",
"status": 429,
"retryAfter": 30
}

The retryAfter field indicates how many seconds you should wait before retrying.

Best Practices

1. Monitor Rate Limit Headers

Always check the rate limit headers in your responses to avoid hitting limits:

const response = await fetch('https://api.enhancv.com/api/v1/resumes', {
headers: { 'Authorization': `Bearer ${apiKey}` }
});

const remaining = response.headers.get('X-RateLimit-Remaining');
const reset = response.headers.get('X-RateLimit-Reset');

console.log(`Remaining requests: ${remaining}`);
console.log(`Resets at: ${new Date(reset * 1000)}`);

2. Implement Exponential Backoff

When you receive a 429 error, wait before retrying:

async function fetchWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const response = await fetch(url, options);

if (response.status !== 429) {
return response;
}

const retryAfter = parseInt(response.headers.get('Retry-After') || '60');
const waitTime = Math.min(retryAfter * Math.pow(2, i), 300); // Max 5 minutes

console.log(`Rate limited. Waiting ${waitTime}s before retry...`);
await new Promise(resolve => setTimeout(resolve, waitTime * 1000));
}

throw new Error('Max retries exceeded');
}

3. Batch Operations

Instead of making individual requests, batch your operations when possible:

// ❌ Bad: Multiple sequential requests
for (const resumeId of resumeIds) {
await downloadResume(resumeId);
}

// ✅ Good: Parallel requests with rate limit awareness
const batchSize = 10;
for (let i = 0; i < resumeIds.length; i += batchSize) {
const batch = resumeIds.slice(i, i + batchSize);
await Promise.all(batch.map(id => downloadResume(id)));

// Add delay between batches
if (i + batchSize < resumeIds.length) {
await new Promise(resolve => setTimeout(resolve, 1000));
}
}

4. Cache Responses

Cache responses on your end to reduce unnecessary API calls:

const cache = new Map();
const CACHE_TTL = 5 * 60 * 1000; // 5 minutes

async function getCachedResumes() {
const cached = cache.get('resumes');

if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
return cached.data;
}

const response = await fetch('https://api.enhancv.com/api/v1/resumes', {
headers: { 'Authorization': `Bearer ${apiKey}` }
});

const data = await response.json();
cache.set('resumes', { data, timestamp: Date.now() });

return data;
}

5. Use Pagination Wisely

Don't request more data than you need:

// ❌ Bad: Requesting all resumes at once
const allResumes = await fetch('https://api.enhancv.com/api/v1/resumes?limit=100');

// ✅ Good: Request only what you need
const recentResumes = await fetch('https://api.enhancv.com/api/v1/resumes?limit=10');

Monitoring Usage

Track your API usage to avoid unexpected rate limits:

class APIClient {
constructor(apiKey) {
this.apiKey = apiKey;
this.requestCount = 0;
this.requestWindow = Date.now();
}

async request(url, options = {}) {
// Reset counter every minute
const now = Date.now();
if (now - this.requestWindow > 60000) {
this.requestCount = 0;
this.requestWindow = now;
}

this.requestCount++;

if (this.requestCount > 50) { // Buffer below limit
console.warn('Approaching rate limit');
}

return fetch(url, {
...options,
headers: {
'Authorization': `Bearer ${this.apiKey}`,
...options.headers
}
});
}
}

Need Higher Limits?

If your use case requires higher rate limits:

  1. Contact our support team at support@enhancv.com
  2. Describe your use case and expected request volume
  3. We'll work with you to find a suitable solution
Enterprise Plans

Enterprise customers can get custom rate limits tailored to their needs. Contact sales for more information.