Python SDK · Feature

Email Validation & Verification in Python

Check whether an email address is real, deliverable, and safe to accept — before it ever enters your database. The SDK exposes three levels: a fast syntax/MX/disposable check, full SMTP verification, and a batch endpoint for cleaning whole lists.

Trusted by thousands of businesses
Fast JSON API responses
Real-time validation
Simple integration, SDKs & examples
What it does

Three levels of email checking

Not every check needs an SMTP probe. email_info validates syntax and MX and flags disposable providers fast enough to run inline on a sign-up form. validate_email goes further, connecting to the mail server to confirm the mailbox is deliverable and adding role-account, free-provider, and catch-all signals. validate_email_batch applies that advanced check across an entire list in one request.

Prerequisites

1

Fast check with email_info

A lightweight check (no SMTP probe): validates syntax, confirms the domain has MX records, and flags disposable/throwaway providers. Use it inline on sign-up forms.

import os
from ipapi_io import IpApiClient

client = IpApiClient(api_key=os.environ["IP_API_IO_KEY"])

info = client.email_info("user@example.com")

print(info["syntax"]["is_valid"])    # True
print(info["is_disposable"])         # False
print(info["has_mx_records"])        # True
print(info["mx_records"][0]["hostname"])
2

Full SMTP verification with validate_email

Advanced verification that connects to the mail server to confirm the mailbox is deliverable, and adds role-account, free-provider, catch-all and Gravatar signals.

result = client.validate_email("user@example.com")

print(result["reachable"])             # "yes" | "no" | "unknown"
print(result["smtp"]["deliverable"])   # True
print(result["smtp"]["catch_all"])     # False
print(result["disposable"])            # False
print(result["role_account"])          # False  (e.g. info@, support@)
print(result["free"])                  # False  (e.g. gmail.com)
print(result.get("suggestion"))        # typo fix, e.g. "user@gmail.com"
3

Clean a list with validate_email_batch

Advanced-validate up to 100 addresses in one request — the building block for email list cleaning. Raises ValueError if the list is empty or longer than 100.

batch = client.validate_email_batch([
    "user@example.com",
    "fake@mailinator.com",
    "info@example.org",
])

print(batch["totalProcessed"])          # 3
print(batch["successfulValidations"])   # 3

for email, result in batch["results"].items():
    print(email, result["reachable"], result["disposable"])
Reference

Response reference

AdvancedEmailValidation (from validate_email)

FieldTypeDescription
emailstrThe address checked
reachablestr"yes", "no" or "unknown"
smtpdict | Nonehost_exists, deliverable, full_inbox, catch_all, disabled
gravatardict | Nonehas_gravatar, gravatar_url
suggestionstrSuggested correction for a likely typo
disposableboolThrowaway provider
role_accountboolRole address (info@, sales@, …)
freeboolFree webmail provider
has_mx_recordsboolDomain can receive mail
FAQ

Frequently asked questions

How do I validate an email address in Python?

For a fast check, call client.email_info(email) — it validates syntax, confirms the domain has MX records, and flags disposable providers without an SMTP probe. For full deliverability, use client.validate_email(email), which connects to the mail server.

What's the difference between email_info and validate_email?

email_info is a lightweight syntax/MX/disposable check, ideal inline on sign-up forms. validate_email performs advanced SMTP verification and adds role-account, free-provider, catch-all and Gravatar signals — use it before sending important mail or accepting a paying customer.

How do I clean a whole list of emails?

Use client.validate_email_batch(emails) with up to 100 addresses per request — the building block for email list cleaning. It returns a results dict of email to result and raises ValueError if the list is empty or longer than 100.

Can it detect disposable / throwaway emails?

Yes. Both email_info and validate_email return an is_disposable / disposable flag for throwaway providers like mailinator.com, so you can reject or down-rank them at sign-up.

Start building with the ip-api.io Python SDK

Install ip-api-io, drop in your free API key, and ship in minutes — one zero-dependency client for geolocation, fraud detection, and email validation.

Need support?

Explore how IP-API.io can enhance your security, provide robust bot protection, and improve IP geolocation accuracy for your applications.

Contact Support

Found a bug in the SDK?

The ip-api-io package is open source. Open an issue or pull request on GitHub and we'll take a look.

Open on GitHub