Create batch request
curl --request POST \
--url https://api.usebouncer.com/v1.1/email/verify/batch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
[
{
"email": "john@usebouncer.com"
},
{
"email": "jenny@usebouncer.com"
}
]
'import requests
url = "https://api.usebouncer.com/v1.1/email/verify/batch"
payload = [{ "email": "john@usebouncer.com" }, { "email": "jenny@usebouncer.com" }]
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{email: 'john@usebouncer.com'}, {email: 'jenny@usebouncer.com'}])
};
fetch('https://api.usebouncer.com/v1.1/email/verify/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usebouncer.com/v1.1/email/verify/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'email' => 'john@usebouncer.com'
],
[
'email' => 'jenny@usebouncer.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usebouncer.com/v1.1/email/verify/batch"
payload := strings.NewReader("[\n {\n \"email\": \"john@usebouncer.com\"\n },\n {\n \"email\": \"jenny@usebouncer.com\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.usebouncer.com/v1.1/email/verify/batch")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"email\": \"john@usebouncer.com\"\n },\n {\n \"email\": \"jenny@usebouncer.com\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usebouncer.com/v1.1/email/verify/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"email\": \"john@usebouncer.com\"\n },\n {\n \"email\": \"jenny@usebouncer.com\"\n }\n]"
response = http.request(request)
puts response.read_body{
"batchId": "4d5fdf6b5ee97c4dbbccbfe1",
"created": "2023-03-26T18:08:15.033Z",
"status": "queued",
"quantity": 2,
"duplicates": 0
}{
"status": "402",
"error": "Payment Required",
"message": "1 credits left"
}Batch
Create batch request
Verifies one or multiple emails in a batch, offline manner.
POST
/
v1.1
/
email
/
verify
/
batch
Create batch request
curl --request POST \
--url https://api.usebouncer.com/v1.1/email/verify/batch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
[
{
"email": "john@usebouncer.com"
},
{
"email": "jenny@usebouncer.com"
}
]
'import requests
url = "https://api.usebouncer.com/v1.1/email/verify/batch"
payload = [{ "email": "john@usebouncer.com" }, { "email": "jenny@usebouncer.com" }]
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{email: 'john@usebouncer.com'}, {email: 'jenny@usebouncer.com'}])
};
fetch('https://api.usebouncer.com/v1.1/email/verify/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usebouncer.com/v1.1/email/verify/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'email' => 'john@usebouncer.com'
],
[
'email' => 'jenny@usebouncer.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usebouncer.com/v1.1/email/verify/batch"
payload := strings.NewReader("[\n {\n \"email\": \"john@usebouncer.com\"\n },\n {\n \"email\": \"jenny@usebouncer.com\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.usebouncer.com/v1.1/email/verify/batch")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"email\": \"john@usebouncer.com\"\n },\n {\n \"email\": \"jenny@usebouncer.com\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usebouncer.com/v1.1/email/verify/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"email\": \"john@usebouncer.com\"\n },\n {\n \"email\": \"jenny@usebouncer.com\"\n }\n]"
response = http.request(request)
puts response.read_body{
"batchId": "4d5fdf6b5ee97c4dbbccbfe1",
"created": "2023-03-26T18:08:15.033Z",
"status": "queued",
"quantity": 2,
"duplicates": 0
}{
"status": "402",
"error": "Payment Required",
"message": "1 credits left"
}If you need to verify multiple email addresses in a batch, you can use our
Batch Email Verification API.
Bouncer distributed infrastructure will make sure to get best possible
results and retry any verification in case one is required.
For example:
Please make sure to store batchId as it will be necessary to check
status and get results for the request.
Speed
Default settings allow our customers to verify 100-200k email addresses
per hour, however if your use case requires higher throughput, please let
us know and we will be able to adjust your configuration.
Rate Limiting
The Batch Email Verification API is limited to creating up to 60 batches
per minute and 200 requests to other related endpoints.
Batch size recommendation
Single batch can process up to 100,000 emails, while recommended size
would be anything between 1000-10000 emails.
This method is recommended when the quality of verification is of a
value as it characterises the best precision of email validation and the
lowest possible amount of “unknown” results.
CSV format support
Batch can also be created using txt file, with one email per file, and then results downloaded as csv file.
Example file content
Integration flow
There are 2 ways to integrate with batch, using status endpoint or using
callback parameter.
Using Status Endpoint
Using Callbacks
[
{ "email": "jane@usebouncer.com"},
{ "email": "john@usebouncer.com"}
]
deliverable@sandbox.usebouncer.com
deliverable+2@sandbox.usebouncer.com
deliverable+3@sandbox.usebouncer.com
undeliverable@sandbox.usebouncer.com
curl -v https://api.usebouncer.com/v1.1/email/verify/batch\?skip-header\=false \
--data-binary "@./test.csv" \
-H "x-api-key: <api-key>" \
-H 'Content-Type: text/plain'
title Batch Integration Flow With Status Endpoint
Client->>Bouncer: POST /v1.1/email/verify/batch
loop every 10-30s until status == 'completed'
Client->>Bouncer: GET /v1.1/email/verify/batch/<ID>
end
Client->>Bouncer: GET
/v1.1/email/verify/batch/<ID>/download?download=all
title Batch Integration Flow With Callbacks
Client->>Bouncer: POST /v1.1/email/verify/batch?callback=<YOUR-URL>
Bouncer->>Client: POST <YOUR-URL>
Client->>Bouncer: GET
/v1.1/email/verify/batch/<ID>/download?download=all