Github V3 API : list contributors

I submitted my question to the Github API's support, and they made me an amazingly detailed answer. Here it is (shortened):

It looks like your missing commits were authored with an email address not linked to your GitHub profile. You can find the missing email by adding ".patch" to the end of a commit URL, then looking at the "From:" line. Once you have the email, you can link it to your profile by following these instructions:

https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user

After you link your email to your account, any valid missing contributions will be backfilled and new ones should show up automatically.

For example, when I check out the Projet-merou's commit history:

https://github.com/jxw1102/Projet-merou/commits/master

When I choose the latest commit with your GitHub username as its author and add .patch to the URL like so:

https://github.com/jxw1102/Projet-merou/commit/f5bf30243ab99efc40802d3d78c08e49839ec9c9.patch

I see this on the second line:

From: Dicee [email protected]

Adding that email will backfill any missing valid contributions. After you do that, calling the API should show the expected result.

API Endpoints: Contributors and Contributors Statistics

I have written up some notes about each endpoint below. Let me know if you have any questions!

/repos/:owner/:repo/contributors

When you call GET /repos/:owner/:repo/contributors, the GitHub API will list contributors to the specified repository, sorted by the number of commits per contributor in descending order. Contributors data is cached for performance reasons. This endpoint may return information that is a few hours old. Git contributors are identified by author email address. This API attempts to group contribution counts by GitHub user, across all of their associated email addresses. For performance reasons, only the first 500 author email addresses in the repository will be linked to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.

If you call this endpoint with anon=1 specified, the API will return a count of all commits on the default branch, including commits that aren't associated with any user on GitHub. Here's an example:

https://api.github.com/repos/jxw1102/Projet-merou/contributors?anon=1

When anon=1 isn't specified like this:

https://api.github.com/repos/jxw1102/Projet-merou/contributors

notice how the results only show commits associated with some GitHub user and doesn't count merge commits.

/repos/:owner/:repo/stats/contributors

When you call GET /repos/:owner/:repo/stats/contributors, the GitHub API will return the contributors list with additions, deletions, and commit counts. The total denotes the total number of commits authored by the contributor.

Does that help?

All the best,
Francis
@francisfuzz
GitHub Support