Rate Limiting
Saturday uses token bucket rate limiting to ensure fair access and API stability. Rate limits are applied per API key.Rate limit headers
Every API response includes headers showing your current rate limit status:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed per minute |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
When you’re rate limited
When you exceed the limit, Saturday returns a429 Too Many Requests response:
Retry-After header:
Best practices
Spread requests evenly
Instead of bursting 60 requests in 5 seconds then waiting 55 seconds, spread them across the full minute. Token bucket rate limiting allows short bursts but sustained bursting will hit the limit.Cache when possible
Nutrition prescriptions for the same inputs don’t change unless the athlete’s profile is updated. Cache prescription results and only recalculate when:- The athlete’s profile settings change
- Activity parameters change (new weather forecast, updated duration)
- You need a fresh calculation for race day