EmailCheck / Questions问题页 / How do I verify emails at signup with an API?
How do I verify emails at signup with an API?怎么在注册环节用 API 验证邮箱?
Call a validation endpoint once, when the form is submitted, and act on the verdict in three bands. Block the hard-invalid: bad syntax, dead domains, no MX records — those accounts can never receive a confirmation email anyway. Warn, don't block, on the fixable: a likely typo (the API returns a suggestion like gmail.com for gmial.com) and disposable addresses, where your policy decides. Let everything else through, including catch-all domains, flagged with the risk signal for later segmentation. With EmailCheck that is one GET or POST to /validate per signup; the free tier covers 100 checks a month for wiring and testing.
在表单提交时调一次验证接口,按三档处理裁决。硬无效直接拦:格式错误、死域名、没有 MX——这类账号本来也收不到确认邮件。可修的只警告、不拦截:大概率拼写错误(接口会返回建议,如 gmial.com → gmail.com)和一次性地址,后者拦不拦由你的产品政策定。其余全部放行,包括 catch-all 域名,只带上风险信号供事后分区。用 EmailCheck 就是每次注册对 /validate 发一个 GET 或 POST;免费档每月 100 次,够接线和测试。
The three bands: block, warn, allow三档处理:拦、警告、放行
Most signup-verification bugs come from treating the verdict as binary. A validation result has at least three bands, and each deserves a different UX:
- Block — hard invalid. Syntax errors, domains that do not exist, domains with no mail server. There is no account-recovery or confirmation path for these addresses; accepting them creates a dead account and a guaranteed bounce. Show a plain error and let the user correct the field.
- Warn — fixable or policy cases. A typo suggestion (“Did you mean gmail.com?”) converts a lost signup into a good one with a single click — never silently autocorrect, always confirm with the user. Disposable addresses are a policy call: a free-trial product may block them, a newsletter may merely flag them.
- Allow — everything else, flagged. Valid domains, role accounts (support@, admin@) if your product allows them, and catch-all domains with their
catchAllRisksignal stored on the account for later segmentation — not silently treated as proven.
注册验证的大多数 bug 来自把裁决当二值。一次验证结果至少有三档,每档配不同的交互:
- 拦——硬无效。格式错误、域名不存在、域名没有邮件服务器。这类地址没有找回账号和确认邮件的任何路径;收下来就是一个死账号加一次必定的退信。给出明确报错,让用户改字段。
- 警告——可修或看政策。拼写建议(「你是不是想填 gmail.com?」)一次点击就能把流失的注册救回来——绝不静默自动纠正,永远让用户确认。一次性地址看政策:免费试用产品可以拦,订阅通讯可以只标记。
- 放行——其余全部,带标记。有效域名、你的产品允许的角色账号(support@、admin@),以及 catch-all 域名——把它的
catchAllRisk信号存到账号上供事后分区,不要静默当作已证实。
Where to put the call (and where not to)调用放哪儿(以及不放哪儿)
Call on submit, not on every keystroke: one check per attempted signup is enough, keeps you inside free-tier limits while testing, and avoids hammering the API from half-typed addresses. Debounce-and-check on blur is acceptable for the typo suggestion alone, but the blocking decision belongs at submit, with the full address final.
Fail open, deliberately: if the validation call times out or errors, let the signup through and log it for a later batch re-check. A verification outage must never become your outage — but “fail open” should be a written policy with a re-check queue, not an accident you discover from bounce reports. Block on the verdict and the flags — they are what the three bands are built from.
在提交时调,不要每次按键都调:每次尝试注册查一次就够,测试期也压得住免费档额度,还不会拿打了一半的地址去轰接口。只为拼写建议在失焦时查一次也可以,但拦截决策必须放在提交时、用最终完整地址。
要有意地「失败放行」:验证调用超时或报错时,让注册通过,并把地址记进事后批量复查队列。验证服务故障绝不能变成你的故障——但「失败放行」应该是写下来的政策加复查队列,而不是等退信报告来了才发现的事故。拦截点就建在裁决和标记上——三档正是为它们设计的。
Wiring it with EmailCheck用 EmailCheck 接线
The single-check endpoint is GET /validate?email=… (POST works too) on the EmailCheck API, listed on RapidAPI with a free BASIC tier of 100 checks a month — enough to wire the integration and test every band. Each response carries the fields the three-band logic needs: valid and verdict, per-check flags (syntax, domain, MX, disposable, role account), a suggestion when a typo looks likely, the graded score, and catchAllRisk for the allow-with-flag band. Every response carries the same field set, so what you are deciding on is never ambiguous.
Try the box on this page with newuser@gmial.com: the live API flags the typo and suggests gmail.com — the warn band, working end to end. When your existing user base needs the same treatment in bulk, the batch endpoint takes up to 100 addresses per call (see the linked bulk page).
单查端点是 EmailCheck API 的 GET /validate?email=…(POST 也可以),在 RapidAPI 上架,免费 BASIC 档每月 100 次——够把集成接完、三档都测一遍。每个响应都带三档逻辑需要的字段:valid 与 verdict、逐项标记(格式、域名、MX、一次性、角色账号)、拼写大概率出错时的 suggestion、分级分数,以及给「放行带标记」档用的 catchAllRisk。每个响应的字段都一致,你依据什么做决定永远不含糊。
用本页的框试 newuser@gmial.com:生产 API 会标出拼写错误并建议 gmail.com——警告档,端到端跑通。你现有的存量用户需要同样处理时,批量端点一次可查 100 条(见链接的批量页)。
Try it on a real address拿真实地址试一下
Live call to the production API — the same check described on this page.
实时调生产 API——就是本页说的这个检查。
What gets checked: address format, domain and MX health, disposable and role-account signals, likely typos with a correction, domain age from registration records, and catch-all risk — combined into a 0–100 score and a valid / risky / invalid verdict.
查什么:地址格式、域名与 MX 健康、一次性与角色账号信号、疑似拼写错误及纠正建议、来自注册记录的域名年龄、catch-all 风险——合成 0–100 分与 valid / risky / invalid 裁决。