18
votes

through the GitHub API, is it possible to get the number of open pull requests for a repository without downloading all the extra data related to the pull requests themselves?

For example, when you get the list of your repositories, for each of the repo you can see the number of open issues. Is there a similar property for open pull requests?

1
My first answer was wrong as the search api keywords only match the content of the issue and the test I did was against an issue that contained the word "pull" in its description. So there is no way to filter for pull requests only. I ended up just using the Pull Requests API for each repo for the moment: developer.github.com/v3/pulls/#list-pull-requests not ideal as I just want to know the count of pull requests.Simone Vicentini
I would change the title: .."get count of open pull requests"... As for the total number of pull requests, with indeed an approximation, I used this: api.github.com/repos ... &state=all&page=1&per_page=1 . I mean I guess the english is ok (I am not EN speaker), but my search for total number of landed here ;)mariotti

1 Answers

7
votes

You might also take a look at the search api https://developer.github.com/v3/search/#search-issues. Looks like you can filter on type and probably also on closed or not :)

As suggested by codea in the comments:

https://api.github.com/search/issues?q=+type:pr+user:StackExchange&sort=created&order=asc