Skip to content
Get started

Get best email addresses by GitHub username

POST/users/best-email/by-login

Fetch the best email address for GitHub users by their usernames (login). Uses intelligent selection to prioritize personal emails over work emails and verifies domain validity. Returns the best email plus all other email candidates. Supports batch requests (1-100 logins). Requires RAW service. Credits: 1 per result returned.

Body ParametersExpand Collapse
logins: array of string

Array of GitHub usernames (1-100)

signals: optional object { emailBody, emailSubject, reasonForEmailNaturalLanguage, 2 more }

Optional signal data for tracking email context (body, subject, sender)

emailBody: optional string

Email body content for tracking

emailSubject: optional string

Email subject for tracking

reasonForEmailNaturalLanguage: optional string

Provide the reason for emailing the user in natural language

repoReasonForEmail: optional string

Provide the repo ID for why you are emailing the user

sender: optional string

Sender identifier for tracking

ReturnsExpand Collapse
count: number

Number of results returned

results: array of object { bestEmail, githubId, login, otherCandidates }

Array of best email results

bestEmail: string

Best email address, or null if none available

githubId: string

GitHub node ID

login: string

GitHub username

otherCandidates: array of string

Other email addresses that were not selected as the best email

Get best email addresses by GitHub username
curl https://api.bountylab.io/v2/users/best-email/by-login \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $BOUNTYLAB_API_KEY" \
    -d '{
          "logins": [
            "octocat",
            "torvalds"
          ]
        }'
{
  "count": 2,
  "results": [
    {
      "bestEmail": "octocat@gmail.com",
      "githubId": "MDQ6VXNlcjU4MzIzMQ==",
      "login": "octocat",
      "otherCandidates": [
        "octocat@github.com",
        "octocat@work.com"
      ]
    }
  ]
}
Returns Examples
{
  "count": 2,
  "results": [
    {
      "bestEmail": "octocat@gmail.com",
      "githubId": "MDQ6VXNlcjU4MzIzMQ==",
      "login": "octocat",
      "otherCandidates": [
        "octocat@github.com",
        "octocat@work.com"
      ]
    }
  ]
}