Email Checker API
REST API for email validation with comprehensive validation checks and rate limiting
Base URL & Authentication
Base URL
https://mail7.net
Authentication
No authentication required. Public API with rate limiting.
Rate Limiting
Rate Limit: 5 requests per minute
Exceeding the rate limit will return HTTP 429 (Too Many Requests) with a retry-after header.
Single Email Validation
Endpoint
POST /api/validate-single
Request Body
{
"email": "[email protected]"
}
Response
{
"email": "[email protected]",
"valid": true,
"formatValid": true,
"mxValid": true,
"smtpValid": true,
"error": null
}
Example with cURL
curl -X POST https://mail7.net/api/validate-single \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'
Bulk Email Validation
Endpoint
POST /api/validate-bulk
Request (Form Data)
Send either a file or text list:
File Upload
curl -X POST https://mail7.net/api/validate-bulk \
-F "[email protected]"
Text List
curl -X POST https://mail7.net/api/validate-bulk \
-F "[email protected]
[email protected]
[email protected]"
Response
{
"total": 3,
"results": [
{
"email": "[email protected]",
"valid": true,
"formatValid": true,
"mxValid": true,
"smtpValid": true,
"error": null
},
{
"email": "[email protected]",
"valid": false,
"formatValid": false,
"mxValid": false,
"smtpValid": false,
"error": "Invalid email format"
}
]
}
SPF Record Check
Endpoint
GET /api/spf-check/{domain}
Parameters
domain
string (path parameter)
The domain name to check SPF record for (e.g., "example.com")
Response
{
"domain": "example.com",
"is_valid": true,
"spf_record": "v=spf1 include:_spf.google.com ~all",
"dns_lookups": 1,
"syntax_valid": true,
"has_soft_fail": true,
"has_hard_fail": false,
"issues": [
{
"type": "warning",
"message": "High DNS Lookup Count",
"description": "SPF record causes 8 DNS lookups (close to limit of 10)",
"recommendation": "Consider optimizing your SPF record to reduce DNS lookups",
"severity": 2
}
],
"recommendations": [
"Your SPF record is properly formatted and follows best practices.",
"Consider implementing DKIM and DMARC alongside SPF for complete email authentication."
],
"timestamp": "2025-01-01T12:00:00Z"
}
Example with cURL
curl -X GET https://mail7.net/api/spf-check/example.com
Response Fields
Basic Information
- domain: The domain that was checked
- is_valid: Overall validity of the SPF record
- spf_record: The actual SPF record found in DNS
- timestamp: When the check was performed
Technical Details
- dns_lookups: Number of DNS queries required (max 10)
- syntax_valid: Whether the SPF syntax is correct
- has_soft_fail: Presence of ~all mechanism
- has_hard_fail: Presence of -all mechanism
Issues & Recommendations
- issues: Array of detected problems with severity levels
- recommendations: Actionable advice to fix issues
Health Check
Endpoint
GET /health
Response
{
"status": "healthy",
"timestamp": "2025-01-15T10:30:00.123456"
}
Example
curl https://mail7.net/health
Error Responses
Rate Limit Exceeded (429)
{
"detail": "Rate limit exceeded. Try again in 60 seconds.",
"retry_after": 60
}
Invalid Request (400)
{
"detail": "Invalid email format"
}
Server Error (500)
{
"detail": "Internal server error"
}
HTTP Status Codes
200
Success
400
Bad Request
429
Too Many Requests
500
Internal Server Error
503
Service Unavailable
SDK Examples
JavaScript/Node.js
// Single email validation
const response = await fetch('https://mail7.net/api/validate-single', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: '[email protected]'
})
});
const result = await response.json();
console.log(result);
// Bulk validation
const formData = new FormData();
formData.append('emails', '[email protected]\[email protected]');
const bulkResponse = await fetch('https://mail7.net/api/validate-bulk', {
method: 'POST',
body: formData
});
const bulkResult = await bulkResponse.json();
console.log(bulkResult);
// SPF record check
const spfResponse = await fetch('https://mail7.net/api/spf-check/example.com');
const spfResult = await spfResponse.json();
console.log(spfResult);
Python
import requests
import json
# Single email validation
response = requests.post('https://mail7.net/api/validate-single',
json={'email': '[email protected]'})
result = response.json()
print(result)
# Bulk validation
emails = "[email protected]\[email protected]"
files = {'emails': (None, emails)}
response = requests.post('https://mail7.net/api/validate-bulk', files=files)
result = response.json()
print(result)
# SPF record check
spf_response = requests.get('https://mail7.net/api/spf-check/example.com')
spf_result = spf_response.json()
print(spf_result)
PHP
// Single email validation
$data = ['email' => '[email protected]'];
$options = [
'http' => [
'header' => "Content-type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data)
]
];
$context = stream_context_create($options);
$result = file_get_contents('https://mail7.net/api/validate-single', false, $context);
$response = json_decode($result, true);
print_r($response);
// SPF record check
$spf_context = stream_context_create([
'http' => [
'method' => 'GET'
]
]);
$spf_result = file_get_contents('https://mail7.net/api/spf-check/example.com', false, $spf_context);
$spf_response = json_decode($spf_result, true);
print_r($spf_response);