Veille

Detect Disposable Domains

Block throwaway email registrations in real time by checking whether a domain is from a disposable email provider using the Veille API.

Overview

Disposable email providers let users create temporary inboxes that get deleted after minutes or days. This playbook shows how to query the Veille domain validation endpoint and use the result to block or flag signups at the point of registration.

Prerequisites

  • A Veille API key — get one at app.veille.io
  • Install dependencies for your language:
pip install requests

Steps

Check a domain

Call GET /v1/domain with the domain parameter. The response returns whether it is disposable, free, or a custom domain.

import requests

API_KEY  = "YOUR_API_KEY"
response = requests.get(
    "https://api.veille.io/v1/domain",
    headers={"x-api-key": API_KEY},
    params={"domain": "mailinator.com"},
)
result = response.json()
print(result)

Read the response fields

The response includes is_disposable, is_free, is_custom, domain, and provider (when identified).

domain        = result.get("domain")
is_disposable = result.get("is_disposable")
is_free       = result.get("is_free")
provider      = result.get("provider", "unknown")

if is_disposable:
    print(f"❌ {domain} is a DISPOSABLE email provider ({provider}). Block this signup.")
elif is_free:
    print(f"⚠️  {domain} is a free email provider. Consider extra verification.")
else:
    print(f"✅ {domain} looks like a custom / business domain. Allow.")

Integrate into a signup handler

Add the domain check to your registration endpoint and return a validation error before the user record is created.

import requests

API_KEY = "YOUR_API_KEY"

def is_disposable_email(email: str) -> bool:
    domain = email.split("@")[-1].lower()
    r = requests.get("https://api.veille.io/v1/domain",
        headers={"x-api-key": API_KEY}, params={"domain": domain})
    return r.json().get("is_disposable", False)

def register_user(email: str, password: str) -> dict:
    if is_disposable_email(email):
        return {"success": False, "error": "Disposable email addresses are not allowed."}
    # ... create the user record in your database
    return {"success": True, "message": f"Welcome, {email}!"}

print(register_user("alice@mailinator.com", "secret"))
print(register_user("alice@company.com",    "secret"))

Cache results for frequently checked domains (e.g. in Redis with a 24-hour TTL) to avoid redundant API calls. The list of disposable providers rarely changes within a single day.

On this page