Email Checker API

REST API for email validation with comprehensive validation checks and rate limiting

Base URL & Authentication

Base URL

https://mail7.net

Authentication - API is available on paid plans

Programmatic access needs an API key, which comes with any paid plan. This lets us guarantee rate limits, uptime, and support for automated use. Pass your key in the X-API-Key header:

X-API-Key: mk_live_your_key_here

Prefer not to code? The web tools - single and bulk checks - stay free.

Rate Limiting

Rate Limit: 5 requests per minute per IP

Exceeding the rate limit will return HTTP 429 (Too Many Requests) with a retry-after header indicating when to try again.

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,
  "status": "Valid",
  "error": null,
  "details": "Email validation result: Valid - Email exists - accepted by alt3.gmail-smtp-in.l.google.com",
  "mx_servers": [
    "alt3.gmail-smtp-in.l.google.com",
    "alt1.gmail-smtp-in.l.google.com",
    "alt4.gmail-smtp-in.l.google.com",
    "alt2.gmail-smtp-in.l.google.com",
    "gmail-smtp-in.l.google.com"
  ],
  "smtp_message": "Email exists - accepted by alt3.gmail-smtp-in.l.google.com",
  "is_disposable": false
}

Response Fields

Basic Validation
  • email: The email address that was validated
  • valid: true = deliverable, false = does not exist, null = Unknown (could not be verified - see status). Do not treat Unknown as invalid.
  • formatValid: Whether the email format is correct (true/false)
  • mxValid: Whether MX records exist for the domain (true/false)
  • smtpValid: Whether the email exists on the server (true/false)
Status & Details
  • status: Human-readable status: "Valid", "Not Valid", or "Unknown" (address exists but cannot be reliably verified - e.g. disposable, catch-all, or greylisted)
  • error: Error message if validation failed (null if successful)
  • details: Detailed validation result description
Technical Details
  • mx_servers: Array of MX server hostnames
  • smtp_message: SMTP server response message
  • is_disposable: Whether the email is from a disposable email service (true/false)

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,
      "status": "Valid",
      "error": null,
      "details": "Email validation result: Valid - Email exists - accepted by alt3.gmail-smtp-in.l.google.com",
      "mx_servers": [
        "alt3.gmail-smtp-in.l.google.com",
        "alt1.gmail-smtp-in.l.google.com"
      ],
      "smtp_message": "Email exists - accepted by alt3.gmail-smtp-in.l.google.com",
      "is_disposable": false
    },
    {
      "email": "[email protected]",
      "valid": false,
      "formatValid": false,
      "mxValid": false,
      "smtpValid": false,
      "status": "Invalid",
      "error": "Invalid email format",
      "details": "Email validation result: Invalid - Invalid email format",
      "mx_servers": [],
      "smtp_message": null,
      "is_disposable": false
    }
  ]
}

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. Maximum 5 requests per minute. Try again in 45 seconds.",
  "headers": {
    "Retry-After": "45",
    "X-RateLimit-Remaining": "0"
  }
}

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);