The REST API overview documentation describes the rate limit rules. You can check your current rate limit status at any time using the Rate Limit API described below.
レート制限のステータスを理解する
Search APIはカスタムのレート制限を持ち、他のREST APIを管理するレート制限とは分離されています。 GraphQL APIもカスタムのレート制限を持ち、REST APIのレート制限とは分離されて別に計算されます。
そのため、Rate Limit APIのレスポンスは、レート制限を分類します。 Under resources, you'll see four objects:
-
coreオブジェクトは、REST API中の検索に関連しないすべてのリソースに関するレート制限のステータスを提供します。 -
searchオブジェクトは、Search APIに対するレート制限のステータスを提供します。 -
graphqlオブジェクトは、GraphQL APIに対するレート制限のステータスを提供します。 -
integration_manifestオブジェクトは、GitHub App Manifest コード変換エンドポイントに対するレート制限のステータスを提供します。
レート制限レスポンス中のヘッダと値に関する詳しい情報については「レート制限」を参照してください。
Get rate limit status for the authenticated user
Note: Accessing this endpoint does not count against your REST API rate limit.
Note: The rate object is deprecated. If you're writing new API client code or updating existing code, you should use the core object instead of the rate object. The core object contains the same information that is present in the rate object.
get /rate_limit
パラメータ
| Name | Type | In | Description |
|---|---|---|---|
accept |
string | header |
Setting to |
コードサンプル
Shell
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/rate_limit
JavaScript (@octokit/core.js)
await octokit.request('GET /rate_limit')
Default response
Status: 200 OK
{
"resources": {
"core": {
"limit": 5000,
"remaining": 4999,
"reset": 1372700873
},
"search": {
"limit": 30,
"remaining": 18,
"reset": 1372697452
},
"graphql": {
"limit": 5000,
"remaining": 4993,
"reset": 1372700389
},
"integration_manifest": {
"limit": 5000,
"remaining": 4999,
"reset": 1551806725
}
},
"rate": {
"limit": 5000,
"remaining": 4999,
"reset": 1372700873
}
}