api
rate_limiting
ai_generated
partial
HTTP 403: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.
ID: api/github-secondary-rate-limit
72%Fix Rate
85%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
GitHub has undocumented 'secondary' rate limits separate from the 5000 req/hr primary limit. Triggered by concurrent requests, rapid content creation, or polling. Not visible in X-RateLimit headers.
genericWorkarounds
-
90% success Add 1s sleep between mutating requests (POST/PATCH/PUT)
import time; time.sleep(1) # between each write API call
-
88% success Use conditional requests with ETags for polling endpoints
headers = {'If-None-Match': cached_etag} # 304 responses don't count against limits -
85% success Implement exponential backoff starting at 60s on 403, with jitter
wait = 60 * (2 ** retry_count) + random.uniform(0, 10)
Dead Ends
Common approaches that don't work:
-
Check X-RateLimit-Remaining header and stay under 5000/hr
88% fail
Secondary rate limits are separate and invisible in standard rate limit headers. You can hit them at 100 req/hr if requests are concurrent.
-
Use a personal access token instead of GitHub App token
80% fail
Secondary rate limits apply to all authentication methods equally. PATs are not exempt.
-
Retry immediately after 403
75% fail
GitHub may escalate to longer bans if you retry too aggressively after secondary rate limit.