twitter-api-typescript-sdk icon indicating copy to clipboard operation
twitter-api-typescript-sdk copied to clipboard

Expose HTTP rate-limit headers from upstream Twitter API calls

Open jacobdr opened this issue 2 years ago • 1 comments

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 avatar Mar 10 '23 08:03 jacobdr

+1

gabibianconi avatar Sep 01 '23 14:09 gabibianconi