Skip to main content
REST API теперь версия. Дополнительные сведения см. в разделе "О управлении версиями API".

Конечные точки REST API для API Insights

Используйте REST API для просмотра статистики использования API в организации.

Get route stats by actor

Get API request count statistics for an actor broken down by route within a specified time frame.

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.

Детализированные токены доступа для «Get route stats by actor»

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "API Insights" organization permissions (read)

Параметры для «Get route stats by actor»

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

actor_type string Обязательное поле

The type of the actor

Возможные значения: installation, classic_pat, fine_grained_pat, oauth_app, github_app_user_to_server

actor_id integer Обязательное поле

The ID of the actor

Параметры запроса
Имя., Тип, Description
min_timestamp 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

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

По умолчанию.: 1

per_page integer

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

По умолчанию.: 30

direction string

The direction to sort the results by.

По умолчанию.: desc

Возможные значения: asc, desc

sort array

The property to sort the results by.

api_route_substring string

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

HTTP-коды статуса ответа для «Get route stats by actor»

Код состоянияDescription
200

OK

Примеры кода для «Get route stats by actor»

Пример запроса

get/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ "https://api.github.com/orgs/ORG/insights/api/route-stats/ACTOR_TYPE/ACTOR_ID?min_timestamp=MIN_TIMESTAMP"

Response

Status: 200
[ { "http_method": "GET", "api_route": "/repositories/:repository_id", "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" } ]

Get 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.

Детализированные токены доступа для «Get subject stats»

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "API Insights" organization permissions (read)

Параметры для «Get subject stats»

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Параметры запроса
Имя., Тип, Description
min_timestamp 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

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

По умолчанию.: 1

per_page integer

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

По умолчанию.: 30

direction string

The direction to sort the results by.

По умолчанию.: desc

Возможные значения: asc, desc

sort array

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.

HTTP-коды статуса ответа для «Get subject stats»

Код состоянияDescription
200

OK

Примеры кода для «Get subject stats»

Пример запроса

get/orgs/{org}/insights/api/subject-stats
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ "https://api.github.com/orgs/ORG/insights/api/subject-stats?min_timestamp=MIN_TIMESTAMP"

Response

Status: 200
[ { "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" } ]

Get summary stats

Get overall statistics of API requests made within an organization by all users and apps within a specified time frame.

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.

Детализированные токены доступа для «Get summary stats»

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "API Insights" organization permissions (read)

Параметры для «Get summary stats»

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Параметры запроса
Имя., Тип, Description
min_timestamp 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.

HTTP-коды статуса ответа для «Get summary stats»

Код состоянияDescription
200

OK

Примеры кода для «Get summary stats»

Пример запроса

get/orgs/{org}/insights/api/summary-stats
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ "https://api.github.com/orgs/ORG/insights/api/summary-stats?min_timestamp=MIN_TIMESTAMP"

Response

Status: 200
{ "total_request_count": 34225, "rate_limited_request_count": 23 }

Get summary stats by user

Get overall statistics of API requests within the organization for a user.

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.

Детализированные токены доступа для «Get summary stats by user»

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "API Insights" organization permissions (read)

Параметры для «Get summary stats by user»

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

user_id string Обязательное поле

The ID of the user to query for stats

Параметры запроса
Имя., Тип, Description
min_timestamp 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.

HTTP-коды статуса ответа для «Get summary stats by user»

Код состоянияDescription
200

OK

Примеры кода для «Get summary stats by user»

Пример запроса

