If you’re tired of sending emails to dead addresses, getting flagged as spam, or just wasting money on dud contacts, this guide is for you. We’ll go step by step through how to automate email list cleaning using the Neverbounce API. No fluff, just what works, where to watch out, and how to actually put this on autopilot—whether you’re technical or just comfortable enough to run a script.
Why bother cleaning your email list?
Let’s keep it real: dirty lists cost you money.
- Bounced emails can hurt your sender reputation.
- Spam traps and old addresses get you blacklisted.
- Fake or mistyped emails mean your campaigns are less effective.
- Most email platforms charge you for every address—even the bad ones.
You could clean your list by hand… but that gets old fast. Automating this with an API saves you hours every month, and keeps things running quietly in the background.
What is Neverbounce, and is it any good?
Neverbounce is a paid service that checks if an email address is valid, risky, or outright bad. It’s well-known in the email marketing world. It’s far from the only option, but it’s reliable, and their API is straightforward—if a bit old-school in places.
What works: - Handles big lists (millions of emails, no sweat). - Simple API—no weird hoops to jump through. - Good docs and support.
What to ignore: - The marketing hype about “instant” results—bulk jobs can take a while. - Claims about 99.9% accuracy. You’ll still get the odd bounce; that’s life.
Step 1: Get your Neverbounce API key
First, you’ll need a Neverbounce account. This isn’t free, but they have pay-as-you-go pricing. Once you’ve signed up:
- Log in to your Neverbounce dashboard.
- Go to the “API” section.
- Copy your API key. Guard it like a password.
Pro tip: Don’t hardcode your API key in scripts. Use environment variables or a secrets manager if you’re putting this in production.
Step 2: Understand your cleaning options
Neverbounce gives you two main ways to check emails via API:
- Single checks: Verify one email at a time. Good for real-time signups.
- Bulk jobs: Upload a whole list, wait, then download cleaned results.
If you’re cleaning a big list occasionally (say, before a big send), go with the bulk jobs. If you want to check addresses as they come in (e.g., during signup), use single checks.
We’ll focus on automating bulk cleaning—most folks want to sweep out the junk in batches.
Step 3: Prepare your email list
Neverbounce expects a CSV file with emails in a single column (usually “email” or “Email Address”). Clean up your source list first:
- Remove obvious junk (blank rows, weird addresses).
- Make sure it’s actually a CSV.
- Just one column with email addresses—no extra fluff.
If you pull lists from your CRM or email platform, export to CSV and double-check the first row is a header.
Step 4: Automate the upload with the API
Let’s get hands-on. You can use any language; I’ll show Python, since it’s simple and well-supported.
Here’s a basic workflow:
- Create a “job” (tells Neverbounce you’re uploading a list)
- Upload your CSV
- Start the job
- Wait for processing
- Download the results
Install dependencies
You’ll need the requests
library:
bash pip install requests
Create and upload a job
Here’s a barebones script to kick things off:
python import requests import time import os
API_KEY = os.environ.get("NEVERBOUNCE_API_KEY") CSV_FILE = "your_list.csv"
1. Create a job
create_job_resp = requests.post( "https://api.neverbounce.com/v4/jobs/create", data={"key": API_KEY, "input_location": "remote_url"}, ) job = create_job_resp.json() job_id = job["job"]["id"]
2. Upload file
with open(CSV_FILE, "rb") as f: upload_resp = requests.post( "https://api.neverbounce.com/v4/jobs/upload", data={"key": API_KEY, "job_id": job_id}, files={"file": f}, )
3. Start the job
start_resp = requests.post( "https://api.neverbounce.com/v4/jobs/start", data={"key": API_KEY, "job_id": job_id}, )
Wait for processing
Bulk jobs aren’t instant. Poll the API every 30 seconds or so:
python while True: status_resp = requests.get( "https://api.neverbounce.com/v4/jobs/status", params={"key": API_KEY, "job_id": job_id}, ) status = status_resp.json()["job"]["status"] if status == "complete": break print("Still processing, waiting 30 seconds...") time.sleep(30)
Download the cleaned list
python download_resp = requests.get( "https://api.neverbounce.com/v4/jobs/download", params={"key": API_KEY, "job_id": job_id, "valids": "1", "invalids": "1", "catchalls": "1", "disposables": "1", "duplicates": "1", "unknowns": "1"}, ) with open("cleaned_list.csv", "wb") as f: f.write(download_resp.content) print("Cleaned list downloaded.")
Pro tip: Only keep “valid” addresses for future sends. The rest are either risky or guaranteed to bounce.
Step 5: Automate the whole thing (cron jobs, workflows, etc.)
Once you’ve got the script working, you can schedule this to run daily, weekly, or before big campaigns. A few ways to automate:
- Cron job (Linux/Mac): Add a line to your crontab to run the script on a schedule.
- Windows Task Scheduler: Same idea, just with Windows tools.
- CI/CD pipelines: If your marketing ops are fancy, trigger cleaning as part of your deployment workflows.
Gotchas: - Don’t hammer the API—Neverbounce has rate limits. - Always back up your original list before overwriting. - If you’re integrating with a CRM, watch out for field mismatches when importing cleaned data.
Optional: Real-time single email validation
Want to check emails as users type them in? Neverbounce’s single-check API is faster, but it’s not instant—sub-second, but not zero lag. Here’s the gist:
python import requests email = "example@example.com" API_KEY = os.environ.get("NEVERBOUNCE_API_KEY") resp = requests.get( "https://api.neverbounce.com/v4/single/check", params={"key": API_KEY, "email": email}, ) result = resp.json() if result["result"] == "valid": print("Email is good.") else: print("Nope. Bad email.")
When to use: - Signup forms (to block obvious junk) - Before adding new addresses to your main list
When not to bother: - If speed is critical—API calls add a bit of lag. - For bulk cleaning (it’s way slower and more expensive per check).
What about alternatives?
There are plenty of email cleaning services: ZeroBounce, BriteVerify, EmailListVerify, and more. Most do the same thing: check if an email is valid, risky, or dead. Don’t get caught up in the marketing—try a few, see which fits your workflow and budget. Neverbounce is popular mostly because its API is predictable and the docs are decent.
Watch out for: - Hidden fees (some charge extra for “catchall” domains) - Sketchy privacy policies (make sure your data isn’t resold)
Keep it simple—and keep iterating
You don’t need a fancy setup to keep your lists clean. Automate the basics, keep your scripts simple, and review results every so often. If something breaks (API changes, weird edge cases), fix and move on. Don’t chase “perfect”—just shoot for “good enough not to waste money or wreck your sender score.”
Automating email list cleaning won’t make your campaigns magical, but it’ll save you headaches and cash. That’s worth the effort.