DEV Community

Alexey D
Alexey D

Posted on

Email Validation API: Detect Disposable Emails and Invalid MX Records (Free)

Building a registration or newsletter form? Here is how to validate emails properly — catch typos, disposable addresses, and invalid MX records before they pollute your database.

Why Simple Regex Fails

A regex like ^[^@]+@[^@]+\.[^@]+$ will pass:

  • user@fakemx.xyz (no mail server exists)
  • test@mailinator.com (disposable, will be abandoned)
  • plainaddress on some implementations

You need real MX record lookup + disposable domain detection.

Email Validator Pro API

RapidAPI link: https://rapidapi.com/adunaev8419/api/email-validator-pro11

Returns: MX validity, disposable flag, quality score (0-100), format check.

Free tier: 30 requests/hour.

Python Example

import requests

url = "https://email-validator-pro11.p.rapidapi.com/validate"
headers = {
    "X-RapidAPI-Key": "YOUR_KEY",
    "Content-Type": "application/json"
}

r = requests.post(url, json={"email": "user@gmail.com"}, headers=headers)
print(r.json())
# {
#   "is_valid": true,
#   "mx_valid": true,
#   "is_disposable": false,
#   "quality_score": 100,
#   "format_valid": true
# }

# Try a disposable address
r2 = requests.post(url, json={"email": "test@mailinator.com"}, headers=headers)
print(r2.json())
# {"is_valid": false, "is_disposable": true, "quality_score": 0}
Enter fullscreen mode Exit fullscreen mode

JavaScript Example

const res = await fetch("https://email-validator-pro11.p.rapidapi.com/validate", {
  method: "POST",
  headers: {
    "X-RapidAPI-Key": "YOUR_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ email: "user@example.com" })
});
const data = await res.json();
if (!data.is_valid || data.is_disposable) {
  console.log("Reject this email");
}
Enter fullscreen mode Exit fullscreen mode

Batch Validation — Clean Your Entire List

emails = ["user@gmail.com", "fake@mailinator.com", "bad-format", "contact@company.io"]

r = requests.post(
    "https://email-validator-pro11.p.rapidapi.com/batch",
    json={"emails": emails},
    headers=headers
)
results = r.json()
valid = [e for e in results["results"] if e["is_valid"]]
print(f"{len(valid)}/{len(emails)} emails are valid")
Enter fullscreen mode Exit fullscreen mode

Use Cases

  • User registration — block disposable emails at signup
  • Email campaigns — reduce bounce rate before sending
  • CRM import — validate bulk contact lists
  • B2B lead gen — score email quality before outreach

Pricing

Plan Price Requests/hr
BASIC Free 30
PRO $9.99/mo 500
ULTRA $24.99/mo 5,000

Try it free: https://rapidapi.com/adunaev8419/api/email-validator-pro11

GitHub: https://github.com/adun8419/email-validator-pro-api

Top comments (0)