GitHub API: Get email addresses of all members of organization
You can use git repository instead! There are plenty of interesting information inside.
Try to run:
git shortlog -s -n -e
You will see the list of committers with email address.
Using GraphQL API v4, you don't have to call a request per user. The following will get members of an organization with their email
(if provided in public profile) :
{
organization(login: "my-org") {
membersWithRole(first: 100) {
totalCount
edges {
node {
login
name
email
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
Try it in the explorer
[edit 08/2020] Using membersWithRole
instead of deprecated members
field
After fetching the list of org members, fetch the info for each member using this API endpoint:
/users/:user
This will return the e-mail address of the user you have specified in your request URL.