Batch Email Validator - Real time (v2)

This endpoint allows you to send us batches up to 100 emails at a time. It is rate limited to 5 uses per minute, if you exceed the rate limit, you will be blocked for 10 minutes. If you're looking to do single email validations, please use our single email validator endpoint.

If you're looking to upload files with emails greater than 100 at a time without any rate limiting restrictions, please use our Bulk File Management Endpoints which also includes anti-greylisting as an added benefit.

This endpoint can take up to 70 seconds to return the results of the entire batch. We currently don't have an SDK for this endpoint, but SDK's are available for our other endpoints.

- POST /v2/validatebatch

API URL: https://bulkapi.zerobounce.net/v2/validatebatch

Below you will find the instructions on how to use our API, it's very easy to use and requires SSL. The API requires that you have an active credit balance and will never consume a credit for any unknown result.

URL Parameters

  • Parameter
    Description
  • email
    The email address you want to validate
  • email_batch
    [Array of Objects], Format:{"email_address": "valid@example.com","ip_address": "1.1.1.1"}

Example Post Request


    {
        "api_key":"Your API Key",
            "email_batch":[
                {"email_address": "valid@example.com","ip_address": "1.1.1.1"},
                {"email_address": "invalid@example.com","ip_address": "1.1.1.1"},
                {"email_address": "disposable@example.com","ip_address": null}
            ]
    }
                

To use this endpoint, use the code examples below for the desired language:

  • Visual Basic
  • C#
  • PHP
  • Python
  • Swift
  • CURL
          
    Dim apiURL = "https://bulkapi.zerobounce.net/v2/validatebatch"
    Dim apiKey = "Your API Key"
    Dim formData = "{""api_key"":""" & apiKey & """," & vbCrLf & " " & """email_batch"":[" & vbCrLf &
        "{""email_address"": ""valid@example.com"",""ip_address"": ""1.1.1.1""}," & vbCrLf &
        "{""email_address"": ""invalid@example.com"",""ip_address"": ""1.1.1.1""}," & vbCrLf &
        "{""email_address"": ""disposable@example.com"",""ip_address"": null}" & vbCrLf & "]" & vbCrLf & "}"

    Dim request As HttpWebRequest = CType(WebRequest.Create(apiURL), HttpWebRequest)
    request.Method = "POST"
    request.ContentType = "application/json"
    request.ContentLength = formData.Length
    Dim formLookupDataBytes As Byte() = Encoding.UTF8.GetBytes(formData)

    Using postStream As Stream = request.GetRequestStream()
        postStream.Write(formLookupDataBytes, 0, formLookupDataBytes.Length)
    End Using

    Using response = CType(request.GetResponse(), HttpWebResponse)

        Using sr = New StreamReader(response.GetResponseStream())
            Dim responseString = sr.ReadToEnd()
        End Using
    End Using
        

    var apiURL = "https://bulkapi.zerobounce.net/v2/validatebatch";
    var apiKey = "Your API Key";

    var formData = "{"api_key":"" + apiKey + "", " +
        ""email_batch":[" +
        "{"email_address": "valid@example.com","ip_address": "1.1.1.1"}," +
        "{"email_address": "invalid@example.com","ip_address": "1.1.1.1"}," +
        "{"email_address": "disposable@example.com","ip_address": null}]}";

    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiURL);
    request.Method = "POST";
    request.ContentType = "application/json";
    request.ContentLength = formData.Length;

    byte[] formLookupDataBytes = UTF8Encoding.UTF8.GetBytes(formData);

    using (Stream postStream = request.GetRequestStream())
    {
        postStream.Write(formLookupDataBytes, 0, formLookupDataBytes.Length);
    }

    using (var response = (HttpWebResponse)request.GetResponse())
    {
        using (var sr = new StreamReader(response.GetResponseStream()))
        {
            var responseString = sr.ReadToEnd();
        }
    }
        

