Rate Limits
Understand the API rate limits and how to handle them.
The linked.is API implements rate limiting to ensure fair usage and maintain service stability for all users.
Default Limits
| Plan | Requests per Minute | Requests per Day |
|---|---|---|
| Free | 60 | 1,000 |
| Pro | 300 | 10,000 |
| Business | 1,000 | 100,000 |
Rate Limit Headers
Every API response includes headers that provide information about your current rate limit status:
<script setup lang="ts">
const rateLimitHeaders = {
"X-RateLimit-Limit": 60,
"X-RateLimit-Remaining": 55,
"X-RateLimit-Reset": 1640995200
};
</script>
<template>
<div>
<h3>Rate Limit Headers:</h3>
<pre>{{ JSON.stringify(rateLimitHeaders, null, 2) }}</pre>
</div>
</template>
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum number of requests allowed per minute |
X-RateLimit-Remaining | Number of requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the rate limit resets |
Handling Rate Limits
When you exceed the rate limit, the API will return a 429 Too Many Requests response:
<script setup lang="ts">
const rateLimitErrorResponse = {
success: false,
error: {
code: "RATE_LIMIT_EXCEEDED",
message: "Too many requests. Please try again later.",
retryAfter: 60
}
};
</script>
<template>
<pre>{{ JSON.stringify(rateLimitErrorResponse, null, 2) }}</pre>
</template>
Best Practices
- Cache responses - Store API responses locally to reduce the number of requests
- Implement exponential backoff - When rate limited, wait progressively longer between retries
- Use webhooks - For real-time updates, consider using webhooks instead of polling
- Batch requests - Combine multiple operations into fewer API calls when possible
Exponential Backoff Example
<script setup lang="ts">
const fetchWithRetry = async (url: string, options: RequestInit, maxRetries = 3) => {
for (let i = 0; i < maxRetries; i++) {
const response = await fetch(url, options)
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || Math.pow(2, i)
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000))
continue
}
return response
}
throw new Error('Max retries exceeded')
};
const handleRetryRequest = async () => {
try {
const response = await fetchWithRetry(
"https://api.linked.is/v1/links",
{
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
},
}
);
const data = await response.json();
console.log(data);
} catch (error) {
console.error("Max retries exceeded:", error);
}
};
</script>
<template>
<div>
<button @click="handleRetryRequest">Make Retry Request</button>
</div>
</template>
Increasing Your Limits
If you need higher rate limits, consider upgrading your plan or contact us for custom enterprise limits.