REST API only returns a maximum of 30000 issue comments and no PR comments per repo #183392
-
Select Topic AreaQuestion BodyI need to fetch all issue and pull request comments for a couple of repositories using the REST API. However, only a maximum of 30000 issue comments seem to be available per repo when using this endpoint. Is there a specific reason or any workaround for this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
This is mostly expected behavior and not a bug in the API. GitHub’s REST API has some practical limits when listing very large datasets, even if you don’t hit a rate limit. When a repository has a huge number of comments, the “list” endpoints don’t always let you paginate forever, which is why you often see a ceiling around ~30,000 issue comments in practice. For pull request comments, there’s also a common confusion. GitHub has two different types of PR comments: So if you’re calling /pulls/comments and getting no data or errors, it’s usually because many PRs simply don’t have review/diff comments. Most PR discussion lives in the issue comments endpoint instead. Workaround / best approach: Fetch issue comments to get comments from both issues and PR discussions. In short: you’re not doing anything wrong, this is just how GitHub structures and limits comment data in the REST API. |
Beta Was this translation helpful? Give feedback.
This is mostly expected behavior and not a bug in the API.
GitHub’s REST API has some practical limits when listing very large datasets, even if you don’t hit a rate limit. When a repository has a huge number of comments, the “list” endpoints don’t always let you paginate forever, which is why you often see a ceiling around ~30,000 issue comments in practice.
For pull request comments, there’s also a common confusion. GitHub has two different types of PR comments:
Review comments on code diffs → returned by
/repos/{owner}/{repo}/pulls/comments
Regular discussion comments on a PR → these are actually issue comments, returned by
/repos/{owner}/{repo}/issues/comments
So if you’re calling /pu…