Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rate Limits

StyleGrab applies rate limits to ensure fair usage and service stability.

Limits by Plan

PlanRequests/minExtractions/dayExtractions/month
Free201050
Pro1001001,000
EnterpriseCustomCustomUnlimited

Rate Limit Headers

Every response includes rate limit information:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705312800
HeaderDescription
X-RateLimit-LimitMax requests allowed per window
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the window resets

When Rate Limited

When you exceed the limit, you’ll receive:

HTTP/1.1 429 Too Many Requests
Retry-After: 45
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1705312845
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests. Please retry after 45 seconds."
  }
}

Handling Rate Limits

Exponential Backoff

async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    const response = await fetch(url, options);
    
    if (response.status !== 429) {
      return response;
    }
    
    const retryAfter = response.headers.get('Retry-After') || Math.pow(2, attempt);
    console.log(`Rate limited. Retrying in ${retryAfter}s...`);
    await new Promise(r => setTimeout(r, retryAfter * 1000));
  }
  
  throw new Error('Max retries exceeded');
}

Proactive Throttling

Check remaining quota before making requests:

class RateLimiter {
  constructor() {
    this.remaining = Infinity;
    this.resetTime = 0;
  }
  
  updateFromHeaders(headers) {
    this.remaining = parseInt(headers.get('X-RateLimit-Remaining'));
    this.resetTime = parseInt(headers.get('X-RateLimit-Reset')) * 1000;
  }
  
  async waitIfNeeded() {
    if (this.remaining <= 0) {
      const waitMs = this.resetTime - Date.now();
      if (waitMs > 0) {
        console.log(`Waiting ${waitMs}ms for rate limit reset...`);
        await new Promise(r => setTimeout(r, waitMs));
      }
    }
  }
}

Endpoint-Specific Limits

Some endpoints have stricter limits:

EndpointLimit
POST /api/extractions10/min (Free), 50/min (Pro)
GET /api/extractions/:id/diff30/min
POST /api/auth/login5/min per IP

Increasing Limits

Upgrade Your Plan

The easiest way to increase limits is to upgrade to Pro or Enterprise.

Request Higher Limits

For Pro customers needing higher limits, contact support@stylegrab.dev with:

  • Your use case
  • Expected request volume
  • Peak usage patterns

Enterprise Custom Limits

Enterprise plans include custom rate limits based on your needs, plus:

  • Dedicated infrastructure
  • Priority queue for extractions
  • No monthly extraction caps

Best Practices

  1. Cache responses — Don’t re-fetch data that hasn’t changed
  2. Batch operations — Combine multiple operations when possible
  3. Use webhooks — Avoid polling by using webhook notifications
  4. Respect Retry-After — Always honor the Retry-After header
  5. Monitor usage — Track your remaining quota proactively

Usage Dashboard

View your current usage at stylegrab.dev/dashboard/usage:

  • Requests this minute
  • Extractions today
  • Extractions this month
  • Usage history charts