FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
stevekrouse

stevekrouse

github-user-email

Get the email address for GitHub username
Public
Like
5
github-user-email
Home
Code
4
README.md
commits.ts
events.ts
examples.ts
Branches
3
Pull requests
Remixes
History
Environment variables
1
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
8/1/2025
Viewing readonly version of main branch: v183
View latest version
README.md

Get Email Address from a GitHub Username

You can often find the email address for GitHub users in the git commit history. In the past, I would clone their repos and use git log to pull it out, but recently I learned that you can do it fairly easily via the GitHub API.

emailsFromEvents(username: string)

This function pulls the user's recent public events.

Create val
import { emailsFromEvents } from "https://esm.town/v/stevekrouse/github-user-email/events.ts"; const emails = await emailsFromEvents("stevekrouse"); console.log(emails); // [ "steveykrouse@gmail.com" ]

The limitation is that this endpoint only gets events from the last 30 days, so if the user hasn't committed in the last month, you won't get any results from this method. (Coming soon: a )

Rate limits

The GitHub API rate limits unauthenticated requests to 60 per hour per IP address. As a quick workaround, Val Town provides an IP-randomizer fetch proxy that makes it easy to get around these limits. These functions use that proxy by default. However, if you're using these functions at scale, please use a GITHUB_TOKEN to be a good GitHub citizen.

FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.