How to get GitHub request limit state?

Hi!
In our scripts, we frequently use the following command:
Preformatted text hub api --paginate -XGET orgs/our_name/actions/runners -f per_page=100

We would like to monitor the number of requests we generate, however, we don’t know how to retrieve the information we need. We tested the following queries:

curl -H “Accept: application/vnd.github.v3+json” https://api.github.com/rate_limit
curl -I https://api.github.com/user/repos
curl -I https://api.github.com/user
curl -I https://api.github.com/org

None of them, however, returned results related to the above-mentioned command

Thanks for your help,
Sandra

Ratelimit information is provided in the headers for every API response, no matter which endpoint you use. Check the header fields with names starting with x-ratelimit. Their meanings are described in the docs:

Thanks. It worked :slight_smile:

1 Like