Skip to content

Add logging of request statistics via response headers for debugging #12

@MacOS

Description

@MacOS

Hi all,

thank you for your work on this software!

May I request a new feature. In particular, I would like to propose to log the statistics of request via the reponse headers. With that I mean to log

  • The number of requests done within a rate limit window via X-RateLimit-Used,
  • The number of requests left via X-RateLimit-Remaining,
  • The total limit via X-RateLimit-Limit, and finally
  • The reset time in UTC epoch seconds via X-RateLimit-Reset

This information can be used to enhance the following error

Error: API rate limit exceeded for user ID 3662183. If you reach out to GitHub Support for help, please include the request ID REQUEST_ID and timestamp 2025-11-03 10:23:05 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service)

For example, I would prefer the following error.

You have reached the limit LIMIT. The limit will be reset at RESET.

Also, one might use this information to slow down such that we do not hit the rate limit.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions