Reputation: 71
What's the easiest way to get the 'most starred' repositories out of a given organization using the Github API? Is there a parameter option for this? I'm currently making a request to
http://api.github.com/orgs/ORGANIZATION/repos
and then filtering with my own code, but I wondered if the Github team implemented anything like that already.
Upvotes: 1
Views: 696
Reputation: 45433
You can use the search API, specify your org and sort by stars:
https://api.github.com/search/repositories?q=org:YOUR_ORGg&sort=stars&order=desc
Example: https://api.github.com/search/repositories?q=org:mui-org&sort=stars&order=desc
You can limit to the top X repo using per_page
(if X < 100). For instance to get the top 3 repo with most stars in the org mui-org
:
https://api.github.com/search/repositories?q=org:mui-org&sort=stars&order=desc&per_page=3
Upvotes: 2