openaq / openaq-api-v2

OpenAQ API
https://api.openaq.org
39 stars 9 forks source link

add rate limiting headers to responses #313

Closed russbiggs closed 5 months ago

russbiggs commented 6 months ago

To allow users/clients to know current rate limit and expiration times we should add rate limit headers to the responses.

There is a draft spec with IEFT that we could follow: https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/

Other platforms utilize custom X- prefixed headers which could also be a possiblity e.g. Github

https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#checking-the-status-of-your-rate-limit