Integrations · Frameworks and SDKs
Command-line tool
email-validation checks one address, checks a whole file as one bulk list, and shows your balance, from a terminal or a script. The tool is free and MIT-licensed, is built on our JavaScript client library and needs Node.js 24 or later.
Status: setup guide. The tool is on npm as @email-validation/cli.
Install and check a first address
Install it:
npm install -g @email-validation/cliCreate a key on the API keys page and give it to the tool without leaving it in your shell history (paste the key, then press Enter):
read -rs EV_API_KEY && export EV_API_KEYIn PowerShell, see Windows.
Check a free test address:
email-validation validate accepted@sandbox.email-validation.orgIt prints the address's status (
valid), the reason (accepted), the action and the credits used. Test addresses are answered without a check and cost nothing.
Commands
email-validation validate <email> [--json]
email-validation bulk <file.csv|file.txt> [--out <results.csv>] [--column <n|name>] [--[no-]header] [--force] [--json]
email-validation bulk --resume <job_id> [--out <results.csv>] [--force] [--json]
email-validation credits [--json]- validate prints the address's status, reason and action and, for a likely typo, the address it may have meant. One credit, except
unknownresults, malformed addresses and test addresses, which are free. - bulk sends a CSV file (the API finds the email column and a header row) or a file with one address per line as one bulk list, shows its progress and saves the results beside it (
list.csvgiveslist.results.csv;--outpicks another path; an existing file is replaced only with--force). The key needs the Bulk lists permission. Credits are held when the job starts. Files up to 100 MB. - credits shows your balance, pending credits and when credits expire. Free.
--jsonprints the API's JSON instead of text (for bulk: the finished job).--region eu, orEV_REGION=eu, sends the requests tohttps://api-eu.email-validation.org, where addresses are validated in the EU and their results stored there (EU data residency). The same key and credits work on both.email-validation --helplists every option.
Bulk lists and Ctrl-C
The tool creates the job, saves its id in a job note on your computer (ids only, never addresses), and only then starts it. Until its results are saved, running the same command again on the same file follows that job instead of creating a second one, so an interrupted list is never paid for twice (within the 30 days a list is kept). Once the results are saved, the note is gone: a later run of the same file, with --force to replace the results file, is a new list and is charged again. A changed file is a new list too.
Ctrl-C stops the waiting, not the job: the tool prints the job id and the command that picks it up again, for example email-validation bulk --resume <job_id> --out list.results.csv. --resume never creates a job.
While it waits, lost connections and busy answers are retried with a growing pause, for as long as the job runs. An upload whose answer is lost is never sent again: find the job under your bulk jobs in the dashboard, then start it there or with --resume.
The key
The key comes from EV_API_KEY or from --api-key-file <path>, a file holding only the key. There is no --api-key flag: a key typed in a command is saved in your shell history, and so is export EV_API_KEY=… typed at the prompt. The tool never prints the key, and its progress lines show job ids and counts, never addresses. Read more on authentication and API keys.
Windows
The tool runs in PowerShell and cmd.exe as well. To set the key in PowerShell without echoing or saving it, run this and paste the key:
$env:EV_API_KEY = [Net.NetworkCredential]::new('', (Read-Host -AsSecureString)).Password- A key file must be saved as UTF-8 or ASCII text. Windows PowerShell 5.1's
Out-Fileand>write UTF-16, which the tool cannot read. - Job notes are kept in
%LOCALAPPDATA%\email-validation\jobs(on macOS and Linux in~/.local/state/email-validation/jobs, or under$XDG_STATE_HOMEwhen it is set). - The resume command the tool prints puts paths in single quotes, as macOS and Linux shells read them. PowerShell reads them too, unless the path holds a
'; in cmd.exe, change them to double quotes. The next release quotes paths for Windows by itself.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Done (for validate: whatever the address's status) |
| 1 | API error, network failure, or a bulk job that failed, was cancelled or expired |
| 2 | Usage error: bad arguments, no key, a missing or empty file (nothing was sent) |
| 3 | The key was refused (401) or may not do this (403) |
| 4 | Not enough credits (402, or a bulk job waiting for credits) |
| 5 | Still rate limited (429) after the automatic retries |
| 130 | Interrupted (Ctrl-C) |