If you’re tired of manually hunting down emails for your sales pipeline, you’re not alone. Most lead generation tasks are repetitive, boring, and easy to mess up if you’re doing them by hand. This guide is for anyone who wants to actually automate the finding of valid business email addresses—no fluff, just the steps, code, and gotchas. We’ll use the Anymailfinder API, because it’s built for this exact job.
Let’s get straight into making your lead gen workflow less painful and more reliable.
Step 1: Know What You Can (and Can’t) Automate with Anymailfinder
Before you start wiring things together, get clear on what Anymailfinder actually does:
- It finds emails for domains and people’s names. Given a company domain and a person’s name, it tries to find their work email—either from its database or by guessing and validating patterns.
- It’s not a scraper. You can’t just throw in a LinkedIn URL or a company name and expect magic. You need real data: names and domains.
- It’s not perfect. It’ll miss people, especially if you feed it junk data, or if the company uses weird email formats.
What works: Automating the search for emails when you already have a list of names and company domains.
What doesn’t: Getting emails from just a company name, or expecting 100% accuracy.
Skip this tool if: Your workflow starts with social media profiles, phone numbers, or anything besides names and domains.
Step 2: Get Your API Key and Set Up Your Environment
You’ll need an Anymailfinder account with API access. Here’s what to do:
- Sign up & get your API key.
- Create an account on their site.
- Head to your dashboard, find your API key, and copy it somewhere safe.
- Pick your tools.
- You’ll need something to make HTTP requests. Python works well, but you could use anything (Node, curl, Zapier, etc.).
- Have your list of names and domains ready. CSV, spreadsheet, or database—all fine.
Pro tip: Don’t put your API key in code you’ll share. Use environment variables or a config file.
Step 3: Understand the API Basics (Don’t Skip This)
Here’s the endpoint you’ll use most:
GET https://api.anymailfinder.com/v4.2/search?domain=example.com&first=Jane&last=Doe
- Headers: You need an
Authorization
header:Authorization: Bearer YOUR_API_KEY
- Parameters: You need at least the domain, and usually first and last name.
Sample response:
You’ll get a JSON back. Here’s the bit you care about:
json { "email": "jane.doe@example.com", "result": "verified" // or "guessed", or "unknown" }
What to look for:
- verified
means they’re confident.
- guessed
means it matches their pattern, but not 100%.
- unknown
means you’re out of luck—move on.
Pitfalls: - Don’t hammer the API. There are rate limits. - If your data is messy (e.g., missing last names), your hit rate will drop fast. - Anymailfinder sometimes returns “guessed” emails. Don’t treat those as gospel.
Step 4: Write a Script to Automate It
Here’s a real-world Python example. This script reads a CSV of names/domains and writes results to a new CSV.
python import csv import os import requests
API_KEY = os.getenv('ANYMAILFINDER_API_KEY')
def find_email(domain, first, last): url = 'https://api.anymailfinder.com/v4.2/search' headers = { "Authorization": f"Bearer {API_KEY}" } params = { "domain": domain, "first": first, "last": last } response = requests.get(url, headers=headers, params=params) if response.status_code == 200: data = response.json() return data.get('email', ''), data.get('result', '') else: return '', ''
with open('input.csv', newline='') as infile, open('output.csv', 'w', newline='') as outfile: reader = csv.DictReader(infile) fieldnames = reader.fieldnames + ['found_email', 'result'] writer = csv.DictWriter(outfile, fieldnames=fieldnames) writer.writeheader() for row in reader: email, result = find_email(row['domain'], row['first'], row['last']) row['found_email'] = email row['result'] = result writer.writerow(row)
How to use:
- Your input.csv
should have columns: first
, last
, domain
.
- Set your API key as an environment variable:
export ANYMAILFINDER_API_KEY=your_key_here
- Run the script. Check output.csv
for results.
What’s good:
- This scales to thousands of leads if you’re careful with rate limits.
- CSV in, CSV out—easy to connect with other tools.
What’s not:
- If you feed in bad data, you’ll get garbage back.
- “Guessed” results need further verification (don’t just blast cold emails without checking).
Step 5: Filter and Verify Your Results
Not every result is gold. Here’s how to clean up the output:
- Only use ‘verified’ emails for outreach.
“Guessed” can be wrong, and “unknown” is a dead end. - Consider a secondary check.
Use another email verification service if you’re sending big campaigns—this keeps your domain off spam lists. - Don’t chase every single lead.
If someone’s email is always missing, maybe they’re not reachable for a reason.
Pro tip:
Automate the filtering step. A simple script to keep only result == 'verified'
saves a lot of headaches.
Step 6: Plug It Into Your Workflow
Automation is only useful if it actually saves you time. Here’s how people typically use Anymailfinder in a bigger system:
- Combine with LinkedIn scraping:
Use another tool to find names and company domains, then pass the cleaned list to your script. - Push into your CRM:
Most CRMs let you import CSVs, or you can use Zapier or a custom integration. - Schedule regular runs:
Set your script to run nightly or weekly as new leads come in.
What to ignore: - Don’t bother with complex “AI enrichment” plugins unless you know exactly what problem they solve for you. - Avoid overengineering. A simple CSV workflow beats a brittle, “all-in-one” automation that breaks when one thing changes.
Step 7: Watch Out for Common Pitfalls
- API limits and costs:
Anymailfinder charges per request. Don’t burn through credits testing junk data. - Data privacy:
Don’t store or share emails without thinking through consent and compliance (especially outside the US). - Overpromising deliverability:
No email finder is 100%. Always expect some bounce-backs and undelivered messages.
When the tool fails:
- If you’re consistently not finding emails for a sector or company, they may use catch-alls or just don’t publish emails. Don’t waste time—move on.
Keep It Simple—And Iterate
Automating lead generation with Anymailfinder’s API isn’t rocket science, but it’s not push-button magic either. Start with a basic script, use clean data, and focus on what actually gets you results. Don’t chase perfection or get lost in integrations you don’t need yet.
Build, test, and tweak—your future self will thank you.