レート制限
REST API を使って、現在のレート制限の状態を確認します。
レート制限について
現在のレート制限の状態はいつでも確認できます。 レート制限規則の詳細については、「REST API のリソース」を参照してください。
アイテムを検索するための REST API には、他の REST API エンドポイントを管理するレート制限とは別のカスタム レート制限があります。 詳しくは、「検索」を参照してください。 GraphQL API にも、REST API のレート制限とは別の、別の方法で計算されるカスタム レート制限があります。 詳しくは、「リソースの制限事項」を参照してください。 そのため、API の応答は、レート制限を分類します。 resources の下には、次のようなさまざまなカテゴリに関連するオブジェクトが表示されます。
-
coreオブジェクトは、REST API の検索に関連しないすべてのリソースに関するレート制限の状態を示します。 -
searchオブジェクトは、REST API の検索に関するレート制限の状態を示します。 -
graphqlオブジェクトは、GraphQL API のレート制限の状態を示します。 -
integration_manifestオブジェクトは、POST /app-manifests/{code}/conversions操作のレート制限の状態を示します。 詳しくは、「マニフェストから GitHub App を作成する」を参照してください。
レート制限の応答のヘッダーと値の詳細については、「REST API のリソース」を参照してください。
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 status for the authenticated user" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
304 | Not modified |
404 | Resource not found |
"Get rate limit status for the authenticated user" のコード サンプル
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://HOSTNAME/api/v3/rate_limitResponse
Status: 200{
"resources": {
"core": {
"limit": 5000,
"remaining": 4999,
"reset": 1372700873,
"used": 1
},
"search": {
"limit": 30,
"remaining": 18,
"reset": 1372697452,
"used": 12
},
"graphql": {
"limit": 5000,
"remaining": 4993,
"reset": 1372700389,
"used": 7
},
"integration_manifest": {
"limit": 5000,
"remaining": 4999,
"reset": 1551806725,
"used": 1
},
"code_scanning_upload": {
"limit": 500,
"remaining": 499,
"reset": 1551806725,
"used": 1
}
},
"rate": {
"limit": 5000,
"remaining": 4999,
"reset": 1372700873,
"used": 1
}
}