Skip to content

Commit 3da9a4b

Browse files
authored
Document the x-ratelimit-used response header on the "Resources in the REST API" page (github#29242)
1 parent 534adad commit 3da9a4b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

content/rest/overview/resources-in-the-rest-api.md

+4
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,15 @@ $ curl -I {% data variables.product.api_url_pre %}/users/octocat
400400
> Date: Mon, 01 Jul 2013 17:27:06 GMT
401401
> x-ratelimit-limit: 60
402402
> x-ratelimit-remaining: 56
403+
> x-ratelimit-used: 4
403404
> x-ratelimit-reset: 1372700873
404405
```
405406
406407
Header Name | Description
407408
-----------|-----------|
408409
`x-ratelimit-limit` | The maximum number of requests you're permitted to make per hour.
409410
`x-ratelimit-remaining` | The number of requests remaining in the current rate limit window.
411+
`x-ratelimit-used` | The number of requests you've made in the current rate limit window.
410412
`x-ratelimit-reset` | The time at which the current rate limit window resets in [UTC epoch seconds](http://en.wikipedia.org/wiki/Unix_time).
411413
412414
If you need the time in a different format, any modern programming language can get the job done. For example, if you open up the console on your web browser, you can easily get the reset time as a JavaScript Date object.
@@ -423,6 +425,7 @@ If you exceed the rate limit, an error response returns:
423425
> Date: Tue, 20 Aug 2013 14:50:41 GMT
424426
> x-ratelimit-limit: 60
425427
> x-ratelimit-remaining: 0
428+
> x-ratelimit-used: 60
426429
> x-ratelimit-reset: 1377013266
427430
428431
> {
@@ -441,6 +444,7 @@ $ curl -u my_client_id:my_client_secret -I {% data variables.product.api_url_pre
441444
> Date: Mon, 01 Jul 2013 17:27:06 GMT
442445
> x-ratelimit-limit: 5000
443446
> x-ratelimit-remaining: 4966
447+
> x-ratelimit-used: 34
444448
> x-ratelimit-reset: 1372700873
445449
```
446450

0 commit comments

Comments
 (0)