Skip to main content

Email Verify Python SDK

This SDK contains methods for interacting easily with Email Verify API. More information about EmailVerify you can find in the official webiste.

Official Python SDK for EmailVerify.io - A comprehensive email verification service.

Features

  • ✅ Single Email Validation - Validate individual email addresses
  • 💰 Account Balance Checking - Monitor your credits and API status
  • 📦 Batch Validation - Process up to 5,000 emails at once
  • 🔍 Email Finder - Find email addresses by name and domain

INSTALLATION

pip install emailverifysdk

USAGE

Import the sdk in your file:

from emailverifysdk import EmailVerify

Initialize the sdk with your api key:

email_verify = EmailVerify("<YOUR_API_KEY>")

Examples

Then you can use any of the SDK methods, for example:

  • Check how many credits you have left on your account
from emailverifysdk import EmailVerify, EmailVerifyException

try:
    email_verify = EmailVerify("<YOUR_API_KEY>")
    response = email_verify.check_balance()
    print("Email Verify response: " + str(response))
except EmailVerifyException as e:
    print("EmailVerifyException error: " + str(e))

Sample response:

BalanceResponse = {
    'api_status': 'enabled',
    'daily_credits_limit': 0,
    'referral_credits': 0,
    'remaining_credits': 9986
}

Note: You can access any value of the response using attribute access, e.g. response.api_status

Sample response for appsumo users:

BalanceResponse = {
    'api_status': 'enabled', 
    'daily_credits_limit': 1000, 
    'remaining_daily_credits': 998, 
    'bonus_credits': 35000
}
  • Validate an email address
from emailverifysdk import EmailVerify, EmailVerifyException

try:
    email_verify = EmailVerify("<YOUR_API_KEY>")
    response = email_verify.validate("<EMAIL_ADDRESS>") # EMAIL ADDRESS MUST BE STRING
    print("Email Verify response: " + str(response))
except EmailVerifyException as e:
    print("EmailVerifyException error: " + str(e))

Sample response:

ValidateResponse = {
    'email': '<EMAIL_ADDRESS>', 
    'status': 'do_not_mail', 
    'sub_status': 'mailbox_quota_exceeded'
}

Status can be any of the following:

  • valid
  • invalid
  • catch_all
  • do_not_mail
  • unknown
  • role_based
  • skipped

Sub Status can be any of the following:

  • permitted
  • failed_syntax_check
  • mailbox_quota_exceeded
  • mailbox_not_found
  • no_dns_entries
  • disposable
  • none
  • opt_out
  • blocked_domain
  • Batch Validation
from emailverifysdk import EmailVerify, EmailVerifyException

try:
    email_verify = EmailVerify("<YOUR_API_KEY>")
    emails = ['email1@example.com', 'email2@example.com', 'email3@example.com']
    response = email_verify.validate_batch(emails, "<TITLE>") # title and emails are required fields
    print("Email Verify response: " + str(response))
except EmailVerifyException as e:
    print("EmailVerifyException error: " + str(e))

Sample response:

BatchValidateResponse= {
    'status': 'queued', 
    'task_id': 2922, 
    'count_submitted': 5, 
    'count_duplicates_removed': 0, 
    'count_rejected_emails': 1, 
    'count_processing': 4
}
  • Get Batch Validation Result
from emailverifysdk import EmailVerify, EmailVerifyException

task_id = 1 #TASK_ID must be your task_id received in bulk validation api

try:
    email_verify = EmailVerify("<YOUR_API_KEY>")
    response = email_verify.get_batch_result(task_id) 
    print("Email Verify response: " + str(response))
except EmailVerifyException as e:
    print("EmailVerifyException error: " + str(e))

Sample response when task stil under verification:

BatchResultResponse = {
    'count_checked': 0, 
    'count_total': 4, 
    'name': 'Title', 
    'progress_percentage': 0.0, 
    'task_id': 2922, 
    'status': 'queued',
    'results': None
}

Sample response when verification completed

