Skip to content

Get route stats by actor

GET
/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}

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.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

actor_type
required
string
Allowed values: installation classic_pat fine_grained_pat oauth_app github_app_user_to_server

The type of the actor

actor_id
required
integer

The ID of the actor

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 http_method api_route total_request_count

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.

Response

Media typeapplication/json
Route Stats

API Insights usage route stats for an actor

Array<object>
object
http_method

The HTTP method

string
api_route

The API path’s route template

string
total_request_count

The total number of requests within the queried time period

integer format: int64
rate_limited_request_count

The total number of requests that were rate limited within the queried time period

integer format: int64
last_rate_limited_timestamp
string
nullable
last_request_timestamp
string
Examples
Exampledefault
[
{
"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"
}
]