How to list all GitHub users?

linjunhalida picture linjunhalida · Sep 7, 2011 · Viewed 24k times · Source

I'm working on a site, need to crawl all user information (at least the user on our site) from GitHub. I searched GitHub API, and found no answer.

So is there any way I can do this job? I only have the users emails. (I can check user by compare the email hash with gravatar URL)

  1. I had send email to GitHub support, and got no answer currently.
  2. I only need know the usernames, I can use GitHub API to get other informations.

Answer

nulltoken picture nulltoken · Dec 20, 2011

As described here you may rely on those two following APIs to retrieve a JSON formatted output. As requested, both of them provide the gravatar URL.

Collaborators (members of the organization on the project)

Contributors (authors of, at least, one commit)


UPDATE:

The previous API methods requires that you start from a known repository. The two following proposals try to work around this constraint. They rely on the previous version of the API (v2)

Query by email (in your question, you state "I only have the users emails.". Provided the users agreed to publish them you should be able to retreive some information about the user using the email as a query parameter)

Search for repositories (given some keywords (language, stack, ...) retrieve a list of repositories. Then, for each one, using the two first proposals, list their collaborators and/or contributors)

Note: Make sure that intended usage of the API is in concordance with GitHub Terms of service