Guides
Rate Limits
Understand quota and concurrency limits for your plan
Rate Limits
LinkSnap uses rate limits to ensure fair usage and service reliability. Understanding these limits helps you build robust integrations.
Types of Limits
Request Rate Limit
Maximum requests per minute per API key:
| Plan | Requests/minute |
|---|---|
| Free | 10 |
| Basic | 30 |
| Pro | 60 |
| Team | 120 |
Concurrency Limit
Maximum simultaneous screenshots being processed:
| Plan | Concurrent |
|---|---|
| Free | 2 |
| Basic | 5 |
| Pro | 10 |
| Team | 20 |
Monthly Quota
Total screenshots per billing cycle:
| Plan | Monthly Quota |
|---|---|
| Free | 100 |
| Basic | 5,000 |
| Pro | 20,000 |
| Team | 60,000 |
Rate Limit Headers
Every response includes rate limit information:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1704067200| Header | Description |
|---|---|
X-RateLimit-Limit | Max requests per window |
X-RateLimit-Remaining | Remaining requests |
X-RateLimit-Reset | Unix timestamp when limit resets |
Handling Rate Limits
When rate limited, you'll receive:
{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests. Please try again later.",
"retryAfter": 15
}
}Best Practices
- Check headers - Monitor remaining quota proactively
- Implement backoff - Use exponential backoff on 429 errors
- Queue requests - Buffer requests during high load
- Use webhooks - Avoid polling by using webhook callbacks
Example: Exponential Backoff
async function captureWithRetry(url, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const response = await fetch('https://api.linksnap.dev/v1/screenshots', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ url }),
});
if (response.status !== 429) {
return response.json();
}
const retryAfter = response.headers.get('Retry-After') || Math.pow(2, i);
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
}
throw new Error('Max retries exceeded');
}Quota Management
Check Remaining Quota
GET /v1/account/quota{
"plan": "pro",
"monthlyQuota": 20000,
"used": 5432,
"remaining": 14568,
"resetsAt": "2024-02-01T00:00:00Z"
}Cache Hits Don't Count
When a screenshot is served from cache, it doesn't count against your quota. Check the cached field in responses:
{
"data": {
"id": "ss_abc123",
"cached": true // No quota deducted
}
}Failed Requests Refunded
If a screenshot fails (timeout, blocked URL, etc.), the quota is automatically refunded.
Need Higher Limits?
- Upgrade your plan - Higher plans have higher limits
- Contact sales - For custom enterprise limits
- Optimize usage - Batch similar URLs, leverage caching