Reputation: 91
i want get get all pull requests of all my repos using github api v3.
I have tried the following issue endpoint:
https://api.github.com/user/issues?filter=all&state=all&sort=create&direction=desc
This will return all issues including the pull requests. but is there any way of getting just the pull requests (not all issues) using page parameters. I.e. I want to get the first 10 pull requests and then next 10 pull requests using the "page" and "per_page" parameters. How can i do this?
Upvotes: 1
Views: 346
Reputation: 29
If I understand the question correctly, what you want are the pull requests initiated by you (I guess that's what you mean by pull request of repos of my github account
Please add your username instead of mine (swarajpure) and you'll get your PRs:
https://api.github.com/search/issues?q=user:swarajpure+type:pr&per_page=10&page=1
This by default will show first 10 PRs. To see next 10 PRs, please enter page=2
and so on.
For more details: https://swarajpure.medium.com/github-apis-fetching-pull-requests-issues-by-a-user-organisation-repository-84ae934a106b
Upvotes: 1
Reputation: 1316
You can use the type:pr
to search only the pull requests. i.e. https://api.github.com/search/issues?q=type=pr&state=all&sort=create&direction=desc&page=1&per_page=10
Upvotes: 2