Skip to main content

api_insights_summary_stats

Creates, updates, deletes, gets or lists an api_insights_summary_stats resource.

Overview

Nameapi_insights_summary_stats
TypeResource
Idgithub.orgs.api_insights_summary_stats

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
rate_limited_request_countinteger (int64)The total number of requests that were rate limited within the queried time period
total_request_countinteger (int64)The total number of requests within the queried time period

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_summary_stats_by_actorselectorg, min_timestamp, actor_type, actor_idmax_timestampGet 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.
get_summary_stats_by_userselectorg, user_id, min_timestampmax_timestampGet overall statistics of API requests within the organization for a user.
get_summary_statsselectorg, min_timestampmax_timestampGet overall statistics of API requests made within an organization by all users and apps within a specified time frame.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
actor_idintegerThe ID of the actor
actor_typestringThe type of the actor
min_timestampstringThe minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
orgstringThe organization name. The name is not case sensitive.
user_idstringThe ID of the user to query for stats
max_timestampstringThe 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.

SELECT examples

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.

SELECT
rate_limited_request_count,
total_request_count
FROM github.orgs.api_insights_summary_stats
WHERE org = '{{ org }}' -- required
AND min_timestamp = '{{ min_timestamp }}' -- required
AND actor_type = '{{ actor_type }}' -- required
AND actor_id = '{{ actor_id }}' -- required
AND max_timestamp = '{{ max_timestamp }}'
;