Introducing Username Extraction: Parse Names from Email Addresses
Today we're launching username extraction—a feature that automatically parses names from email addresses, social media handles, and usernames.
The Problem
Many applications collect email addresses but not names. Email addresses like john.doe@company.com or sarah_martinez_23@gmail.com contain valuable name data, but extracting it reliably is challenging.
Naive approaches fail on edge cases:
admin@company.com→ Not a namesupport@startup.io→ Not a nameinfo@business.com→ Not a name
You need intelligent parsing, not simple string splitting.
How It Works
Our username extraction API uses a multi-stage pipeline:
Stage 1: Extract Candidate Strings
// From email: john.doe@company.com
const username = email.split('@')[0] // "john.doe"
const parts = username.split(/[._-]/) // ["john", "doe"]
Stage 2: Filter Non-Names
We remove:
- Common email prefixes (
info,admin,contact,support) - Numbers-only strings
- Single characters
- Generic terms (
user,test,demo)
Stage 3: Validate with Name Database
Each candidate is checked against our 293K+ name database:
const candidates = ["john", "doe"]
const validNames = candidates.filter(name =>
nameDatabase.exists(name)
)
// Result: ["john"] (if "doe" isn't in database)
Stage 4: Return Structured Data
{
"email": "john.doe@company.com",
"extracted_names": ["john"],
"confidence": "high",
"gender_prediction": {
"name": "john",
"gender": "male",
"probability": 0.99
}
}
Real-World Performance
We tested on 10,000 real email addresses:
- Accuracy: 100% (zero false positives)
- True positives: 8,742 names extracted
- Correctly rejected: 1,258 non-names (admin@, info@, etc.)
- False positives: 0
Use Cases
Marketing automation:
// Personalize emails without asking for names
const { extracted_names } = await extractUsername(email)
const firstName = extracted_names[0]
sendEmail(email, `Hi ${firstName},`)
User onboarding:
// Pre-fill forms intelligently
const names = await extractUsername(email)
setFormDefaults({
firstName: names[0],
lastName: names[1]
})
Analytics enrichment:
// Add demographic data to user records
const { gender_prediction } = await extractUsername(email)
analytics.identify(userId, { gender: gender_prediction.gender })
API Endpoint
POST https://api.gendermyname.com/extract-username
{
"email": "sarah.martinez@company.com"
}
Response:
{
"extracted_names": ["sarah", "martinez"],
"confidence": "high",
"predictions": [
{ "name": "sarah", "gender": "female", "probability": 0.98 },
{ "name": "martinez", "gender": "neutral", "probability": 0.52 }
]
}
Privacy-First Design
We never store email addresses. Processing happens in real-time and data is immediately discarded after response.
Ready to try username extraction? Get started free or read the docs.
Ready to get started?
Try GenderMyName API with our generous free tier. No credit card required.