Dokümanlar/Tekil Doğrulama

Tekli E-posta Doğrulama

Tek bir e-posta adresini gerçek zamanlı doğrulayın. Yanıt süre ayrıntılarını içerir; gecikme, uzak posta sunucularına ve ağ koşullarına bağlıdır.

Uç nokta

POST https://verimails.com/api/verify/single

İstek

Başlıklar

BaşlıkZorunluDeğer
AuthorizationEvetBearer YOUR_API_KEY
Content-TypeEvetapplication/json

Gövde

AlanTürZorunluAçıklama
emailstringEvetDoğrulanacak e-posta adresi
json
{
  "email": "user@example.com"
}

Yanıt

Yanıt alanları

AlanTürAçıklama
emailstringDoğrulanan e-posta adresi
statusstringDoğrulama sonucu: valid, invalid, risky, unknown veya disposable
safe_to_sendbooleanVeriMails'in bu adrese gönderim yapmayı önerip önermediği. Yalnızca şu durumda true olur: status değeri valid.
confidence_scorenumberDoğrulama sonucu için genel güven düzeyi.
domainstringE-posta adresinden çıkarılan alan adı.
is_catch_allbooleanAlan adının postaları genel olarak kabul edip etmediği; bu durum tekil posta kutusunun teyit edilmesini zorlaştırır.
is_disposablebooleanAdresin tek kullanımlık veya geçici bir e-posta sağlayıcısı kullanıp kullanmadığı.
is_role_basedbooleanAdresin info@ veya support@ gibi bir rol gelen kutusu olup olmadığı.
is_freebooleanAlan adının ücretsiz bir e-posta sağlayıcısı olup olmadığı.
verification_time_msintegerMilisaniye cinsinden işlem süresi.

Örnek yanıt: geçerli e-posta

json
{
  "email": "john@company.com",
  "status": "valid",
  "safe_to_send": true,
  "confidence_score": 0.95,
  "reason": "Verification completed",
  "domain": "company.com",
  "is_disposable": false,
  "is_role_based": false,
  "is_free": false,
  "is_catch_all": false,
  "mx_records": ["mx1.company.com"],
  "smtp_response": null,
  "verification_time_ms": 642,
  "api_version": "1.0"
}

Örnek yanıt: catch-all alan adı

json
{
  "email": "sarah@enterprise.io",
  "status": "catchall",
  "safe_to_send": false,
  "confidence_score": 0.52,
  "reason": "Catch-all domain detected",
  "domain": "enterprise.io",
  "is_disposable": false,
  "is_role_based": false,
  "is_free": false,
  "is_catch_all": true,
  "mx_records": ["mx1.enterprise.io"],
  "smtp_response": null,
  "verification_time_ms": 918,
  "api_version": "1.0"
}

Kod örnekleri

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

def verify_email(email, api_key):
    response = requests.post(
        "https://verimails.com/api/verify/single",
        headers={
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json"
        },
        json={"email": email}
    )
    response.raise_for_status()
    return response.json()

result = verify_email("user@example.com", "YOUR_API_KEY")
if result["safe_to_send"]:
    print("Safe to contact!")
javascript
async function verifyEmail(email, apiKey) {
  const res = await fetch("https://verimails.com/api/verify/single", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${apiKey}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ email })
  });

  if (!res.ok) throw new Error(`API error: ${res.status}`);
  return res.json();
}

const result = await verifyEmail("user@example.com", "YOUR_API_KEY");
console.log(result.status);       // "valid"
console.log(result.safe_to_send); // true
php
function verifyEmail($email, $apiKey) {
    $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 {$apiKey}",
            "Content-Type: application/json"
        ],
        CURLOPT_POSTFIELDS => json_encode(["email" => $email])
    ]);

    $result = json_decode(curl_exec($ch), true);
    curl_close($ch);
    return $result;
}

$result = verifyEmail("user@example.com", "YOUR_API_KEY");
if ($result["safe_to_send"]) {
    echo "Safe to contact!";
}

Durum kodları

HTTP DurumuAnlamı
200Başarılı: sonuç döndürüldü
401Yetkisiz: API anahtarı eksik veya geçersiz
422Doğrulama hatası: geçersiz e-posta formatı veya eksik alan
429İstek limiti aşıldı: istekleri yavaşlatın
500Sunucu hatası: kısa süre sonra tekrar deneyin