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

Expose HTTP rate-limit headers from upstream Twitter API calls #68

Open
jacobdr opened this issue Mar 10, 2023 · 1 comment
Open

Expose HTTP rate-limit headers from upstream Twitter API calls #68

jacobdr opened this issue Mar 10, 2023 · 1 comment

Comments

@jacobdr
Copy link

jacobdr commented Mar 10, 2023

The Twitter v2 API exposes the headers

x-rate-limit-limit: the rate limit ceiling for that given endpoint
x-rate-limit-remaining: the number of requests left for the 15-minute window
x-rate-limit-reset: the remaining window before the rate limit resets, in UTC [epoch seconds](http://en.wikipedia.org/wiki/Unix_time)

which are valuable to clients who want to ensure they are not going over the limits. Currently, there is no way of accessing this data from any of the public methods.

Expected behavior

Expose the headers properties on method return types from the various namespaces.

Actual behavior

No HTTP response headers available. I think these need to be added to the OpenAPI schema that in turn powers twitter-api-sdk/dist/gen/openapi-types.d.ts

Steps to reproduce the behavior

N/A

@jacobdr jacobdr changed the title Expose HTTP headers from upstream Twitter API calls Expose HTTP rate-limit headers from upstream Twitter API calls Mar 10, 2023
@gabibianconi
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants