Rate Limiting
Fanfare implements rate limiting to ensure fair usage and maintain service stability for all customers.Rate Limit Types
Per-Organization Limits
Rate limits are applied at the organization level, shared across all API keys for that organization.Per-Endpoint Limits
Some endpoints have specific rate limits based on their resource intensity:| Endpoint Category | Limit | Window |
|---|---|---|
| Authentication (OTP request) | 10 requests | 1 minute |
| External Authorization | 100 requests | 1 minute |
| Queue Entry | 1000 requests | 1 minute |
| Auction Bids | 500 requests | 1 minute |
| Draw Entry | 1000 requests | 1 minute |
| Admin API (general) | 1000 requests | 1 minute |
| Analytics Query | 100 requests | 1 minute |
Rate Limit Headers
Every API response includes rate limit information in the headers:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the window |
X-RateLimit-Remaining | Remaining requests in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
Rate Limit Exceeded Response
When you exceed the rate limit, the API returns a429 Too Many Requests response:
Retry-After Header
TheRetry-After header indicates when you can retry:
- Numeric value: Seconds to wait before retrying
- HTTP date: Timestamp when you can retry
Handling Rate Limits
Basic Retry Logic
Proactive Rate Limit Tracking
Request Queue with Rate Limiting
Burst Limits
In addition to per-minute limits, Fanfare implements burst limits to prevent sudden spikes:| Endpoint Category | Burst Limit | Burst Window |
|---|---|---|
| Queue Entry | 100 requests | 1 second |
| Auction Bids | 50 requests | 1 second |
| Draw Entry | 100 requests | 1 second |
429 response.
Best Practices
1. Implement Exponential Backoff
2. Use Batch Endpoints
Instead of making individual requests, use batch endpoints where available:3. Cache Responses
Cache read responses to reduce API calls:4. Monitor Rate Limit Usage
Track your rate limit consumption to identify patterns:5. Distribute Load Over Time
For bulk operations, spread requests over time:Plan-Based Limits
Rate limits may vary by subscription plan:| Plan | Admin API | Consumer API | Analytics |
|---|---|---|---|
| Starter | 500/min | 2000/min | 50/min |
| Growth | 1000/min | 5000/min | 100/min |
| Enterprise | Custom | Custom | Custom |
Rate Limit Exemptions
Certain endpoints are exempt from standard rate limits:- Health check endpoints (
/health) - OpenAPI documentation endpoints (
/openapi.json) - Webhook delivery (outbound)
Monitoring and Alerts
Use the Fanfare dashboard to:- View real-time rate limit usage
- Set up alerts for approaching limits
- Analyze historical usage patterns
Need Higher Limits?
If your use case requires higher rate limits:- Review if batch endpoints can reduce request volume
- Implement caching for read operations
- Contact support for Enterprise plan options