# Конечные точки REST API для ограничений скорости

Используйте REST API для проверки текущего состояния ограничения скорости.

## О ограничениях скорости

Вы можете проверить состояние текущего ограничения скорости в любое время. Дополнительные сведения о правилах ограничения скорости см. в разделе [Ограничения скорости для REST API](/ru/enterprise-server@3.19/rest/using-the-rest-api/rate-limits-for-the-rest-api).

REST API для поиска элементов имеет настраиваемое ограничение скорости, отличное от ограничения скорости, определяющего другие конечные точки REST API. Дополнительные сведения см. в разделе [Конечные точки REST API для поиска](/ru/enterprise-server@3.19/rest/search/search). Для API GraphQL также действует настраиваемое ограничение скорости, которое рассчитывается отдельно от ограничения скорости для REST API. Дополнительные сведения см. в разделе [Ограничения скорости и ограничения запросов для API GraphQL](/ru/enterprise-server@3.19/graphql/overview/rate-limits-and-query-limits-for-the-graphql-api#rate-limit). По этим причинам ответ API классифицирует ограничение скорости. В разделе `resources`вы увидите объекты, относящиеся к разным категориям:

* Объект `core` предоставляет состояние ограничения скорости для всех ресурсов в REST API, не связанных с поиском.

* Объект `search` предоставляет состояние ограничения скорости для REST API для поиска (за исключением поиска кода). Дополнительные сведения см. в разделе [Конечные точки REST API для поиска](/ru/enterprise-server@3.19/rest/search/search).

* Объект `code_search` предоставляет состояние ограничения скорости для REST API для поиска кода. Дополнительные сведения см. в разделе [Конечные точки REST API для поиска](/ru/enterprise-server@3.19/rest/search/search#search-code).

* Объект `graphql` предоставляет состояние ограничения скорости для API GraphQL.

* Объект `integration_manifest` предоставляет состояние ограничения скорости `POST /app-manifests/{code}/conversions` для операции. Дополнительные сведения см. в разделе [Регистрация приложения GitHub из манифеста](/ru/enterprise-server@3.19/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 для граф зависимостей](/ru/enterprise-server@3.19/rest/dependency-graph).

* Объект `code_scanning_upload` предоставляет состояние ограничения скорости для отправки результатов SARIF в сканирование кода. Дополнительные сведения см. в разделе [Отправка файла SARIF в GitHub](/ru/enterprise-server@3.19/code-security/how-tos/find-and-fix-code-vulnerabilities/integrate-with-existing-tools/upload-sarif-file).

* Объект `actions_runner_registration` предоставляет состояние ограничения скорости для регистрации локальных runners в GitHub Actions. Дополнительные сведения см. в разделе [Конечные точки REST API для локальных runners](/ru/enterprise-server@3.19/rest/actions/self-hosted-runners).

Дополнительные сведения о заголовках и значениях в ответе ограничения скорости см. в разделе [Ограничения скорости для REST API](/ru/enterprise-server@3.19/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)