Types of GitHub API rate limits
GitHub enforces two kinds of rate limits to keep the API stable and responsive.- Primary rate limits — apply to both authenticated and unauthenticated requests and are counted per hour.
- Unauthenticated requests (tied to the requestor’s IP) are limited to 60 requests per hour.
- Requests authenticated with a Personal Access Token (PAT) are generally allowed up to 5,000 requests per hour.
- GitHub Apps, or enterprise-owned apps, may receive higher primary limits (for example, around 15,000 requests per hour).

- Secondary rate limits — applied in addition to primary limits to protect the API from abusive or costly patterns. You may hit secondary limits when you:
- Make too many concurrent requests,
- Make a short burst of requests that require heavy compute,
- Make too many requests per minute to the same endpoint, etc.

How to check your current rate-limit status
You can monitor rate-limit status in two ways:- Inspect the rate-limit response headers on every API response.
- Call the
GET /rate_limitendpoint to get resource-specific limits.
X-RateLimit-* headers:
Inspect the
X-RateLimit-* headers on every API response for quick monitoring. Use the GET /rate_limit endpoint when you need a full, resource-specific snapshot (core, search, graphql, etc.).Best practices to avoid hitting rate limits
- Avoid frequent polling — use webhooks when possible.
- Reduce concurrency — limit simultaneous requests from a single client.
- Use conditional requests (
ETag+If-None-Match) to avoid downloading unchanged resources. - Batch requests where applicable and cache responses.
- Authenticate API requests using a PAT, GitHub App, or OAuth token to increase your primary limits.

Increase your primary limits: generate a Personal Access Token (PAT)
Create a PAT from your GitHub account: Settings → Developer settings → Personal access tokens. For details see Creating a personal access token. Example: authenticated call toGET /rate_limit (replace YOUR_TOKEN):
core limits and X-RateLimit-* response headers should show higher quotas (for PATs typically x-ratelimit-limit: 5000).
Fetch repository content (example)
Fetch a file from a repository with the contents endpoint — replace values as needed:Actions REST APIs and SAML-protected organizations
When calling Actions endpoints (for exampleGET /repos/{owner}/{repo}/actions/runs), ensure your token has the required scopes and access to the repository:
If an organization enforces SAML SSO, grant your Personal Access Token access to that organization after generating it — otherwise API calls to organization-protected resources will fail with a 403.
Summary
- Monitor usage via the
GET /rate_limitendpoint and theX-RateLimit-*response headers. - Authenticate with a PAT, GitHub App, or OAuth token to increase primary rate limits (PATs typically get ~5,000 requests/hour).
- Follow best practices (avoid polling, reduce concurrency, use conditional requests) to avoid primary and secondary limits.
- If you access organization-protected resources and the organization uses SAML SSO, remember to grant your PAT access to the organization.
- GitHub REST API — Rate limits
- Best practices for using the REST API
- Creating a personal access token