Get best email addresses by GitHub username
user_emails.best_email_by_login(UserEmailBestEmailByLoginParams**kwargs) -> UserEmailBestEmailByLoginResponse
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.
Parameters
Array of GitHub usernames (1-100)
Returns
Get best email addresses by GitHub username
import os
from bountylab import Bountylab
client = Bountylab(
api_key=os.environ.get("BOUNTYLAB_API_KEY"), # This is the default and can be omitted
)
response = client.user_emails.best_email_by_login(
logins=["octocat", "torvalds"],
)
print(response.count){
"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"
]
}
]
}