Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all GitHub users?

Tags:

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.
like image 965
linjunhalida Avatar asked Sep 07 '11 06:09

linjunhalida


People also ask

What is the code to retrieve all the users in git?

The answer is "/users/:user/repo", but I have all the code that does this in an open-source project that you can use to stand up a web-application on a server.

What is API GitHub Com users?

The Users API allows to get public and private information about the authenticated user. Users. Get the authenticated user. Update the authenticated user. List users.


1 Answers

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)

  • syntax: repos/show/:user/:repo/collaborators [GET]
  • example: https://api.github.com/repos/git/git/collaborators

Contributors (authors of, at least, one commit)

  • syntax: repos/show/:user/:repo/contributors [GET]
  • example: https://api.github.com/repos/git/git/contributors

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)

  • syntax: /api/v2/xml/user/email/:email [GET]
  • example: https://github.com/api/v2/xml/user/email/[email protected]

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)

  • syntax: /api/v2/json/repos/search/:here+go+your+keywords [GET]
  • example: https://github.com/api/v2/json/repos/search/stackoverflow

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

like image 184
nulltoken Avatar answered Oct 18 '22 13:10

nulltoken