Developers/Rate Limits

Rate Limits

The TrimLink API implements rate limiting to ensure fair usage and maintain service reliability for all users.

Limits by Plan

Rate limits vary based on your subscription plan:

PlanDaily LimitBurst Limit
Growth

For growing businesses and developers

10,000100/minute
Teams

For teams and organizations

Unlimited1,000/minute
Enterprise

Custom limits based on your needs

UnlimitedCustom

Rate Limit Headers

Every API response includes headers with your current rate limit status:

Response Headers
HTTP/1.1 200 OK
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9542
X-RateLimit-Reset: 1706745600
Content-Type: application/json
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the current period
X-RateLimit-RemainingRequests remaining in the current period
X-RateLimit-ResetUnix timestamp when the limit resets
Retry-AfterSeconds to wait before retrying (only on 429)

Rate Limit Exceeded

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

429 Response
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1706745600
Retry-After: 3600

{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Daily rate limit exceeded. Resets in 1 hour.",
    "details": {
      "limit": 10000,
      "reset": "2026-02-01T00:00:00Z",
      "retryAfter": 3600
    }
  }
}

Handling Rate Limits

Implement proper rate limit handling with exponential backoff:

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

    // Check remaining limit proactively
    const remaining = parseInt(response.headers.get('X-RateLimit-Remaining'));
    if (remaining < 10) {
      console.warn(`Low rate limit: ${remaining} requests remaining`);
    }

    if (response.status === 429) {
      const retryAfter = parseInt(response.headers.get('Retry-After') || '60');
      console.log(`Rate limited. Waiting ${retryAfter}s before retry...`);
      await new Promise(r => setTimeout(r, retryAfter * 1000));
      continue;
    }

    return response;
  }

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

Best Practices

  • Monitor rate limit headers: Check X-RateLimit-Remaining on each response to proactively avoid hitting limits.
  • Implement exponential backoff: When rate limited, wait for the Retry-After duration before retrying.
  • Batch requests when possible: Instead of making many individual requests, use bulk endpoints where available.
  • Cache responses: Store API responses locally to reduce the number of requests needed.
  • Upgrade your plan: If you consistently hit rate limits, consider upgrading to a higher tier with increased limits.