Search + K

Command Palette

Search for a command to run...

Sign In

Get subject stats

GET /orgs/{org}/insights/api/subject-stats
Copy endpoint
https://api.github.com

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

Parameters

path Path Parameters

Name Type
org required

The organization name. The name is not case sensitive.

string

query Query Parameters

Name Type
min_timestamp required

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

string
max_timestamp

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.

string
page

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

number
per_page

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

number
direction

The direction to sort the results by.

"asc" | "desc"
sort

The property to sort the results by.

("last_rate_limited_timestamp" | "last_request_timestamp" | "rate_limited_request_count" | "subject_name" | "total_request_count")[]
subject_name_substring

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

string

Responses

200 application/json

Response

type ApiInsightsSubjectStats = {
subject_type?: string;
subject_name?: string;
subject_id?: number;
total_request_count?: number;
rate_limited_request_count?: number;
last_rate_limited_timestamp?: string | null;
last_request_timestamp?: string;
}
[]