Integrations · Sales outreach

Validate your Emailchaser leads

Check the email addresses of your Emailchaser leads and write each result into four custom variables, so each lead shows whether its address is worth mailing. A script you run on your own computer reads your leads, checks the addresses as one bulk list and writes the results back. It never deletes a lead, changes its address or name, or touches a campaign. Download it: email-validation-emailchaser.zip holds emailchaser.mjs (the script) and the MIT licence.

What you need

  • A computer with Node 22.18 or later. Nothing to install: the script has no dependencies.
  • An API key of ours from the API keys page with Validate addresses, and the permission Bulk lists (off by default: turn it on when you create the key) for more than 50 leads.
  • An Emailchaser API key: in Emailchaser, API & MCP, create an API key with the access Read & write. A read-only key can read your leads but not write the results.

Try it free first

Each checked address can use one credit, so try it with an Emailchaser workspace that holds only test leads, never your real ones. Give one test lead the address no_mailbox@sandbox.email-validation.org (sandbox checks are free; that domain receives no mail, so send it nothing), then:

cd email-validation-emailchaser            # the unzipped folder
export EMAILCHASER_API_KEY=… EV_API_KEY=…
node emailchaser.mjs --dry-run             # checks nothing, writes nothing: only counts
node emailchaser.mjs                       # checks and writes

In Windows PowerShell (5.1 or 7):

cd email-validation-emailchaser            # the unzipped folder
$env:EMAILCHASER_API_KEY = "…"; $env:EV_API_KEY = "…"
node emailchaser.mjs --dry-run             # checks nothing, writes nothing: only counts
node emailchaser.mjs                       # checks and writes

The lead's ev_status variable says invalid and ev_reason says no_mailbox. Run it once more: it reports nothing to check, because every result was written. Then delete the test lead.

Run it

node emailchaser.mjs --dry-run     # how many leads would be checked; free
node emailchaser.mjs               # checks and writes

It reads every lead of the workspace the key belongs to. Up to 50 addresses are checked one by one; more go out as one bulk list. A lead whose address already has a result is skipped (an unknown result is checked again), so a daily run checks only new and changed addresses. If a run stops, run the same command again from the same folder: it resumes the same bulk list and never pays twice (within the 30 days a list is kept). The state file (.ev-emailchaser-<workspace id>.json) lives in that folder. It prints ids and counts, never an address or a key.

Emailchaser allows 600 API requests a minute, so the script sends five a second (--rate 10 at most), about two per lead it writes. When Emailchaser refuses for its rate limit or is briefly unavailable, the script tries again three times (after 2, 4 and 8 seconds, or the wait Emailchaser names, up to a minute), then stops; run the same command again, which resumes without paying twice.

Options:

  • --region eu: checked in the EU, lists and results kept there, with the same key.
  • --revalidate: check again addresses that already have a result.
  • --state FILE: a state file of your own choosing.
  • --rate N: Emailchaser requests a second, 10 at most.
  • --wait-minutes N: how long to wait for a bulk list to finish (default 240); past it the script stops with exit code 75, and the same command run later collects the list.
  • --new-job: drop the saved bulk list (once it is no longer running) and start a new one for the leads that still have no result; their addresses are charged again.

Exit codes: 0 done; 1 a write failed or the run stopped (run it again: nothing is paid twice); 2 wrong options; 75 the bulk list was still being checked when the script stopped waiting (run it again later to collect it).

What it writes

Four custom variables on the lead (nothing to create first):

VariableHolds
ev_statusvalid, invalid, catch_all, unknown or disposable
ev_reasonthe reason, for example no_mailbox or accepted
ev_checked_atwhen it was checked
ev_address_hasha hash of the address the result belongs to, so a changed address is checked again

Spam traps and complainers are valid with a warning reason: see what each status means. Each result is written by lead id, and only while the lead still holds the address that was checked. Emailchaser replaces a lead's custom variables as a whole, so the script sends back every variable it read a moment before, as it read it, with its four set; do not edit lead variables while it runs. Emailchaser treats EV Status and ev_status as one variable, so a lead that holds one of the four in another spelling is not written (rename it, and the next run writes the kept result). The first write of a run is read back: if anything else of that lead changed, the script stops there and says so. A result that could not be written is kept in a file next to the state file and written by the next run without a new check.

End the access

Delete the Emailchaser API key where you created it, and our key on the API keys page. The four variables stay on your leads until you remove them in Emailchaser.

More on Emailchaser

Updated · Maintained by: Email Validation LLC

Need help? Contact support, or ask the help chat. Something wrong or missing on this page? Tell us