Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub API: Repositories Contributed To

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 five, which are all you can get on the web apparently.

like image 639
outoftime Avatar asked Dec 21 '13 01:12

outoftime


People also ask

What counts as a contribution on GitHub?

Whenever you commit to a project's default branch or the gh-pages branch, open an issue, or propose a Pull Request, we'll count that as a contribution. Repositories are sorted by your recent impact. A commit today is worth more than a commit last week.

What is GitHub API used for?

Github APIs( or Github ReST APIs) are the APIs that you can use to interact with GitHub. They allow you to create and manage repositories, branches, issues, pull requests, and many more. For fetching publicly available information (like public repositories, user profiles, etc.), you can call the API.

How do I see contributors in GitHub repository?

On GitHub.com, navigate to the main page of the repository. Under your repository name, click Insights. In the left sidebar, click Contributors. Optionally, to view contributors during a specific time period, click, then drag until the time period is selected.

What does GitHub API return?

GitHub's API, by default, is set to return the first 30 repos for that particular user in alphabetical order.


1 Answers

With GraphQL API v4, you can now get these contributed repo using :

{   viewer {     repositoriesContributedTo(first: 100, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {       totalCount       nodes {         nameWithOwner       }       pageInfo {         endCursor         hasNextPage       }     }   } } 

Try it in the explorer

If you have more than 100 contributed repo (including yours), you will have to go through pagination specifying after: "END_CURSOR_VALUE" in repositoriesContributedTo for the next request.

like image 57
Bertrand Martel Avatar answered Sep 24 '22 02:09

Bertrand Martel