How to list all GitHub users?

31,343

Solution 1

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

Solution 2

GitHub Archive

https://www.githubarchive.org/

This project can be used to quickly get a dump of all usernames who have ever done anything public.

It exports the GitHub events API to a Google BigQuery dataset frequently.

The data format starting from 2015 is:

SELECT
    actor.login
FROM (
    TABLE_DATE_RANGE([githubarchive:day.events_],
        TIMESTAMP('2015-01-01'),
        TIMESTAMP('2015-01-02')
    ))
GROUP BY actor.login
ORDER BY actor.login

and there is more data starting from 2011-02-12 in a different format, should be easy to figure it out.

Downloading the data takes some fighting with Google BigQuery but is doable: How to download all data in a Google BigQuery dataset?

I have used a similar method to extract all GitHub commit emails at: https://github.com/cirosantilli/all-github-commit-emails

Solution 3

https://api.github.com/search/users?q={query}{&page,per_page,sort,order}

Please check https://developer.github.com/v3/search/ for more details

Solution 4

Note that since May 2013, you now can extract a lot more information from a repository.
See "File CRUD and repository statistics now available in the API"

We're using the repository statistics API to power our graphs, but we can't wait to see what others do with this information.

Starting today, these resources are available to you:

Solution 5

Team wise list the users:-

curl -H "Authorization: token [yours]" https://api.github.com/user/teams

With the following cmd, you can list all the users of github.

curl -H "Authorization: token fkslsml4442323wdsfsdf" https://api.github.com/orgs/cloudaws/members?page=1 | grep login >> github.txt
Share:
31,343
linjunhalida
Author by

linjunhalida

ubuntu, emacs, python, qt, c/c++, MFC, delphi, economics, gore, deathmetal...

Updated on July 09, 2022

Comments

  • linjunhalida
    linjunhalida almost 2 years

    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.
  • nulltoken
    nulltoken over 12 years
    @linjunhalida I've updated my answer with some proposals/workarounds.
  • Hemang
    Hemang about 4 years
    what are the values for sort and order ?