Disposable Email Detection API
API to check if email addresses are disposable and validate their MX records
Endpoints
GET /api/detect
Batch email validation via query parameters
Parameters:
- emails - Comma-separated list of email addresses to check
Example:
/api/[email protected],[email protected]
POST /api/detect
Single or batch email validation via JSON body
Single email body:
{"email": "[email protected]"}
Batch emails body:
{"emails": ["[email protected]", "[email protected]"]}
GET /health
Health check endpoint - Returns API status and timestamp
GET /api/cache-info
Get information about the disposable domains cache
Returns cache size, last update time, age, and staleness status
POST /api/refresh-cache
Force refresh the disposable domains cache from GitHub
Useful for manual updates or when cache becomes stale
Response Format
Single Email Response
- email - Original email address
- isDisposable - Boolean, true if disposable email
- hasValidMx - Boolean, true if domain has valid MX records
- domain - Email domain
- isValid - Boolean, true if email format is valid
- mxRecords - Array of MX records (optional)
- error - Error message if any (optional)
Batch Email Response
- emails - Array of email check results
- summary - Object containing:
- total - Total number of emails checked
- disposable - Number of disposable emails
- invalid - Number of invalid emails
- validMx - Number of emails with valid MX records