Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub API: get billing quota reset date

Is there a GitHub API I can use to retrieve the number of days X in

GitHub Actions

Included minutes quota resets in X days

which you can find on the https://github.com/settings/billing page?

billing quota

Performing the following API call

# GITHUB_TOKEN with "Update ALL user data" permission
curl \
  -H "Authorization: token $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/users/$GITHUB_USER/settings/billing/actions

I get all info except for the billing period expiration date:

{
  "total_minutes_used": 228,
  "total_paid_minutes_used": 0,
  "included_minutes": 2000,
  "minutes_used_breakdown": {
    "UBUNTU": 228
  }
}

Many thanks.

like image 411
horothesun Avatar asked Mar 12 '26 02:03

horothesun


1 Answers

I've figured out the "number of days left in the billing cycle" can be retrieved from the /users/<user>/settings/billing/shared-storage endpoint.

E.g.

curl \
  -H "Authorization: token $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/users/$GITHUB_USER/settings/billing/shared-storage

returns

{
  "days_left_in_billing_cycle": 5,
  "estimated_paid_storage_for_month": 0,
  "estimated_storage_for_month": 0
}
like image 196
horothesun Avatar answered Mar 15 '26 17:03

horothesun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!