Rate Limits
StyleGrab applies rate limits to ensure fair usage and service stability.
Limits by Plan
| Plan | Requests/min | Extractions/day | Extractions/month |
|---|---|---|---|
| Free | 20 | 10 | 50 |
| Pro | 100 | 100 | 1,000 |
| Enterprise | Custom | Custom | Unlimited |
Rate Limit Headers
Every response includes rate limit information:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705312800
| Header | Description |
|---|---|
X-RateLimit-Limit | Max requests allowed per window |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix 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:
| Endpoint | Limit |
|---|---|
POST /api/extractions | 10/min (Free), 50/min (Pro) |
GET /api/extractions/:id/diff | 30/min |
POST /api/auth/login | 5/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
- Cache responses — Don’t re-fetch data that hasn’t changed
- Batch operations — Combine multiple operations when possible
- Use webhooks — Avoid polling by using webhook notifications
- Respect Retry-After — Always honor the Retry-After header
- 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