GithubAPI: Get repositories a user has ever commit

2020-07-27 03:44发布

问题:

Within the scope of the research project ideally I need for any two users find the repositories that they have in their shared history of public development, i.e. they have committed in the same repos.

I wonder if it is possible to get the list of repositories that were ever been touched by a given user.

In Github-API I can see only:

  1. GET /repos/:owner/:repo/contributors
  2. GET /users/:user/repos
  3. GET /users/:user/events

First gives only the contributors for a given :repo repository Second only gives a :user's repos Third was promising, but events are limited to 300

Is there any way to get all the repositories a user has ever worked with on Github without dumping all 3 millions repos?

回答1:

You could try using the github search api: https://developer.github.com/v3/search/#search-code

one catch is that you have to specify a query, so for example if I lookup my name with the query 'def' you would get: https://api.github.com/search/code?q=def+user:manuelvanrijn