BatchResultResponse = {
    'count_checked': 4, 
    'count_total': 4, 
    'name': 'Title', 
    'progress_percentage': 100, 
    'task_id': 2922, 
    'status': 'verified', 
    'results': {
        'email_batch': [
            {
                'address': 'email1@example.com', 
                'status': 'do_not_mail', 
                'sub_status': 'mailbox_quota_exceeded'
            }, 
            {   
                'address': 'email2@example.com', 
                'status': 'do_not_mail',
                'sub_status': 'mailbox_quota_exceeded'
            }, 
            {   
                'address': 'email3@example.com', 
                'status': 'do_not_mail', 
                'sub_status': 'mailbox_quota_exceeded'}, 
        ]
    }
}
  • Email Finder
from emailverifysdk import EmailVerify, EmailVerifyException

try:
    email_verify = EmailVerify("<YOUR_API_KEY>")
    response = email_verify.find_email('<NAME>', '<DOMAIN.COM>')
    print("Email Verify response: " + str(response))
except EmailVerifyException as e:
    print("EmailVerifyException error: " + str(e))

Sample response when email found:

FinderResponse = {
    'email': 'email1@example.com', 
    'status': 'found'
}

Sample response when email not found:

FinderResponse = {
    'email': 'null', 
    'status': 'not_found'
}

Exception Handling

The EmailVerify SDK raises custom exceptions for API errors, invalid input, and network issues. You should always wrap SDK calls in a try/except block to handle these cases gracefully.

Common Exceptions

  • EmailVerifyAPIException: Raised for API errors (invalid key, disable key, insufficient credits, invalid paramets etc.)
  • EmailVerifyClientException: Raised for client-side errors (missing parameters, invalid input)
  • EmailVerifyNetworkException: Raised for network connection errors
  • EmailVerifyTimeoutException: Raised when a request times out

Example Usage

from emailverifysdk import EmailVerify, EmailVerifyAPIException, EmailVerifyClientException

email_verify = EmailVerify("<YOUR_API_KEY>")
try:
    response = email_verify.validate("test@example.com")
    print("Validation result:", response.status)
except EmailVerifyAPIException as api_err:
    print("API error:", api_err)
except EmailVerifyClientException as client_err:
    print("Client error:", client_err)
except Exception as e:
    print("Unexpected error:", e)

Accessing Error Details

If an EmailVerifyAPIException is raised, you can access additional details:

from emailverifysdk import EmailVerify, EmailVerifyAPIException

email_verify = EmailVerify("<YOUR_API_KEY>")
try:
    response = email_verify.validate("email@example.com")
except EmailVerifyAPIException as e:
    print("Message", str(e))
    print("Status code:", e.status_code)
    print("Response data:", e.response_data)

Context Manager Usage

from emailverifysdk import EmailVerify

email_verify = EmailVerify("<YOUR_API_KEY>")

with EmailVerify("<YOUR_API_KEY>") as email_verify:
    response = email_verify.validate("test@example.com")
    print(str(response))

Metadata

Release files for emailverifysdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emailverifysdk 0.1.0
File Size Uploaded
emailverifysdk-0.1.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for emailverifysdk 0.1.0
File Interpreter ABI Platform
emailverifysdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.0 kB

Release files / emailverifysdk-0.1.0.tar.gz

Download URL emailverifysdk-0.1.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c98e8b7d5c6712e8a1516fc565879229556f68804744f358d92b2c5e887dbcc7
BLAKE2b-256 checksum
How to use checksums
7bc9cf28a98aec451db28d9edbfb019529631bf401c229fc6bf373310741ca28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / emailverifysdk-0.1.0-py3-none-any.whl

Download URL emailverifysdk-0.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bb2bd3c2fbc40363c0d083c4c179b49286f3638c7cf70d5666816b0c262a808
BLAKE2b-256 checksum
How to use checksums
09583731bbdc296e136d4a9c7cb85ac397cc58df6c6ae8721af6fa6da3ea7b84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page