Rate Limits
API rate limiting policies and best practices
All API endpoints are rate limited to ensure fair usage and protect the service from abuse. Understanding these limits will help you build reliable integrations.
Default Rate Limit
| Limit | Window | Scope |
|---|---|---|
| 200 requests | 1 minute | Per API key |
This default applies to all endpoints unless otherwise specified.
Rate Limit Headers
Every API response includes headers to help you track your usage:
| Header | Description | Example |
|---|---|---|
X-RateLimit-Limit | Maximum requests allowed in the time window | 200 |
X-RateLimit-Remaining | Requests remaining in the current window | 199 |
X-RateLimit-Reset | Seconds until the rate limit resets | 60 |
Example Response Headers
HTTP/1.1 200 OK
X-RateLimit-Limit: 200
X-RateLimit-Remaining: 199
X-RateLimit-Reset: 60
Content-Type: application/jsonRate Limit Exceeded
When you exceed the rate limit, the API returns HTTP 429 Too Many Requests:
{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests",
"error": "Too Many Requests"
}When you receive a 429 response, wait until the X-RateLimit-Reset time has passed before making additional requests.
Endpoints with Custom Limits
Some endpoints have stricter rate limits due to their resource-intensive nature:
| Endpoint | Limit | Window | Reason |
|---|---|---|---|
POST /feedback/send | 1 request | 1 minute | Prevent spam |
POST /domains/mini-audit/generate-report | 10 requests | 1 minute | Resource-intensive AI processing |
Custom rate limits are documented in the Swagger UI (429 response) for each endpoint.
Best Practices
1. Monitor Rate Limit Headers
Always check the X-RateLimit-Remaining header to know how many requests you have left:
async function makeRequest(url) {
const response = await fetch(url, {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
// Check rate limit headers
const remaining = response.headers.get('X-RateLimit-Remaining');
const resetIn = response.headers.get('X-RateLimit-Reset');
console.log(`Requests remaining: ${remaining}, resets in ${resetIn}s`);
if (response.status === 429) {
console.log(`Rate limited! Waiting ${resetIn} seconds...`);
await new Promise(r => setTimeout(r, resetIn * 1000));
return makeRequest(url); // Retry
}
return response.json();
}import requests
import time
def make_request(url):
response = requests.get(url, headers={'X-API-Key': 'YOUR_API_KEY'})
# Check rate limit headers
remaining = response.headers.get('X-RateLimit-Remaining')
reset_in = response.headers.get('X-RateLimit-Reset')
print(f"Requests remaining: {remaining}, resets in {reset_in}s")
if response.status_code == 429:
print(f"Rate limited! Waiting {reset_in} seconds...")
time.sleep(int(reset_in))
return make_request(url) # Retry
return response.json()2. Implement Exponential Backoff
For robust error handling, use exponential backoff when retrying:
async function requestWithBackoff(url, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
const response = await fetch(url, {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
if (response.status !== 429) {
return response.json();
}
// Exponential backoff: 1s, 2s, 4s...
const delay = Math.pow(2, attempt) * 1000;
console.log(`Rate limited. Retrying in ${delay}ms...`);
await new Promise(r => setTimeout(r, delay));
}
throw new Error('Max retries exceeded');
}3. Batch Requests When Possible
Instead of making many individual requests, use batch endpoints where available:
// Instead of this (5 requests):
for (const id of ids) {
await fetch(`/api/items/${id}`);
}
// Use batch endpoint (1 request):
await fetch('/api/items/batch', {
method: 'POST',
body: JSON.stringify({ ids })
});4. Cache Responses
Cache API responses to reduce the number of requests:
const cache = new Map();
const CACHE_TTL = 60000; // 1 minute
async function cachedRequest(url) {
const cached = cache.get(url);
if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
return cached.data;
}
const data = await fetch(url).then(r => r.json());
cache.set(url, { data, timestamp: Date.now() });
return data;
}Rate Limit by Plan
Contact support if you need higher rate limits for your use case.
| Plan | Default Limit | Can Request Higher |
|---|---|---|
| Free | 200/min | No |
| Pro | 200/min | Yes |
| Enterprise | Custom | Yes |
Troubleshooting
Next Steps
- Check out the Mini Audit API for generating brand intelligence reports
- Browse the API Reference for all available endpoints