Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ghapi.page.paged does not respect rate limits

Open
#110 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
github, python
Domain
api

Research direction

Start with the ghapi.page.paged entry point and the request flow shown in ghapi/core.py, then inspect fastcore/net.py where HTTP errors are raised. Reproduce the search.code example and trace the rate-limit headers and pagination behavior. Done means the example can paginate without repeatedly receiving HTTP 403 responses while respecting the reported rate limits.

Written by the indexing model from the issue text.

Description

Calling it almost always results in HTTP403ForbiddenError: HTTP Error 403: Forbidden

for result in ghapi.page.paged(gh_api.search.code, q=f"filename:component.yaml repo:Ark-kun/pipeline_components"):
    print(len(result["items"]))
opt/conda/lib/python3.7/site-packages/ghapi/core.py in __call__(self, path, verb, headers, route, query, data)
    107             for k,v in route.items(): route[k] = quote(str(route[k]))
    108         res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, debug=self.debug, return_headers=True,
--> 109                                      route=route or None, query=query or None, data=data or None)
    110         if 'X-RateLimit-Remaining' in self.recv_hdrs:
    111             newlim = self.recv_hdrs['X-RateLimit-Remaining']

/opt/conda/lib/python3.7/site-packages/fastcore/net.py in urlsend(url, verb, headers, route, query, data, json_data, return_json, return_headers, debug)
    210         return urlread(req, decode=False, return_json=False, return_headers=return_headers)
    211 
--> 212     return urlread(req, return_json=return_json, return_headers=return_headers)
    213 
    214 # Cell

/opt/conda/lib/python3.7/site-packages/fastcore/net.py in urlread(url, data, headers, decode, return_json, return_headers, timeout, **kwargs)
    111         with urlopen(url, data=data, headers=headers, timeout=timeout, **kwargs) as u: res,hdrs = u.read(),u.headers
    112     except HTTPError as e:
--> 113         if 400 <= e.code < 500: raise ExceptionsHTTP[e.code](e.url, e.hdrs, e.fp) from None
    114         else: raise
    115 

HTTP403ForbiddenError: HTTP Error 403: Forbidden
Dominant language
Python
Stars
687
Forks
69
Avg merge
1m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AnswerDotAI/ghapi

All issues in AnswerDotAI/ghapi

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.