gh_rate_limit: Return GitHub user's current rate limits

View source: R/gh_rate_limit.R

gh_rate_limitR Documentation

Return GitHub user's current rate limits


gh_rate_limits() reports on all rate limits for the authenticated user. gh_rate_limit() reports on rate limits for previous successful request.

Further details on GitHub's API rate limit policies are available at


  response = NULL,
  .token = NULL,
  .api_url = NULL,
  .send_headers = NULL

gh_rate_limits(.token = NULL, .api_url = NULL, .send_headers = NULL)



gh_response object from a previous gh call, rate limit values are determined from values in the response header. Optional argument, if missing a call to "GET /rate_limit" will be made.


Authentication token. Defaults to GITHUB_PAT or GITHUB_TOKEN environment variables, in this order if any is set. See gh_token() if you need more flexibility, e.g. different tokens for different GitHub Enterprise deployments.


Github API url (default: Used if endpoint just contains a path. Defaults to GITHUB_API_URL environment variable if set.


Named character vector of header field values (except Authorization, which is handled via .token). This can be used to override or augment the default User-Agent header: "".


A list object containing the overall limit, remaining limit, and the limit reset time.

gh documentation built on May 29, 2024, 4:48 a.m.