Rate Limits

Understand how rate limiting works and best practices for handling limits.

Overview

The DorkList API enforces rate limits to ensure fair usage and maintain service reliability. Rate limits are applied per API key on a daily basis.

1,000

requests per day per API key

How It Works

  • Each API key has a daily quota of 1,000 requests
  • The counter resets at midnight UTC each day
  • Each successful or failed request counts towards your limit
  • Creating multiple API keys does not increase your total quota

Rate Limit Headers

Every API response includes headers to help you track your usage:

HeaderDescription
X-RateLimit-LimitYour daily request limit (1000)
X-RateLimit-RemainingNumber of requests remaining today
X-RateLimit-ResetUnix timestamp when the limit resets

Rate Limit Exceeded

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

json
{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Please try again later."
}
}

Best Practices

1. Cache Responses

Dork data doesn't change frequently. Cache responses to reduce unnecessary API calls:

javascript
// Simple in-memory cache example
const cache = new Map();
const CACHE_TTL = 1000 * 60 * 60; // 1 hour
async function getDorks(options) {
const cacheKey = JSON.stringify(options);
const cached = cache.get(cacheKey);
if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
return cached.data;
}
const response = await fetch(`https://dorklist.com/api/v1/dorks?${new URLSearchParams(options)}`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
const data = await response.json();
cache.set(cacheKey, { data, timestamp: Date.now() });
return data;
}

2. Handle Rate Limits Gracefully

Implement exponential backoff when you hit rate limits:

javascript
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const response = await fetch(url, options);
if (response.status === 429) {
const resetTime = response.headers.get('X-RateLimit-Reset');
const waitTime = resetTime
? (parseInt(resetTime) * 1000) - Date.now()
: Math.pow(2, i) * 1000;
console.log(`Rate limited. Waiting ${waitTime}ms...`);
await new Promise(resolve => setTimeout(resolve, waitTime));
continue;
}
return response;
}
throw new Error('Max retries exceeded');
}

3. Use Pagination Efficiently

When fetching dorks, use pagination parameters to get only what you need. Requesting 100 items at once is more efficient than making 5 requests for 20 items each.

4. Monitor Your Usage

Keep track of the rate limit headers in your responses to avoid hitting limits. You can view your current usage in your account settings.

Need Higher Limits?

If you need higher rate limits for your use case, please contact us to discuss enterprise options.