get/orgs/{org}/insights/api/summary-stats/users/{user_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ "https://api.github.com/orgs/ORG/insights/api/summary-stats/users/USER_ID?min_timestamp=MIN_TIMESTAMP"

Response

Status: 200
{ "total_request_count": 34225, "rate_limited_request_count": 23 }

Get summary stats by actor

Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user.

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.

Детализированные токены доступа для «Get summary stats by actor»

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "API Insights" organization permissions (read)

Параметры для «Get summary stats by actor»

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

actor_type string Обязательное поле

The type of the actor

Возможные значения: installation, classic_pat, fine_grained_pat, oauth_app, github_app_user_to_server

actor_id integer Обязательное поле

The ID of the actor

Параметры запроса
Имя., Тип, Description
min_timestamp 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.

HTTP-коды статуса ответа для «Get summary stats by actor»

Код состоянияDescription
200

OK

Примеры кода для «Get summary stats by actor»

Пример запроса

get/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ "https://api.github.com/orgs/ORG/insights/api/summary-stats/ACTOR_TYPE/ACTOR_ID?min_timestamp=MIN_TIMESTAMP"

Response

Status: 200
{ "total_request_count": 34225, "rate_limited_request_count": 23 }

Get time stats

Get the number of API requests and rate-limited requests made within an organization over a specified time period.

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.

Детализированные токены доступа для «Get time stats»

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "API Insights" organization permissions (read)

Параметры для «Get time stats»

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Параметры запроса
Имя., Тип, Description
min_timestamp 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.

timestamp_increment string Обязательное поле

The increment of time used to breakdown the query results (5m, 10m, 1h, etc.)

HTTP-коды статуса ответа для «Get time stats»

Код состоянияDescription
200

OK

Примеры кода для «Get time stats»

Пример запроса

get/orgs/{org}/insights/api/time-stats
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ "https://api.github.com/orgs/ORG/insights/api/time-stats?min_timestamp=MIN_TIMESTAMP&timestamp_increment=TIMESTAMP_INCREMENT"

Response

Status: 200
[ { "timestamp": "2024-09-11T15:00:00Z", "total_request_count": 34225, "rate_limited_request_count": 0 }, { "timestamp": "2024-09-11T15:05:00Z", "total_request_count": 10587, "rate_limited_request_count": 18 }, { "timestamp": "2024-09-11T15:10:00Z", "total_request_count": 43587, "rate_limited_request_count": 14 }, { "timestamp": "2024-09-11T15:15:00Z", "total_request_count": 19463, "rate_limited_request_count": 4 }, { "timestamp": "2024-09-11T15:20:00Z", "total_request_count": 60542, "rate_limited_request_count": 3 }, { "timestamp": "2024-09-11T15:25:00Z", "total_request_count": 55872, "rate_limited_request_count": 23 } ]

Get time stats by user

Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period.

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.

Детализированные токены доступа для «Get time stats by user»

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "API Insights" organization permissions (read)

Параметры для «Get time stats by user»

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

user_id string Обязательное поле

The ID of the user to query for stats

Параметры запроса
Имя., Тип, Description
min_timestamp 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.

timestamp_increment string Обязательное поле

The increment of time used to breakdown the query results (5m, 10m, 1h, etc.)

HTTP-коды статуса ответа для «Get time stats by user»

Код состоянияDescription
200

OK

Примеры кода для «Get time stats by user»

Пример запроса

get/orgs/{org}/insights/api/time-stats/users/{user_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ "https://api.github.com/orgs/ORG/insights/api/time-stats/users/USER_ID?min_timestamp=MIN_TIMESTAMP&timestamp_increment=TIMESTAMP_INCREMENT"

Response

Status: 200
[ { "timestamp": "2024-09-11T15:00:00Z", "total_request_count": 34225, "rate_limited_request_count": 0 }, { "timestamp": "2024-09-11T15:05:00Z", "total_request_count": 10587, "rate_limited_request_count": 18 }, { "timestamp": "2024-09-11T15:10:00Z", "total_request_count": 43587, "rate_limited_request_count": 14 }, { "timestamp": "2024-09-11T15:15:00Z", "total_request_count": 19463, "rate_limited_request_count": 4 }, { "timestamp": "2024-09-11T15:20:00Z", "total_request_count": 60542, "rate_limited_request_count": 3 }, { "timestamp": "2024-09-11T15:25:00Z", "total_request_count": 55872, "rate_limited_request_count": 23 } ]

Get time stats by actor

Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period.

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.

Детализированные токены доступа для «Get time stats by actor»

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "API Insights" organization permissions (read)

Параметры для «Get time stats by actor»

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

actor_type string Обязательное поле

The type of the actor

Возможные значения: installation, classic_pat, fine_grained_pat, oauth_app, github_app_user_to_server

actor_id integer Обязательное поле

The ID of the actor

Параметры запроса
Имя., Тип, Description
min_timestamp 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.

timestamp_increment string Обязательное поле

The increment of time used to breakdown the query results (5m, 10m, 1h, etc.)

HTTP-коды статуса ответа для «Get time stats by actor»

Код состоянияDescription
200

OK

Примеры кода для «Get time stats by actor»

Пример запроса

get/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ "https://api.github.com/orgs/ORG/insights/api/time-stats/ACTOR_TYPE/ACTOR_ID?min_timestamp=MIN_TIMESTAMP&timestamp_increment=TIMESTAMP_INCREMENT"

Response

Status: 200
[ { "timestamp": "2024-09-11T15:00:00Z", "total_request_count": 34225, "rate_limited_request_count": 0 }, { "timestamp": "2024-09-11T15:05:00Z", "total_request_count": 10587, "rate_limited_request_count": 18 }, { "timestamp": "2024-09-11T15:10:00Z", "total_request_count": 43587, "rate_limited_request_count": 14 }, { "timestamp": "2024-09-11T15:15:00Z", "total_request_count": 19463, "rate_limited_request_count": 4 }, { "timestamp": "2024-09-11T15:20:00Z", "total_request_count": 60542, "rate_limited_request_count": 3 }, { "timestamp": "2024-09-11T15:25:00Z", "total_request_count": 55872, "rate_limited_request_count": 23 } ]

Get user stats

Get API usage statistics within an organization for a user broken down by the type of access.

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.

Детализированные токены доступа для «Get user stats»

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "API Insights" organization permissions (read)

Параметры для «Get user stats»

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

user_id string Обязательное поле

The ID of the user to query for stats

Параметры запроса
Имя., Тип, Description
min_timestamp 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

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

По умолчанию.: 1

per_page integer

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

По умолчанию.: 30

direction string

The direction to sort the results by.

По умолчанию.: desc

Возможные значения: asc, desc

sort array

The property to sort the results by.

actor_name_substring string

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

HTTP-коды статуса ответа для «Get user stats»

Код состоянияDescription
200

OK

Примеры кода для «Get user stats»

Пример запроса

get/orgs/{org}/insights/api/user-stats/{user_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ "https://api.github.com/orgs/ORG/insights/api/user-stats/USER_ID?min_timestamp=MIN_TIMESTAMP"

Response

Status: 200
[ { "actor_type": "oauth_app", "actor_id": 954453, "actor_name": "GitHub Actions", "oauth_application_id": 1245, "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" } ]