Skip to main content
REST API はバージョン管理になりました。 詳細については、「API のバージョン管理について」を参照してください。

レート制限用 REST API エンドポイント

REST API を使って、現在のレート制限の状態を確認します。

レート制限について

現在のレート制限の状態はいつでも確認できます。 レート制限規則の詳細については、「REST API のレート制限」を参照してください。

アイテムを検索するための REST API には、他の REST API エンドポイントを管理するレート制限とは別のカスタム レート制限があります。 詳しくは、「検索用 REST API エンドポイント」を参照してください。 GraphQL API にも、REST API のレート制限とは別の、別の方法で計算されるカスタム レート制限があります。 詳しくは、「GraphQL API のレート制限とノード制限」を参照してください。 そのため、API の応答は、レート制限を分類します。 resources の下には、次のようなさまざまなカテゴリに関連するオブジェクトが表示されます。

  • core オブジェクトは、REST API の検索に関連しないすべてのリソースに関するレート制限の状態を示します。

  • search オブジェクトは、REST API の検索に関するレート制限の状態を示します (コード検索を除く)。 詳しくは、「検索用 REST API エンドポイント」を参照してください。

  • code_search オブジェクトは、REST API のコード検索に関するレート制限の状態を示します。 詳しくは、「検索用 REST API エンドポイント」を参照してください。

  • graphql オブジェクトは、GraphQL API のレート制限の状態を示します。

  • integration_manifest オブジェクトは、POST /app-manifests/{code}/conversions 操作のレート制限の状態を示します。 詳しくは、「マニフェストから GitHub App を登録する」を参照してください。

  • dependency_snapshots オブジェクトからは、スナップショットを依存関係グラフに送信するためのレート制限ステータスが与えられます。 詳しくは、「依存関係グラフ用の REST API エンドポイント」を参照してください。

  • code_scanning_upload オブジェクトは、SARIF の結果をコード スキャンにアップロードするためのレート制限の状態を示します。 詳しくは、「SARIF ファイルを GitHub にアップロードする」を参照してください。

  • actions_runner_registration オブジェクトには GitHub Actions でセルフホステッド ランナーを登録するためのレート制限状態が用意されています。 詳しくは、「セルフホステッド ランナーの REST API エンドポイント」を参照してください。

レート制限の応答のヘッダーと値の詳細については、「REST API のレート制限」を参照してください。

Get rate limit status for the authenticated user

Note: Accessing this endpoint does not count against your REST API rate limit.

Some categories of endpoints have custom rate limits that are separate from the rate limit governing the other REST API endpoints. For this reason, the API response categorizes your rate limit. Under resources, you'll see objects relating to different categories:

  • The core object provides your rate limit status for all non-search-related resources in the REST API.
  • The search object provides your rate limit status for the REST API for searching (excluding code searches). For more information, see "Search."
  • The code_search object provides your rate limit status for the REST API for searching code. For more information, see "Search code."
  • The graphql object provides your rate limit status for the GraphQL API. For more information, see "Resource limitations."
  • The integration_manifest object provides your rate limit status for the POST /app-manifests/{code}/conversions operation. For more information, see "Creating a GitHub App from a manifest."
  • The dependency_snapshots object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "Dependency graph."
  • The code_scanning_upload object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "Uploading a SARIF file to GitHub."
  • The actions_runner_registration object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "Self-hosted runners."
  • The source_import object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "API Versions."

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" のきめ細かいアクセス トークン

このエンドポイントは、次のトークンの種類で動作します:

トークンにはアクセス許可は必要ありません。

パブリック リソースのみが要求された場合、このエンドポイントは認証なしで使用できます。

"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" のコード サンプル

要求の例

get/rate_limit
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/rate_limit

Response

Status: 200
{ "resources": { "core": { "limit": 5000, "used": 1, "remaining": 4999, "reset": 1691591363 }, "search": { "limit": 30, "used": 12, "remaining": 18, "reset": 1691591091 }, "graphql": { "limit": 5000, "used": 7, "remaining": 4993, "reset": 1691593228 }, "integration_manifest": { "limit": 5000, "used": 1, "remaining": 4999, "reset": 1691594631 }, "source_import": { "limit": 100, "used": 1, "remaining": 99, "reset": 1691591091 }, "code_scanning_upload": { "limit": 500, "used": 1, "remaining": 499, "reset": 1691594631 }, "actions_runner_registration": { "limit": 10000, "used": 0, "remaining": 10000, "reset": 1691594631 }, "scim": { "limit": 15000, "used": 0, "remaining": 15000, "reset": 1691594631 }, "dependency_snapshots": { "limit": 100, "used": 0, "remaining": 100, "reset": 1691591091 }, "code_search": { "limit": 10, "used": 0, "remaining": 10, "reset": 1691591091 } }, "rate": { "limit": 5000, "used": 1, "remaining": 4999, "reset": 1372700873 } }