An API key may make up to 120 requests a minute. Every request made with the key counts, whatever the answer: a request refused with 403 counts too.
Past the limit, every request answers 429 with the code RATE_LIMITED and a Retry-After header. Its value is a number of seconds. Wait that long, then retry.
Text
HTTP/1.1 429 Too Many Requests
Retry-After: 12JSON
{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Staying under the limit
- Poll at a steady pace. Read a build or a deployment every 3 to 5 seconds until it is done. That is 12 to 20 requests a minute.
- Don't poll in a tight loop. Wait between calls, and stop when
terminalistrue. - Wait for
Retry-After. After a429, wait the seconds it says before you retry.
Retry-After also comes with three 503 answers: MAINTENANCE, GITHUB_RATE_LIMITED and METRICS_UNAVAILABLE. See Errors.
Lookups in GitHub repositories
Looking up a public repository, or the folders of a repository, is limited to about 30 a minute for the key's owner. What a key does for its owner counts together with their own sessions.