Skip to content

Return Rate Limits #684

Open
Open
@justinormont

Description

@justinormont

Would it be possible to return the rate limit headers for every API call? X-RateLimit-Limit, X-RateLimit-Remaining, & X-RateLimit-Reset.

Currently, there's no method of checking the current rate limit values until the limit is hit.

Once the limit is reached the values are returned in the error:

throw createError({
statusCode: error.status,
message: data?.error,
details: data?.errorDescription,
description: data?.details,
limit: error.headers.get('X-RateLimit-Limit'),
remaining: error.headers.get('X-RateLimit-Remaining'),
reset: error.headers.get('X-RateLimit-Reset'),
} as CreateErrorParams);

Alternatively, is there a way to get access to the HTTP response object, and get the headers directly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions