Dev
Dev

Reputation: 13753

How to use Github API to get all users of a Repository?

I can see all the members of a repository using Github.

For example: Members of Kundera.

Is there any way to get this list using Github API?

Upvotes: 2

Views: 921

Answers (2)

Dev
Dev

Reputation: 13753

I created a github project for getting User Details (name, company, location, email) of users (Subscribers, Stargazers, those who Forks) of a Git Repository.

All you need to provide Organization Name, Repository Name.

List<UserDetail> userDetailList = GitUsersDetails.getUserDetails(ORG_NAME, REPO_NAME, UserType.SUBSCRIBERS);

UserDetail Entity:

public class UserDetail {

    private String name;

    private String company;

    private String location;

    private String email;

   // Getters & Setters
}

check project here.

Upvotes: 1

Chris
Chris

Reputation: 136948

It looks like that "members" view really shows repository forks. You can use the list forks API endpoint to see them, e.g.

curl https://api.github.com/repos/impetus-opensource/Kundera/forks

Upvotes: 1

Related Questions