📧 Email Validator API

基于 EmailCamel 的邮箱有效性验证服务

🚀 快速开始

上传以下3个PHP文件到您的服务器:

  • verify.php - 一键验证(推荐)
  • api.php - 提交+查询分离
  • callback.php - 接收回调

📡 API 接口

POST/GET /verify.php?email=your@email.com&api_key=YOUR_KEY

一键验证,自动等待结果(最多15秒)需要API密钥

POST/GET /api.php?email=your@email.com&api_key=YOUR_KEY

两步验证:先提交,再查询 需要API密钥

💻 调用示例

// 调用示例 (需要 API Key) const apiKey = 'your-secret-key-here'; // 方法1: Header 方式 (推荐) fetch('https://vwa.doitx.ai/verify.php', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': apiKey }, body: JSON.stringify({email: 'test@example.com'}) }) .then(r => r.json()) .then(console.log); // 方法2: URL 参数方式 fetch('https://vwa.doitx.ai/verify.php?email=test@example.com&api_key=' + apiKey) .then(r => r.json()) .then(console.log); // 返回结果示例 { "success": true, "email": "test@example.com", "status": "ok" }

📊 状态码说明

状态 说明
ok 邮箱有效且存在
invalid 邮箱格式或域名无效
unknown 无法确定有效性
catch-all 域名接受所有邮件(可能有风险)
deactivated 邮箱之前有效现已停用
disposable 使用临时/一次性邮箱

🔐 API 密钥配置

verify.phpapi.php 中修改以下数组添加您的密钥:

$allowedKeys = [ 'your-secret-key-here', // 修改为您自己的密钥 'dennis-key-001', 'admin-key-2024' ];

建议:

  • 使用复杂的随机字符串作为密钥
  • 定期更换密钥
  • 不要在客户端代码中硬编码密钥(使用后端代理)