Predict, validate, and enrich business emails. Free tier supported, RapidAPI key for premium tiers at https://bit.ly/mailpattern.
npm install @axmion/mailpatternbash
npm install @axmion/mailpattern
`
π§ Usage Examples
`ts
import { predict, validate, industry } from "@axmion/mailpattern";
// ===== Free Tier (No API Key Needed) =====
try {
const freeRes = await predict({
domain: "hubspot.com",
first: "Megan",
last: "Turner"
});
console.log(freeRes);
} catch (error) {
console.error("Free Tier Test Error:", error);
}
// ===== Paid Tier (with RapidAPI Key) =====
try {
const paidRes = await predict(
{ domain: "hubspot.com" },
"YOUR_RAPIDAPI_KEY"
);
console.log(paidRes);
} catch (error) {
console.error("Paid Tier Test Error:", error);
}
// ===== Validate an Email =====
try {
const validation = await validate({ email: "megan@hubspot.com" });
console.log(validation);
} catch (error) {
console.error("Validate Email Error:", error);
}
// ===== Guess Company Industry =====
try {
const industryInfo = await industry({ domain: "solarpowerpros.com" });
console.log(industryInfo);
} catch (error) {
console.error("Guess Industry Error:", error);
}
`
π API Methods & Responses
1οΈβ£ predict()
Purpose: Predict the most likely email patterns for a given domain.
Uses heuristic scoring, DNS MX checks, and common corporate naming conventions.
$3
`json
{
"domain": "hubspot.com",
"patterns": [
"{first}.{last}@hubspot.com",
"{first}@hubspot.com",
"{f}{last}@hubspot.com"
],
"most_common": "sales@hubspot.com",
"confidence": 0.94
}
`
$3
`json
{
"domain": "hubspot.com",
"patterns": [
"{f}.{last}@hubspot.com",
"{first}.{last}@hubspot.com",
"{f}{last}@hubspot.com"
],
"most_common": "megan.turner@hubspot.com",
"confidence": 0.8,
"meta": {
"generatedAt": "2025-11-06T20:37:18.946Z",
"engine": "heuristic_v5",
"input": { "first": "Megan", "last": "Turner" },
"realizedExamples": [
"m.turner@hubspot.com",
"megan.turner@hubspot.com",
"mturner@hubspot.com",
"megan_turner@hubspot.com",
"megan-turner@hubspot.com"
],
"cached": false
}
}
`
2οΈβ£ validate()
Purpose: Validate whether an email address is likely deliverable.
Checks both:
- β
Syntax format (RFC-compliant)
- π¬ MX record presence (active mail server)
$3
`json
{
"email": "john.doe@hubspot.com",
"valid_format": true,
"domain": "hubspot.com",
"mx_found": true
}
`
Tip:
- Use predict() first to generate potential contacts β Then validate() to confirm deliverability.
3οΈβ£ industry()
Purpose: Guess a companyβs industry from its domain.
Useful for CRM enrichment, segmentation, and lead scoring.
$3
`ts
{
"domain": "solarpowerpros.com",
"industry": "Energy"
}
``