Rate Limiting
The JJHub API enforces per-user rate limits to ensure fair usage and platform stability. Every API response includes rate limit headers so you can monitor your consumption in real time.Rate Limit Tiers
Rate limiting is enforced at the API server using a per-user token-bucket algorithm. Authenticated requests are tracked by user identity. Unauthenticated requests are tracked by client IP address.
Search endpoints have their own separate, stricter limit that applies in addition to the general authenticated or unauthenticated limit.
Response Headers
Every API response includes three rate limit headers:
These headers follow the same format used by Gitea and GitHub, so existing tooling that reads rate limit headers will work with JJHub.
Example: Normal Response Headers
Exceeding the Rate Limit
When you exceed the rate limit, the API returns a429 Too Many Requests response with a Retry-After header indicating how many seconds to wait before making another request.
Retry-After header or X-RateLimit-Reset timestamp to determine when to resume requests.
Checking Your Rate Limit Status
You can check your current rate limit status without consuming a rate limit slot by inspecting the headers on any successful API response:X-RateLimit-Reset epoch timestamp to a human-readable time:
Best Practices
Use Conditional Requests
UseIf-None-Match and If-Modified-Since headers for resources you have already fetched. A 304 Not Modified response does not count against your rate limit.
Cache Responses Locally
Cache API responses on the client side using theETag and Last-Modified response headers. This reduces unnecessary requests and keeps you well within your rate limit.
Implement Exponential Backoff
If you receive a429 response, wait for the duration specified by the Retry-After header. For general error retries, use exponential backoff with jitter:
- Wait 1 second, then retry
- Wait 2 seconds, then retry
- Wait 4 seconds, then retry
- Continue doubling the wait time up to a maximum of 60 seconds