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
components
4
lib
3
types
1
README.md
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
7/20/2025
Viewing readonly version of main branch: v117
View latest version
README.md

GitHub User Email Lookup

A Val Town project that finds email addresses associated with GitHub users by analyzing their public commit history using multiple methods. Now includes a Stargazer Email Lookup tool for analyzing repository stargazers in bulk.

šŸš€ Live Demos

  • Individual User Lookup: Main Tool - Analyze a single GitHub user
  • Stargazer Bulk Lookup: Stargazer Tool - Analyze top stargazers of any repository

šŸ“‹ Features

Individual User Analysis

  • Multiple Discovery Methods: Choose from 4 different search strategies
  • Smart Early Stopping: Default method stops after finding emails, saving API calls
  • Method Selection: Pick the best approach for your needs (speed vs. comprehensiveness)
  • Smart Filtering: Automatically filters out GitHub's noreply email addresses
  • Ranked Results: Shows emails ranked by frequency of use in commits
  • Debug Information: Collapsible metadata section with execution details

NEW: Stargazer Bulk Analysis

  • Repository Stargazer Lookup: Analyze top 10, 20, 50, or 100 stargazers of any GitHub repository
  • Rich User Profiles: Shows avatar, name, bio, follower count, and repository count for each stargazer
  • Primary Email Detection: Identifies the most-used email address based on commit frequency
  • Comprehensive Email Lists: Expandable details showing all discovered email addresses
  • Error Handling: Gracefully handles users with private profiles or no discoverable emails
  • Processing Metrics: Real-time feedback on success rates and processing time
  • Batch Processing: Efficiently processes multiple users with rate limiting

Common Features

  • View Source: Easy access to the code with a header button
  • Rate Limit Friendly: Includes delays and error handling to respect GitHub's API limits
  • Clean UI: Modern, responsive interface built with Hono JSX and Tailwind CSS
  • Modular Architecture: Well-organized codebase with separated concerns

šŸ” How It Works

The tool offers four different discovery methods to find email addresses:

Method 1: Events Only (getGithubUserEmailFromEvents)

  • Fetches the user's recent public events (up to 100)
  • Filters for PushEvent activities
  • Extracts email addresses from commit authors in those events
  • Pros: Fast, single API call, good for active users
  • Cons: Limited to recent public activity, may miss older emails

Method 2: Commits Only (getGithubUserEmailFromCommits)

  • Gets the user's 10 most recently updated repositories
  • Fetches the last 10 commits from each repository (authored by the user)
  • Extracts email addresses from commit metadata
  • Pros: More comprehensive, can find emails from older commits
  • Cons: Multiple API calls, slower execution

Method 3: Smart Combined (Default) (getGithubUserEmail)

  • Tries the Events method first
  • If emails are found, returns immediately (early stopping)
  • If no emails found, falls back to Commits method
  • Pros: Efficient, fast for active users, comprehensive fallback
  • Cons: May miss some emails if early stopping occurs

Method 4: Full Combined (getGithubUserEmailCombined)

  • Runs both Events and Commits methods simultaneously
  • Merges and deduplicates results from both sources
  • Aggregates commit counts across both methods
  • Pros: Most comprehensive, combines all available data
  • Cons: Uses maximum API calls, slower execution

šŸ› ļø Technical Implementation

File Structure

ā”œā”€ā”€ index.ts                    # Main HTTP endpoint with method selection
ā”œā”€ā”€ stargazer-emails.ts         # NEW: Stargazer email lookup tool
ā”œā”€ā”€ components/
│   ā”œā”€ā”€ Layout.tsx             # Main layout with view source button
│   ā”œā”€ā”€ SearchForm.tsx         # Search form with method selection
│   ā”œā”€ā”€ ResultsTable.tsx       # Results display with debug metadata
│   └── ErrorMessage.tsx       # Error display component
ā”œā”€ā”€ lib/
│   ā”œā”€ā”€ github-combined.ts     # Combined search strategies
│   ā”œā”€ā”€ github-events.ts       # Events-based email discovery
│   └── github-commits.ts      # Commits-based email discovery
ā”œā”€ā”€ types/
│   └── github.ts              # TypeScript interfaces
ā”œā”€ā”€ github-events.ts           # Legacy combined implementation
ā”œā”€ā”€ demo.tsx                   # Legacy demo interface
└── README.md                  # This file

Key Technologies

  • Runtime: Deno on Val Town
  • Framework: Hono for HTTP handling
  • UI: Server-side JSX with Tailwind CSS
  • API: GitHub REST API v4

Rate Limiting & Authentication

  • Uses Val Town's proxied fetch to help with rate limits
  • Supports optional GITHUB_TOKEN environment variable for higher rate limits
  • Includes 100ms delays between repository API calls
  • Graceful error handling for failed requests

šŸ”§ Setup & Configuration

Environment Variables (Optional)

GITHUB_TOKEN=your_github_personal_access_token

Adding a GitHub token increases your rate limit from 60 to 5,000 requests per hour.

