'How to check my GitHub current rate limit?
The GitHub page https://developer.github.com/v3/rate_limit/ shows a rate limit status as example:
Response
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
X-RateLimit-Reset: 1372700873
{
"resources": {
"core": {
"limit": 5000,
"remaining": 4999,
"reset": 1372700873
},
"search": {
"limit": 30,
"remaining": 18,
"reset": 1372697452
}
},
"rate": {
"limit": 5000,
"remaining": 4999,
"reset": 1372700873
}
}
But only says I need to check this GET /rate_limit. But how to use that? Should I do a command like this bellow?
curl -i https://api.github.com/users/octocat GET /rate_limit
How would be this command?
Related questions:
Solution 1:[1]
Here's the Python equivalent using requests.
Replace TOKEN with your token. (I use the Github personal access token found here)
import requests
headers = {
'Authorization': 'token TOKEN',
}
response = requests.get('https://api.github.com/rate_limit', headers=headers)
print(response.text)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | openwonk |
