Home

Conversation

$$16193
https://cosocial.ca/users/evan posted on Mar 22, 2026 22:08
In reply to: https://cosocial.ca/users/evan/statuses/116275099847960670

@julian

So, if the rate limit is 300 requests every 5 minutes, and you've already used 143 requests, you might see headers like this:

X-RateLimit-Remaining: 157
X-RateLimit-Reset: 2026-03-22T22:10:00Z

https://cosocial.ca/users/evan/statuses/116275105474482421
Reply
$$16197
https://cosocial.ca/users/evan posted on Mar 22, 2026 22:13
In reply to: https://cosocial.ca/users/evan/statuses/116275105474482421

@julian Unfortunately, there are a ton of conflicting variations on this pattern. Some APIs use a Unix timestamp for the reset datetime (!), others use HTTP header values. Mastodon uses an ISO 8601 datetime.

The X-RateLimit-* headers also don't work well if there are multiple quota policies. That can happen if there are particular types of requests that are under a stricter quota than others. There are some variants that APIs use, but they're specific to the platform.

https://cosocial.ca/users/evan/statuses/116275124154956660
Reply
$$16203
https://cosocial.ca/users/evan posted on Mar 22, 2026 22:20
In reply to: https://cosocial.ca/users/evan/statuses/116275124154956660

@julian The big advance is the new rate limit headers RFC draft:

https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-ratelimit-headers

It supports having multiple policies. It's very clean and elegant. Unfortunately, it's still in draft stage. It's probably good to be ready for future changes if you're going to implement this.

https://cosocial.ca/users/evan/statuses/116275152929600900
Reply