文件/快速入門

快速入門

5 分鐘內完成第一次電子郵件驗證。

檢視 Markdown OpenAPI JSON

1. 建立帳號

前往以下網址註冊: verimails.com/register ,無需信用卡。註冊後立即獲得 100 點免費點數。

2. 取得 API 金鑰

登入後,前往儀表板並複製您的 API 金鑰。格式如下:

文字
ev_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ℹ️
請妥善保管 API 金鑰。切勿在用戶端程式碼或公開儲存庫中洩露。

3. 送出第一個請求

傳送 POST 請求至/api/verify/single並附上電子郵件地址:

bash
curl -X POST https://verimails.com/api/verify/single \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com"}'
python
import requests

response = requests.post(
    "https://verimails.com/api/verify/single",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={"email": "user@example.com"}
)

data = response.json()
print(data["status"])         # 有效
print(data["safe_to_send"])  # True
javascript
const response = await fetch("https://verimails.com/api/verify/single", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ email: "user@example.com" })
});

const data = await response.json();
console.log(data.status);        // 有效
console.log(data.safe_to_send);  // true
php
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => "https://verimails.com/api/verify/single",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_API_KEY",
        "Content-Type: application/json"
    ],
    CURLOPT_POSTFIELDS => json_encode(["email" => "user@example.com"])
]);

$response = json_decode(curl_exec($ch), true);
echo $response["status"];        // 有效
echo $response["safe_to_send"];  // 1

4. 了解回應內容

成功的回應如下:

json
{
  "email": "user@example.com",
  "status": "valid",
  "safe_to_send": true,
  "confidence_score": 0.95,
  "reason": "Verification completed",
  "domain": "example.com",
  "is_disposable": false,
  "is_role_based": false,
  "is_free": true,
  "is_catch_all": false,
  "verification_time_ms": 642
}

最重要的欄位是status與safe_to_send。請以safe_to_send: true作為判斷是否聯絡該地址的主要篩選條件。

後續步驟