You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-28Lines changed: 45 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,54 +189,71 @@ using the installation ID of the GitHub app and authenticate with the OAuth meth
189
189
190
190
### Rate Limiting ###
191
191
192
-
GitHub imposes a rate limit on all API clients. Unauthenticated clients are
193
-
limited to 60 requests per hour, while authenticated clients can make up to
194
-
5,000 requests per hour. The Search API has a custom rate limit. Unauthenticated
195
-
clients are limited to 10 requests per minute, while authenticated clients
196
-
can make up to 30 requests per minute. To receive the higher rate limit when
197
-
making calls that are not issued on behalf of a user,
198
-
use `UnauthenticatedRateLimitedTransport`.
199
-
200
-
The returned `Response.Rate` value contains the rate limit information
192
+
GitHub imposes rate limits on all API clients. The [primary rate limit](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-primary-rate-limits)
193
+
is the limit to the number of REST API requests that a client can make within a
194
+
specific amount of time. This limit helps prevent abuse and denial-of-service
195
+
attacks, and ensures that the API remains available for all users. Some
196
+
endpoints, like the search endpoints, have more restrictive limits.
197
+
Unauthenticated clients may request public data but have a low rate limit,
198
+
while authenticated clients have rate limits based on the client
199
+
identity.
200
+
201
+
In addition to primary rate limits, GitHub enforces [secondary rate limits](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)
202
+
in order to prevent abuse and keep the API available for all users.
203
+
Secondary rate limits generally limit the number of concurrent requests that a
204
+
client can make.
205
+
206
+
The client returned `Response.Rate` value contains the rate limit information
201
207
from the most recent API call. If a recent enough response isn't
202
-
available, you can use `RateLimits` to fetch the most up-to-date rate
203
-
limit data for the client.
208
+
available, you can use the client `RateLimits`service to fetch the most
209
+
up-to-date rate limit data for the client.
204
210
205
-
To detect an API rate limit error, you can check if its type is `*github.RateLimitError`:
211
+
To detect a primary API rate limit error, you can check if the error is a
0 commit comments