linjunhalida
linjunhalida

Reputation: 4655

How to list all GitHub users?

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.

Upvotes: 21

Views: 38925

Answers (6)

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

Upvotes: 8

Francesco Gabbrielli
Francesco Gabbrielli

Reputation: 369

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

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

Upvotes: 5

user2330845
user2330845

Reputation: 41

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

Upvotes: 2

nulltoken
nulltoken

Reputation: 67589

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

Upvotes: 15

VonC
VonC

Reputation: 1323115

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:

Upvotes: 2

Saurabh Kumar
Saurabh Kumar

Reputation: 5945

You probably like to checkout this post - https://github.com/blog/643-contributors

The api call can be made like this:

http://github.com/api/v2/json/repos/show/<user>/<repository-name>/contributors

Upvotes: 0

Related Questions