Python

You can find the ZeroBounce Python API v2 on our GitHub - Python API v2

Example usage

The validate and get_credit methods return objects from which you can easily retrieve properties the properties below.

Properties and possible values returned by the methods:

validate method

  • Property
    Possible Values
  • address
    The email address you are validating.
  • status
    valid
    invalid
    catch-all
    unknown
    spamtrap
    abuse
    do_not_mail
  • sub_status
    antispam_system
    greylisted
    mail_server_temporary_error
    forcible_disconnect
    mail_server_did_not_respond
    timeout_exceeded
    failed_smtp_connection
    mailbox_quota_exceeded
    exception_occurred
    possible_traps
    role_based
    global_suppression
    mailbox_not_found
    no_dns_entries
    failed_syntax_check
    possible_typo
    unroutable_ip_address
    leading_period_removed
    does_not_accept_mail
    alias_address
    toxic
    disposable
    role_based_catch_all
  • account
    The portion of the email address before the "@" symbol.
  • domain
    The portion of the email address after the "@" symbol.
  • did_you_mean
    Suggestive fix for an email typo or [null]
  • domain_age_days
    Age of the email domain in days or [null]
  • free_email
    [true/false] If the email comes from a free provider
  • mx_found
    [true/false] Does the domain have an MX record
  • mx_record
    The preferred MX record of the domain or [null]
  • smtp_provider
    The SMTP Provider of the email or [null] (BETA)
  • lastname
    The last name of the owner of the email when available or [null]
  • gender
    The gender of the owner of the email when available or [null]
  • country
    The country the IP address is from
  • region
    The state/region the IP address is from
  • city
    The city the IP address is from
  • zipcode
    The Zip Code the IP address is from
  • processed_at
    The UTC time the email was validated

GetCredit method

  • Property
    Possible Values
  • credits
    The number of credits left in account for email validation.

  from zerobounce import ZeroBounceAPI

  zba = ZeroBounceAPI('yourapikey____________')
  print zba.get_credits()
  resp1 = zba.validate('flowerjill@aol.com','123.145.124.12')
  
  print resp1
  {
  "address":"flowerjill@aol.com",
  "status":"valid",
  "sub_status":"",
  "free_email":True,
  "did_you_mean":None,
  "account":"flowerjill",
  "domain":"aol.com",
  "domain_age_days": "8426",
  "smtp_provider":"yahoo",
  "mx_record":"mx-aol.mail.gm0.yahoodns.net",
  "mx_found": True,
  "firstname":"Jill",
  "lastname":"Stein",
  "gender":"female",
  "country":"United States",
  "region":"Florida",
  "city":"West Palm Beach",
  "zipcode":"33401",
  "processed_at":"2017-04-01 02:48:02.592"
  }
  
  print resp.firstname
  Jill
  
  print resp2.status
  valid