Local Development

  1. Clone or fork this Val Town project
  2. Set up your GITHUB_TOKEN if desired
  3. The main entry point is index.ts (HTTP endpoint)
  4. Use the "View Source" button in the UI to access the code directly

šŸ“Š API Usage

Individual User Analysis

Direct Function Usage

import { getGithubUserEmail, // Smart combined (recommended) getGithubUserEmailCombined, // Full combined approach getGithubUserEmailFromEvents, // Events-only method getGithubUserEmailFromCommits // Commits-only method } from "./lib/github-combined.ts"; // Get emails using smart combined approach (default) const emails = await getGithubUserEmail("username"); // Get emails using full combined approach const allEmails = await getGithubUserEmailCombined("username"); // Get emails from events only const eventEmails = await getGithubUserEmailFromEvents("username"); // Get emails from commits only const commitEmails = await getGithubUserEmailFromCommits("username"); // Results format interface EmailOccurrence { username: string; // Author name from commits email: string; // Email address commitCount: number; // Number of commits using this email }

HTTP API

# Web interface with method selection GET /?username=octocat&method=combined # Available methods: # - combined (default): Smart combined with early stopping # - events: Events only # - commits: Commits only # - full-combined: Full combined approach # Returns HTML page with results and debug information

NEW: Stargazer Bulk Analysis

HTTP API

# Web interface for stargazer analysis GET /stargazer-emails?repo=owner/repo&count=20 # Parameters: # - repo: Repository in format "owner/repo" (e.g., "microsoft/vscode") # - count: Number of stargazers to analyze (10, 20, 50, or 100) # Returns HTML page with: # - User profiles (avatar, name, bio, stats) # - Primary email (most commits) # - All discovered emails (expandable) # - Processing metrics and error handling

Example Usage

# Analyze top 20 stargazers of VS Code GET /stargazer-emails?repo=microsoft/vscode&count=20 # Analyze top 50 stargazers of n8n GET /stargazer-emails?repo=n8n-io/n8n&count=50

šŸ”§ New Features

Method Selection

Choose from four different discovery strategies:

  • Smart Combined (Default): Efficient with early stopping
  • Events Only: Fast, single API call
  • Commits Only: Comprehensive repository scanning
  • Full Combined: Maximum coverage, all methods

Comprehensive Debug Information

Detailed debug section below results table with:

  • Summary Metrics: Quick overview of processing results
  • Raw API Responses: Complete GitHub API responses with status codes
  • All Events: Full event data from GitHub's events API (up to 100 events)
  • Push Events: Filtered push events with complete commit payloads
  • Repository Details: Information about processed repositories
  • Commit Processing: Step-by-step commit analysis with author details
  • Email Filtering: Before/after views of noreply email filtering
  • API Call Tracking: URLs, status codes, and timestamps for every API call
  • Error Logging: Detailed error messages and stack traces
  • Performance Metrics: Execution times and resource usage
  • Collapsible Interface: Clean, expandable sections for easy navigation

View Source Integration

  • Header button links directly to Val Town source code
  • Easy access for developers and contributors
  • Seamless integration with Val Town's development workflow

🚨 Limitations & Considerations

Privacy & Ethics

  • Only analyzes public repositories and commits
  • Respects users who have configured private emails
  • Filters out GitHub's @users.noreply.github.com addresses
  • Use responsibly and respect privacy

Technical Limitations

  • GitHub API rate limits (60/hour without token, 5000/hour with token)
  • Only finds emails from commits where the user is the author
  • May miss emails from private repositories or private commits
  • Results depend on user's commit history and email configuration

Accuracy Notes

  • Email addresses found may be outdated
  • Users can configure different emails for different repositories
  • Some commits may use organization or work emails
  • Results are ranked by frequency, not recency

šŸ”„ Error Handling

The application handles various error scenarios:

  • Invalid usernames
  • API rate limit exceeded
  • Network timeouts
  • Private or empty repositories
  • Malformed API responses

Errors are logged to console and displayed to users with helpful messages.

šŸ¤ Contributing

This is a Val Town project. To contribute:

  1. Fork the project in Val Town
  2. Make your changes
  3. Test thoroughly
  4. Share your improvements!

šŸ“„ License

This project is open source and available under standard Val Town terms.

āš ļø Disclaimer

This tool is for educational and legitimate research purposes only. Always respect privacy, follow GitHub's Terms of Service, and use responsibly. The authors are not responsible for misuse of this tool.


šŸ”„ Recent Updates

Version 2.0 Features

  • Enhanced Method Selection: Four different discovery strategies with clear descriptions
  • Comprehensive Debug Information: Detailed debug system with complete API data and processing details
  • Raw Data Access: Complete API responses, events, commits, and processing information
  • Performance Monitoring: Detailed execution metrics and API call tracking
  • Error Diagnostics: Complete error logging and troubleshooting information
  • Clean Interface: Streamlined UI with comprehensive debug data in collapsible sections
  • View Source Integration: Direct link to Val Town source code in the header
  • Developer Tools: Extensive debugging capabilities for analysis and optimization
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.