Skip to content

Commit

Permalink
feat: tell me my remaining api calls by checking ratelimit
Browse files Browse the repository at this point in the history
  • Loading branch information
sarina committed Dec 7, 2022
1 parent 4ec2b5a commit d33fd9c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ratelimit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
what limit do i have left
"""
import json
import requests

from github_helpers import get_github_headers

gh_headers = get_github_headers()
response = requests.get('https://api.github.com/rate_limit', headers=gh_headers)

rjson = response.json()
print(json.dumps(rjson, indent=3, sort_keys=True))

0 comments on commit d33fd9c

Please sign in to comment.