Skip to main content
O controle de versão da API REST já foi feito. Para obter mais informações, confira "Sobre o controle de versão da API".

Pontos de extremidade da API REST para limites de taxa

Use a API REST para verificar seu status de limite de taxa atual.

Sobre limites de taxa

Você pode verificar seu status de limite de taxa atual a qualquer momento. Para obter mais informações sobre regras de limite de taxa, confira "Limites de taxa para a API REST".

A API REST para pesquisar itens tem um limite de taxa personalizado separado do limite de taxa que rege os outros pontos de extremidade da API REST. Para obter mais informações, confira "Pontos de extremidade da API REST para pesquisa". A API do GraphQL também tem um limite de taxa personalizado, separado e calculado de modo diferente dos limites de taxa na API REST. Para obter mais informações, confira "Limites de taxa e limites de nó para a API GraphQL". Por esses motivos, a resposta da API categoriza seu limite de taxa. Em resources, você verá objetos relacionados a diferentes categorias:

Para obter mais informações sobre os cabeçalhos e os valores na resposta do limite de taxa, confira "Limites de taxa para a API REST".

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.

Tokens de acesso refinados para "Get rate limit status for the authenticated user"

This endpoint works with the following fine-grained token types:

O token não requer permissões.

Esse ponto de extremidade pode ser usado sem autenticação se apenas recursos públicos forem solicitados.

Códigos de status de resposta HTTP para "Get rate limit status for the authenticated user"

Código de statusDescrição
200

OK

304

Not modified

404

Resource not found

Exemplos de código para "Get rate limit status for the authenticated user"

Exemplo de solicitação

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 } }