Python SDK
from revenuebase_sdk import RevenuebaseClient
client = RevenuebaseClient()
with open("emails.csv", "rb") as f:
job = client.email.batch_upload(file=f, filename="emails.csv")
print(job.process_id)curl --request POST \
--url https://api.revenuebase.ai/v2/email/verify/batch \
--header 'Content-Type: multipart/form-data' \
--header 'x-key: <api-key>' \
--form requested_file=@example-fileconst form = new FormData();
form.append('requested_file', '<string>');
const options = {method: 'POST', headers: {'x-key': '<api-key>'}};
options.body = form;
fetch('https://api.revenuebase.ai/v2/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.revenuebase.ai/v2/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 => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"requested_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data; boundary=---011000010111000001101001",
"x-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.revenuebase.ai/v2/email/verify/batch"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"requested_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-key", "<api-key>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
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.revenuebase.ai/v2/email/verify/batch")
.header("x-key", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"requested_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revenuebase.ai/v2/email/verify/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-key"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"requested_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"process_id": 123,
"filename": "<string>",
"status": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Email API
Upload a batch file for email verification
Submit an email list for verification and retrieve the results when the job finishes.
POST
/
v2
/
email
/
verify
/
batch
Python SDK
from revenuebase_sdk import RevenuebaseClient
client = RevenuebaseClient()
with open("emails.csv", "rb") as f:
job = client.email.batch_upload(file=f, filename="emails.csv")
print(job.process_id)curl --request POST \
--url https://api.revenuebase.ai/v2/email/verify/batch \
--header 'Content-Type: multipart/form-data' \
--header 'x-key: <api-key>' \
--form requested_file=@example-fileconst form = new FormData();
form.append('requested_file', '<string>');
const options = {method: 'POST', headers: {'x-key': '<api-key>'}};
options.body = form;
fetch('https://api.revenuebase.ai/v2/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.revenuebase.ai/v2/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 => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"requested_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data; boundary=---011000010111000001101001",
"x-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.revenuebase.ai/v2/email/verify/batch"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"requested_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-key", "<api-key>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
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.revenuebase.ai/v2/email/verify/batch")
.header("x-key", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"requested_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revenuebase.ai/v2/email/verify/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-key"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"requested_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"process_id": 123,
"filename": "<string>",
"status": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Credits and plans
PAYG is Pay-as-you-go. AYCE is All-you-can-eat. Email verification uses the same per-result prices on both plans.| Result or option | PAYG | AYCE |
|---|---|---|
| Valid result | 1 credit | 1 credit |
| Invalid result | 1 credit | 1 credit |
| Unknown result | Free 0 credits | Free 0 credits |
| Metadata | Included No extra cost | Included No extra cost |
When to use this endpoint
Use one upload for a large list instead of making a single-address call for every row. The batch runs asynchronously and returns a numericprocess_id for the Utilities job endpoints.
Prepare your file
Supply a UTF-8.csv or .json file with an email field. Keep your own reference column when you need to reconnect results to your records; output order can differ from input order.
emails.csv
contact_id,email
rb-pab23456t-rb-oadkxzpcq,mtobin@ecapital.com
rb-pab2346sr-rb-oacopeifk,katherine.collins@travelers.com
emails.json
[
{"contact_id":"rb-pab23456t-rb-oadkxzpcq","email":"mtobin@ecapital.com"},
{"contact_id":"rb-pab2346sr-rb-oacopeifk","email":"katherine.collins@travelers.com"}
]
Example
SetREVENUEBASE_API_KEY to your API key.
curl --request POST 'https://api.revenuebase.ai/v2/email/verify/batch?metadata=true' \
--header "X-Key: $REVENUEBASE_API_KEY" \
--form 'requested_file=@emails.csv'
Read the response
| Field | Meaning |
|---|---|
process_id | Numeric job identifier. Save it for polling, cancellation, and downloads. |
filename | Stored input filename. |
status | PROCESSING QUEUED means the upload was accepted. Read current_status from the status endpoint for the subsequent job state. |
Options, limits, and budget
- Submit up to 300,000 input rows per file for a standard account. Larger files fail during processing.
- Set
metadata=truein the query string to include metadata in the output file. The default is false. - Budget one available credit per input row before starting. A job can fail with insufficient credits even though some eventual results would be free.
- The final verification charge is Valid results + Invalid results. Metadata has no surcharge.
- Repeated submissions create new jobs and can charge again for the same addresses.
Poll, then download
Upload a batch, check its status, then download the results.| Job status | Meaning |
|---|---|
QUEUED | Waiting to start. |
PROCESSING | Verification is running. |
CANCELLING | A cancellation was requested; wait for it to finish. |
COMPLETED | Finished. Download the output. |
CANCELLED | Stopped. Partial output may be available. |
ERROR | Failed. Read the message and correct the cause before submitting again. |
Errors and retries
An unsupported filename extension returns 400. A malformed file, missing email column, excessive row count, or insufficient budget can appear as an ERROR job after an accepted upload. Read the job message before submitting a corrected file. If an upload response is lost, list your jobs before uploading again to avoid creating a second paid run.Next steps
Get batch job status using the returned process_id.Query Parameters
Was this page helpful?
