Use case
Email verification API for signup forms
Catch mistyped addresses, disposable domains and mailboxes that do not exist before an account is created. Give quick feedback while someone types, then confirm the address when the form is submitted.
- Fast check
- Syntax, DNS and list checks, well under a second. It never opens an SMTP connection.
- Deep check (default)
- Adds a live mailbox check. Typically 2 to 8 seconds.
- Every result
- A verdict, is_valid, a 0 to 100 score and suggestions for likely typos.
- API key scope
- validate
What you use
The pieces that do the work
Typo suggestions
A likely typo such as gmial.com comes back as a suggestion you can show to the person who typed it.
suggestions
Disposable and role addresses
Throwaway domains and role mailboxes such as info@ and admin@ are flagged. Whether to accept them is your call.
warnings, breakdown.role_based
A real mailbox check
The deep check asks the receiving server whether the mailbox exists. If the check cannot finish in time the result is unknown, never valid by guesswork.
mode=deep (default)
Catch-all detection
Domains that accept every address are spotted, so a yes from one of them can be treated as risky.
breakdown.smtp.catch_all
Fast mode for the form field
Add ?mode=fast for an answer in well under a second, short enough to use while someone fills in the form.
?mode=fast
Verdict and score
One request returns a verdict, an is_valid flag and a score, so a single field is enough for a quick decision.
verdict, is_valid, score
How it works
Four steps from form field to account
- 01
Create a validate key
In the dashboard, create an API key limited to the validate scope and keep it on your server.
- 02
Check while they type
Your backend calls POST /validate/?mode=fast and passes any suggestion or warning to the form. Each call uses one credit and counts toward your plan's hourly request limit, so check when the field loses focus rather than on every keystroke.
- 03
Confirm on submit
Run the default deep check before you create the account, and accept the address when is_valid is true.
- 04
Decide on the rest
Treat catch-all domains, role addresses and low scores as risky, and choose what the form does with an unknown result. That policy is yours.
In code
One request from your backend
Authenticate with the X-API-Key header. Paths end in a slash.
- Call ScrubiMail from your server and expose your own endpoint to the form. Never put the key in browser code.
- Fast mode never opens an SMTP connection, so is_valid is not true in fast mode. Use it for feedback and confirm with a deep check.
- Repeat lookups of the same address can be served from a cache, flagged cached: true. They still cost one credit.
- If the mailbox check cannot finish, the result is unknown with a sub_status that says why.
curl -X POST "https://api.scrubimail.com/scrubimail/api/v1/validate/" \
-H "X-API-Key: $SCRUBIMAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'
# Syntax and DNS only, well under a second:
# curl -X POST "https://api.scrubimail.com/scrubimail/api/v1/validate/?mode=fast" ...const res = await fetch("https://api.scrubimail.com/scrubimail/api/v1/validate/", {
method: "POST",
headers: {
"X-API-Key": process.env.SCRUBIMAIL_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ email: "[email protected]" }),
});
const result = await res.json();
if (result.is_valid) {
// safe to accept; check result.score and result.breakdown for risk
}import os
import requests
res = requests.post(
"https://api.scrubimail.com/scrubimail/api/v1/validate/",
headers={"X-API-Key": os.environ["SCRUBIMAIL_API_KEY"]},
json={"email": "[email protected]"},
timeout=15,
)
result = res.json()
if result["is_valid"]:
... # safe to accept; check result["score"] and result["breakdown"]<?php
$ch = curl_init("https://api.scrubimail.com/scrubimail/api/v1/validate/");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-API-Key: " . getenv("SCRUBIMAIL_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["email" => "[email protected]"]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
if ($result["is_valid"]) {
// safe to accept; check $result["score"] and $result["breakdown"]
}{
"email": "[email protected]",
"is_valid": true,
"verdict": "Valid",
"verification_status": "valid",
"sub_status": "mailbox_exists",
"score": 96,
"mode": "deep",
"cached": false,
"breakdown": {
"syntax": {"valid": true},
"dns": {"valid": true, "score": 90},
"smtp": {"valid": true, "catch_all": false},
"reputation": {"reputation_score": 92, "is_spam_trap": false},
"role_based": {"is_role_based": false}
},
"suggestions": [],
"warnings": []
}Go deeper
Where to read next
- ProductEmail validationEvery check, the verdict and the score, and what the API returns.Open
- DocsValidation API referenceEndpoints, parameters, verdicts and sub_status values for POST /validate/.Open
- PricingPlans and creditsMonthly plans, pay-as-you-go credits and every limit, side by side.Open
Also see:List cleaningTransactional email
FAQ
Frequently asked questions
Short answers, checked against how the API behaves.
Which check should the signup form use, fast or deep?
Use both. A fast check (?mode=fast) returns well under a second and suits feedback while someone fills in the field. It checks syntax, DNS and the lists of disposable and role addresses, but never asks the mailbox server, so is_valid is not true in fast mode. The default deep check adds the live mailbox check and typically takes 2 to 8 seconds, which suits the moment the form is submitted.
Can I call the API straight from the browser?
No. Keep the API key on your server and call ScrubiMail from your backend, then return the result to the form. Create a key limited to the validate scope so a leaked key cannot send email or change settings.
What happens if the mailbox check cannot finish?
The result says unknown, with a sub_status such as timeout that explains why. ScrubiMail does not report an address as valid by guesswork. Whether your form accepts an unknown address, asks the person to confirm it, or sends a verification email is your decision.
Can I block disposable addresses?
The result flags throwaway domains and role addresses such as info@ or admin@, and you decide what to do with them: reject them, ask for another address, or accept them.
What does it cost?
Each validated address uses one validation credit, in fast mode and for cached results too. The Free plan includes 100 validation credits a month. Signing up does not ask for a card. Plans also set an hourly request limit; Free allows 1,000 requests per hour.
Does it suggest fixes for typos?
Yes. The suggestions array can carry a correction such as gmial.com to gmail.com, which you can show to the person who typed it.
Verify your first signup address in minutes
Create an account, make a validate-scoped API key and send the request above.