GitHub API: Repositories Contributed To

后端 未结 10 1758
耶瑟儿~
耶瑟儿~ 2020-12-07 09:45

Is there a way to get access to the data in the “Repositories contributed to” module on GitHub profile pages via the GitHub API? Ideally the entire list, not just the top fi

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 10:18

    You can use Search provided by GitHub API. Your query should look something like this:

    https://api.github.com/search/repositories?q=%20+fork:true+user:username

    fork parameter set to true ensures that you query all user's repos, forked included.

    However, if you want to make sure the user not only forked repository, but contributed to it, you should iterate through every repo you got with 'search' request and check if user is within them. Which quite sucks, because github returns only 100 contributors and there is no solution for that...

提交回复
热议问题