-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-rate-limit--openapi.yml
More file actions
318 lines (307 loc) · 10.6 KB
/
github-rate-limit--openapi.yml
File metadata and controls
318 lines (307 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
openapi: 3.0.3
info:
version: 1.1.4
title: GitHub Rate Limit API
description: >-
The GitHub Rate Limit API allows developers to check their current API usage
and remaining quota without consuming additional requests. Through this
endpoint, you can retrieve information about your rate limit status across
different API categories (such as core API requests, search requests, and
GraphQL queries), including how many requests you have remaining, when your
rate limit will reset, and your total allowed requests per hour. This API is
essential for building robust applications that need to monitor their API
consumption, implement intelligent request throttling, avoid hitting rate
limits that could disrupt service, and provide users with visibility into
their API usage status.
license:
name: MIT
url: https://spdx.org/licenses/MIT
termsOfService: https://docs.github.com/articles/github-terms-of-service
contact:
name: Support
url: https://support.github.com/contact?tags=dotcom-rest-api
x-github-plan: ghes
x-github-release: 3.9
tags:
- name: Get
- name: Limit
- name: Rate
servers:
- url: '{protocol}://{hostname}/api/v3'
variables:
hostname:
description: Self-hosted Enterprise Server hostname
default: HOSTNAME
protocol:
description: Self-hosted Enterprise Server protocol
default: http
externalDocs:
description: GitHub Enterprise Developer Docs
url: https://docs.github.com/enterprise-server@3.9/rest/
paths:
/rate_limit:
get:
summary: GitHub Get Rate Limit
description: >-
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](https://docs.github.com/enterprise-server@3.9/rest/search/search)."
* The `code_search` object provides your rate limit status for the REST
API for searching code. For more information, see "[Search
code](https://docs.github.com/enterprise-server@3.9/rest/search/search#search-code)."
* The `graphql` object provides your rate limit status for the GraphQL
API. For more information, see "[Resource
limitations](https://docs.github.com/enterprise-server@3.9/graphql/overview/resource-limitations#rate-limit)."
* 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](https://docs.github.com/enterprise-server@3.9/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)."
* The `dependency_snapshots` object provides your rate limit status for
submitting snapshots to the dependency graph. For more information, see
"[Dependency
graph](https://docs.github.com/enterprise-server@3.9/rest/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](https://docs.github.com/enterprise-server@3.9/code-security/code-scanning/integrating-with-code-scanning/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](https://docs.github.com/enterprise-server@3.9/rest/actions/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](https://docs.github.com/enterprise-server@3.9/rest/overview/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.
tags:
- Get
- Limit
- Rate
operationId: getRateLimit
externalDocs:
description: API method documentation
url: >-
https://docs.github.com/enterprise-server@3.9/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user
parameters: []
responses:
'200':
description: Response
content:
application/json:
schema:
$ref: '#/components/schemas/rate-limit-overview'
examples:
default:
$ref: '#/components/examples/rate-limit-overview'
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/x-rate-limit-limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/x-rate-limit-remaining'
X-RateLimit-Reset:
$ref: '#/components/headers/x-rate-limit-reset'
'304':
$ref: '#/components/responses/not_modified'
'404':
$ref: '#/components/responses/not_found'
x-github:
githubCloudOnly: false
enabledForGitHubApps: true
category: rate-limit
subcategory: rate-limit
security:
- bearerHttpAuthentication: []
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
components:
examples:
rate-limit-overview:
value:
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
reponses: {}
parameters: {}
schemas:
basic-error:
title: Basic Error
description: Basic Error
type: object
properties:
message:
type: string
example: Example body text
documentation_url:
type: string
example: https://api.github.com/repos/octocat/Hello-World
url:
type: string
example: https://api.github.com/repos/octocat/Hello-World
status:
type: string
example: open
rate-limit-overview:
title: Rate Limit Overview
description: Rate Limit Overview
type: object
properties:
resources:
type: object
properties:
core:
$ref: '#/components/schemas/rate-limit'
graphql:
$ref: '#/components/schemas/rate-limit'
search:
$ref: '#/components/schemas/rate-limit'
code_search:
$ref: '#/components/schemas/rate-limit'
source_import:
$ref: '#/components/schemas/rate-limit'
integration_manifest:
$ref: '#/components/schemas/rate-limit'
code_scanning_upload:
$ref: '#/components/schemas/rate-limit'
actions_runner_registration:
$ref: '#/components/schemas/rate-limit'
scim:
$ref: '#/components/schemas/rate-limit'
required:
- core
- search
rate:
$ref: '#/components/schemas/rate-limit'
required:
- rate
- resources
rate-limit:
title: Rate Limit
type: object
properties:
limit:
type: integer
example: 42
remaining:
type: integer
example: 42
reset:
type: integer
example: 42
used:
type: integer
example: 42
required:
- limit
- remaining
- reset
- used
responses:
not_modified:
description: Not modified
not_found:
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/basic-error'
securitySchemes:
bearerHttpAuthentication:
description: Bearer Token
type: http
scheme: Bearer
headers:
link:
example: >-
<https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
schema:
type: string
content-type:
example: text/html
schema:
type: string
x-common-marker-version:
example: 0.17.4
schema:
type: string
x-rate-limit-limit:
example: 5000
schema:
type: integer
x-rate-limit-remaining:
example: 4999
schema:
type: integer
x-rate-limit-reset:
example: 1590701888
schema:
type: integer
format: timestamp
location:
example: >-
https://pipelines.actions.githubusercontent.com/OhgS4QRKqmgx7bKC27GKU83jnQjyeqG8oIMTge8eqtheppcmw8/_apis/pipelines/1/runs/176/signedlogcontent?urlExpires=2020-01-24T18%3A10%3A31.5729946Z&urlSigningMethod=HMACV1&urlSignature=agG73JakPYkHrh06seAkvmH7rBR4Ji4c2%2B6a2ejYh3E%3D
schema:
type: string