<?php

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://bulkapi.zerobounce.net/v2/validatebatch",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{"api_key":"Your एपीआई KEY", "email_batch":[{"email_address": "valid@example.com","ip_address": "1.1.1.1"},{"email_address": "invalid@example.com","ip_address": "1.1.1.1"},{"email_address": "disposable@example.com","ip_address": null}]}",
  CURLOPT_HTTPHEADER => array(
    "x-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImhlbnJ5QHplcm9ib3VuY2UubmV0IiwiZXhwIjoxNTk1NzEzNTI1fQ.nzOT-bJ8_tvnrNy3t1DeIDNMXxS-YEvlCbZye-9vpr4",
    "Content-Type: application/json",
    "Cookie: __cfduid=db977bdba3d06a8c9c19b45a92d6221b41572452483"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
      
        

    import http.client
    import mimetypes
    conn = http.client.HTTPSConnection("bulkapi.zerobounce.net")
    payload = '{
      "api_key":"Your API KEY",
      "email_batch":[
          {
            "email_address": "valid@example.com",
            "ip_address": "1.1.1.1"
          },
          {
            "email_address": "invalid@example.com",
            "ip_address": "1.1.1.1"
          },
          {
            "email_address": "disposable@example.com",
            "ip_address": null
          }
        ]
    }'
    headers = {
      'x-token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImhlbnJ5QHplcm9ib3VuY2UubmV0IiwiZXhwIjoxNTk1NzEzNTI1fQ.nzOT-bJ8_tvnrNy3t1DeIDNMXxS-YEvlCbZye-9vpr4',
      'Content-Type': 'application/json',
      'Cookie': '__cfduid=db977bdba3d06a8c9c19b45a92d6221b41572452483'
    }
    conn.request("POST", "/v2/validatebatch", payload, headers)
    res = conn.getresponse()
    data = res.read()
    print(data.decode("utf-8"))
        
     
    import Foundation

    var semaphore = DispatchSemaphore (value: 0)
    
    let parameters = "{"api_key":"Your एपीआई KEY", "email_batch":[{"email_address": "valid@example.com","ip_address": "1.1.1.1"},{"email_address": "invalid@example.com","ip_address": "1.1.1.1"},{"email_address": "disposable@example.com","ip_address": null}]}"
    let postData = parameters.data(using: .utf8)
    
    var request = URLRequest(url: URL(string: "https://bulkapi.zerobounce.net/v2/validatebatch")!,timeoutInterval: Double.infinity)
    request.addValue("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImhlbnJ5QHplcm9ib3VuY2UubmV0IiwiZXhwIjoxNTk1NzEzNTI1fQ.nzOT-bJ8_tvnrNy3t1DeIDNMXxS-YEvlCbZye-9vpr4", forHTTPHeaderField: "x-token")
    request.addValue("application/json", forHTTPHeaderField: "Content-Type")
    request.addValue("__cfduid=db977bdba3d06a8c9c19b45a92d6221b41572452483", forHTTPHeaderField: "Cookie")
    
    request.httpMethod = "POST"
    request.httpBody = postData
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()   
        

curl --location --request POST 'https://bulkapi.zerobounce.net/v2/validatebatch' --header 'x-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImhlbnJ5QHplcm9ib3VuY2UubmV0IiwiZXhwIjoxNTk1NzEzNTI1fQ.nzOT-bJ8_tvnrNy3t1DeIDNMXxS-YEvlCbZye-9vpr4' --header 'Content-Type: application/json' --header 'Cookie: __cfduid=db977bdba3d06a8c9c19b45a92d6221b41572452483' --data-raw '{"api_key":"Your API KEY",
 "email_batch":[
{"email_address": "valid@example.com","ip_address": "1.1.1.1"},
{"email_address": "invalid@example.com","ip_address": "1.1.1.1"},
{"email_address": "disposable@example.com","ip_address": null}
]
}'
        

Successful Response

      
	 
        {
          "email_batch": [
              {
                  "address": "valid@example.com",
                  "status": "valid",
                  "sub_status": "",
                  "free_email": false,
                  "did_you_mean": null,
                  "account": null,
                  "domain": null,
                  "domain_age_days": "9692",
                  "smtp_provider": "example",
                  "mx_found": "true",
                  "mx_record": "mx.example.com",
                  "firstname": "zero",
                  "lastname": "bounce",
                  "gender": "male",
                  "country": null,
                  "region": null,
                  "city": null,
                  "zipcode": null,
                  "processed_at": "2020-09-17 17:43:11.829"
              },
              {
                  "address": "invalid@example.com",
                  "status": "invalid",
                  "sub_status": "mailbox_not_found",
                  "free_email": false,
                  "did_you_mean": null,
                  "account": null,
                  "domain": null,
                  "domain_age_days": "9692",
                  "smtp_provider": "example",
                  "mx_found": "true",
                  "mx_record": "mx.example.com",
                  "firstname": "zero",
                  "lastname": "bounce",
                  "gender": "male",
                  "country": null,
                  "region": null,
                  "city": null,
                  "zipcode": null,
                  "processed_at": "2020-09-17 17:43:11.830"
              },
              {
                  "address": "disposable@example.com",
                  "status": "do_not_mail",
                  "sub_status": "disposable",
                  "free_email": false,
                  "did_you_mean": null,
                  "account": null,
                  "domain": null,
                  "domain_age_days": "9692",
                  "smtp_provider": "example",
                  "mx_found": "true",
                  "mx_record": "mx.example.com",
                  "firstname": "zero",
                  "lastname": "bounce",
                  "gender": "male",
                  "country": null,
                  "region": null,
                  "city": null,
                  "zipcode": null,
                  "processed_at": "2020-09-17 17:43:11.830"
              }
          ],
          "errors": []
      }
        

Error Response

      
        {
          "email_batch": [],
          "errors": [
              {
                  "error": "Invalid API Key or your account ran out of credits",
                  "email_address": "all"
              }
          ]
        }
      
        

The API will return a JSON onject with 2 array values, "email_batch" and "errors" using the "BatchValidate" method.

The email_batch property will be an array of validated results and the errors array will be an array of errors encountered during batch vaidation, if any.

JSON Properties

  • Properties
    Description
  • email_batch
    [Array] An Array of validated emails
  • errors
    [Array] An Array of errors encuontered, if any

email_batch Properties

  • Properties
    Description
  • 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, role_based_catch_all, disposable, toxic]
  • 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
  • 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
  • smtp_provider
    The SMTP Provider of the email or [null] [BETA].
  • firstname
    The first name of the owner of the email when available or [null].
  • 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].
  • city
    The city of the IP passed in or [null]
  • region
    The region/state of the IP passed in or [null]
  • zipcode
    The zipcode of the IP passed in or [null]
  • country
    The country of the IP passed in or [null]
  • processed_at
    The UTC time the email was validated.