Skip to content

Get subject stats

GET
/orgs/{org}/insights/api/subject-stats

Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps.

Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

min_timestamp
required
string

The minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

max_timestamp
string

The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

page
integer
default: 1

The page number of the results to fetch. For more information, see “Using pagination in the REST API.”

per_page
integer
default: 30

The number of results per page (max 100). For more information, see “Using pagination in the REST API.”

direction
string
default: desc
Allowed values: asc desc

The direction to sort the results by.

sort
Array<string>
Allowed values: last_rate_limited_timestamp last_request_timestamp rate_limited_request_count subject_name total_request_count

The property to sort the results by.

subject_name_substring
string

Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search.

Response

Media typeapplication/json
Subject Stats

API Insights usage subject stats for an organization

Array<object>
object
subject_type
string
subject_name
string
subject_id
integer format: int64
total_request_count
integer
rate_limited_request_count
integer
last_rate_limited_timestamp
string
nullable
last_request_timestamp
string
Examples
Exampledefault
[
{
"subject_type": "installation",
"subject_id": 954453,
"subject_name": "GitHub Actions",
"total_request_count": 544665,
"rate_limited_request_count": 13,
"last_request_timestamp": "2024-09-18T15:43:03Z",
"last_rate_limited_timestamp": "2024-09-18T06:30:09Z"
}
]