DEV Community

George Kioko
George Kioko

Posted on

I built a $0.002 email validator because ZeroBounce was killing my margins on a freelance gig

A client paid me a fixed fee to clean a 47k email list. Sounded fine on paper. Then I priced the verification step.

ZeroBounce minimum is 2,000 credits for $39, so $0.0195 per email at the cheapest pay-as-you-go rate. Their subscription gets you to about $0.0099 per email at 10k volume. For my 47k list that is $462 PAYG or $235 if I commit to a monthly plan I will not need next month. The freelance fee was a flat number. The math was getting ugly.

I have an Apify account and a small list of standby actors that bill per call. So I went to check what an SMTP MX validator actually costs to run.

What is in a real validation

If you scope it tight there are five checks that catch most of the garbage:

  1. RFC 5322 syntax (regex on the local part and domain).
  2. Disposable domain list (Mailinator, 10MinuteMail, 1.4k entries that move slowly).
  3. Free provider tag (Gmail, Yahoo, etc, useful for B2B scoring not deliverability).
  4. MX record lookup via DNS.
  5. Optional SMTP handshake that opens a TCP connection to the MX host on port 25 and reads the banner. No data sent.

The first four are local computation. Microseconds. The SMTP step is the only thing that costs a network round trip and most ISPs will give you a clean answer in under 2 seconds.

The actor

I wrote it as a standby HTTP server on Apify. One endpoint, JSON in, JSON out. Billed per email via Actor.charge. Pay only on a successful return.

curl -X POST 'https://george-the-developer--email-validator-api.apify.actor/?token=YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"email":"someone@somewhere.com"}'
Enter fullscreen mode Exit fullscreen mode

Returns:

{
  "email": "someone@somewhere.com",
  "valid_syntax": true,
  "is_disposable": false,
  "is_free": false,
  "mx_records": ["mail.somewhere.com"],
  "smtp_check": "deliverable",
  "score": 0.95
}
Enter fullscreen mode Exit fullscreen mode

Per call cost is $0.002. For my 47k list that came out to roughly $94 of compute, not $462. The shape of the gig changed.

Architecture

flowchart LR
  Client[Client API call] --> Standby[Apify Standby Actor]
  Standby --> Syntax[RFC 5322 check]
  Syntax --> Disposable[Disposable domain list]
  Disposable --> MX[DNS MX lookup]
  MX --> SMTP[SMTP handshake on :25]
  SMTP --> Charge[Actor.charge per email]
  Charge --> Resp[(JSON response)]
Enter fullscreen mode Exit fullscreen mode

What it does not do

I want to be honest about scope. It does not do role-based detection beyond a simple list of info@, support@, sales@, etc. It does not do toxicity scoring or abuse history, that needs a paid feed. It does not catch every catch-all domain, which is a known industry problem and not solvable with public DNS alone. ZeroBounce charges more partly because they aggregate proprietary signals from their customer base. Worth it if you are validating cold lists for cold outreach. Less worth it if you are cleaning a list of people who already opted in.

Per call vs flat subscription

The shape that bugged me about SaaS validators is the cap. You pay $79 a month and you get a fixed bucket of credits. If your usage is bursty (one client every few weeks) most of that bucket evaporates. If your usage is steady the math works out. But solo and freelance work is bursty by definition. Per call billing matches the work. No cap, no commitment, just a number per email.

Numbers from the gig

47,219 emails through the actor. Run completed in 38 minutes on the lowest memory tier. About 3.1k emails came back as undeliverable, 1.2k as disposable, 41.5k as deliverable. The client took the cleaned list and ran their own send. I did not have to think about a credit pool.

When this is the wrong call

If you are running enterprise email marketing at 10M sends a month, ZeroBounce or NeverBounce or Bouncer probably fit you. They have account managers, SLA contracts, GDPR paperwork. I am one developer with an Apify account. If you need that other thing, go pay for it.

If you are a freelancer cleaning a list, or a small agency that runs verification once a month, per call billing solves your specific problem.

Try it

Actor is at apify.com/george.the.developer/email-validator-api. Free to try if you have an Apify account, billed per call. Source for the docs and curl examples is at github.com/the-ai-entrepreneur-ai-hub/email-validator-api-docs (I keep the actor itself private but the call surface is documented).

If anyone has run into the same SaaS-cap problem with their own freelance gigs, would love to hear what you ended up using.


Originally published on Hashnode.

Top comments (0)