Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include rate limit in API responses #1101

Open
njeirath opened this issue Feb 24, 2023 · 0 comments
Open

Include rate limit in API responses #1101

njeirath opened this issue Feb 24, 2023 · 0 comments
Labels
Backend Team The backend team is in charge of this issue Feature Request

Comments

@njeirath
Copy link

We'd like to use the information returned in the rate limit headers to throttle our calls but it doesn't appear that those are returned as part of the API responses.

For the time being we've setup an Axios response interceptor to add the rate limit data to the API responses with something like this:

        this.client.axiosInstance.interceptors.response.use((response) => {
            ;(response.data as any).rateLimit = {
                limit: Number.parseInt(response.headers['x-ratelimit-limit']),
                remaining: Number.parseInt(response.headers['x-ratelimit-remaining']),
                reset: Number.parseInt(response.headers['x-ratelimit-reset']),
            }
            return response
        })

however it would be great if this functionality was included in the library itself.

@vanGalilea vanGalilea added Backend Team The backend team is in charge of this issue and removed Backend Team The backend team is in charge of this issue labels Mar 8, 2023
@vanGalilea vanGalilea added Feature Request Backend Team The backend team is in charge of this issue labels Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Team The backend team is in charge of this issue Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants