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

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

## レート制限について

現在のレート制限の状態はいつでも確認できます。 レート制限規則の詳細については、「[REST API のレート制限](/ja/enterprise-server@3.18/rest/using-the-rest-api/rate-limits-for-the-rest-api)」を参照してください。

アイテムを検索するための REST API には、他の REST API エンドポイントを管理するレート制限とは別のカスタム レート制限があります。 詳しくは、「[検索用 REST API エンドポイント](/ja/enterprise-server@3.18/rest/search/search)」をご覧ください。 GraphQL API にも、REST API のレート制限とは別の、別の方法で計算されるカスタム レート制限があります。 詳しくは、「[GraphQL API のレート制限とクエリ制限](/ja/enterprise-server@3.18/graphql/overview/rate-limits-and-query-limits-for-the-graphql-api#primary-rate-limit)」をご覧ください。 そのため、API の応答は、レート制限を分類します。
`resources` の下には、次のようなさまざまなカテゴリに関連するオブジェクトが表示されます。

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

* `search` オブジェクトは、REST API の検索に関するレート制限の状態を示します (コード検索を除く)。 詳しくは、「[検索用 REST API エンドポイント](/ja/enterprise-server@3.18/rest/search/search)」をご覧ください。

* `code_search` オブジェクトは、REST API のコード検索に関するレート制限の状態を示します。 詳しくは、「[検索用 REST API エンドポイント](/ja/enterprise-server@3.18/rest/search/search#search-code)」をご覧ください。

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

* `integration_manifest` オブジェクトは、`POST /app-manifests/{code}/conversions` 操作のレート制限の状態を示します。 詳しくは、「[マニフェストからのGitHub アプリの登録](/ja/enterprise-server@3.18/apps/sharing-github-apps/registering-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)」をご覧ください。

* `dependency_snapshots` オブジェクトからは、スナップショットを依存関係グラフに送信するためのレート制限ステータスが与えられます。 詳しくは、「[依存関係グラフ用の REST API エンドポイント](/ja/enterprise-server@3.18/rest/dependency-graph)」をご覧ください。

* `code_scanning_upload` オブジェクトは、SARIF の結果をコード スキャンにアップロードするためのレート制限の状態を示します。 詳しくは、「[SARIF ファイルを GitHub にアップロードする](/ja/enterprise-server@3.18/code-security/how-tos/find-and-fix-code-vulnerabilities/integrate-with-existing-tools/upload-sarif-file)」をご覧ください。

* `actions_runner_registration` オブジェクトは、GitHub Actionsにセルフホステッド ランナーを登録するためのレート制限の状態を提供します。 詳しくは、「[セルフホステッド ランナーの REST API エンドポイント](/ja/enterprise-server@3.18/rest/actions/self-hosted-runners)」をご覧ください。

レート制限の応答のヘッダーと値の詳細については、「[REST API のレート制限](/ja/enterprise-server@3.18/rest/using-the-rest-api/rate-limits-for-the-rest-api)」を参照してください。

> \[!NOTE]
> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2022-11-28`. Curl examples below omit these standard headers for brevity.

## Get rate limit status for the authenticated user

```
GET /rate_limit
```

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 dependency\_sbom object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "Dependency graph."
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 closing down. 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.

### HTTP response status codes

* **200** - OK

* **304** - Not modified

* **404** - Resource not found

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/rate_limit
```

**Response schema (Status: 200):**

* `resources`: required, object:
  * `core`: required, `Rate Limit`:
    * `limit`: required, integer
    * `remaining`: required, integer
    * `reset`: required, integer
    * `used`: required, integer
  * `graphql`: `Rate Limit` (see above)
  * `search`: required, `Rate Limit` (see above)
  * `code_search`: `Rate Limit` (see above)
  * `source_import`: `Rate Limit` (see above)
  * `integration_manifest`: `Rate Limit` (see above)
  * `actions_runner_registration`: `Rate Limit` (see above)
  * `scim`: `Rate Limit` (see above)
  * `dependency_sbom`: `Rate Limit` (see above)
  * `code_scanning_autofix`: `Rate Limit` (see above)
  * `copilot_usage_records`: `Rate Limit` (see above)
* `rate`: required, `Rate Limit` (see above)