Python code to perform EMAIL verification via API.

EMAIL verification API use case.


Very often for webmasters or SEO professionals it is required to perform EMAIL verification or even automate the process and there is a very useful online service for web developers and SEO professionals on "WhoisXML API" that provides Domain & IP Data Intelligence for Greater Enterprise Security and RESTful APIs that we will use.

Using it's APIs you can perform many handy data requests, for example you can verify any given EMAIL address - don't forget to get your API KEY.

email verification.



With one API call you will obtain ready to use parsed JSON file with a results of email addresses comprehensive validation in real-time. For our websites and web services verifying the email addresses coming from new user registrations reduce spam and email bouncing.
This Python script below will use information from "WhoisXML API" and provide you a result in a JSON format without the need to use web a browser.
The process of EMAIL verification can be easily automated now !


Python code to perform EMAIL verification via API:



# Email Verification API USE

import requests


email = 'andrey@bratus.net'

APIKEY ='at_ZUVkrukr4Uhhhsfq2j6dyv2VhFGWYV'

EMAILVerificationURL = f'https://emailverification.whoisxmlapi.com/api/v2?apiKey={APIKEY}&emailAddress={email}'

r = requests.get(EMAILVerificationURL)

EMAILVerification = r.json()

print(f'Verification for {email} email.\n')
EMAILVerification


EMAIL verification output:



Verification for andrey@bratus.net email.

{'username': 'andrey',
 'domain': 'bratus.net',
 'emailAddress': 'andrey@bratus.net',
 'formatCheck': 'true',
 'smtpCheck': 'true',
 'dnsCheck': 'true',
 'freeCheck': 'false',
 'disposableCheck': 'false',
 'catchAllCheck': 'false',
 'mxRecords': ['mx.yandex.net.'],
 'audit': {'auditCreatedDate': '2022-09-08 07:09:46 UTC',
  'auditUpdatedDate': '2022-09-08 07:09:46 UTC'}}




See also related topics: