You can automatically pull data from GitHub to populate the business systems you use to monitor costs and usage using the REST API. If you haven't used the GitHub REST API before, see Using the REST API.
Overview of endpoints
You need to use different endpoints to gather data depending on your account type and the information level you want.
| Account | Report | Access | Endpoint | More information |
|---|---|---|---|---|
| Users | Premium request consumption, with details of quota and billed usage | Account holder | /users/{username}/settings/billing/premium_request/usage | Billing usage |
| Users | Usage data for all paid products | Account holder | /users/{username}/settings/billing/usage/summary | Billing usage |
| Organizations | Premium request consumption, with details of quota and billed usage | Organization owners and billing managers | /organizations/{org}/settings/billing/premium_request/usage | Billing usage |
| Organizations | Usage data for all paid products | Organization owners and billing managers | /organizations/{org}/settings/billing/usage/summary | Billing usage |
| Enterprises | Premium request consumption, with details of quota and billed usage | Enterprise owners and billing managers | /enterprises/{enterprise}/settings/billing/premium_request/usage | Billing usage |
| Enterprises | Usage data for all paid products | Enterprise owners and billing managers | /enterprises/{enterprise}/settings/billing/usage/summary |