Integrations · Sales outreach

Clean Woodpecker prospects before you send

Check the prospects of a Woodpecker campaign, or all your prospects, before you send, and tag each prospect with its status, so your campaigns can leave out the prospects you should not mail. The script reads the prospects, checks them as one bulk list, tells you what it will cost and asks before it spends anything. It never deletes a prospect, never removes one from a campaign, never changes a prospect's status, and changes nothing but its tags and its import batch name, which Woodpecker's update replaces (see What it writes). Download it: email-validation-woodpecker.zip holds woodpecker.mjs, one file, and the MIT licence.

What you need

  • A computer with Node 22.18 or later. The script has no browser-only option. Nothing to install: it has no dependencies. With only a browser, export the prospects from Woodpecker as a CSV file and upload it as a bulk list on our site instead; you then act on the results file yourself.
  • An API key of ours from the API keys page with the permission Bulk lists (off by default: turn it on when you create the key). With Read balance and usage too, the script shows your balance before it asks.
  • A Woodpecker API key: in Woodpecker, Add-ons → API & Integrations → API keys → Create a key. Woodpecker's API needs the API Key and Integrations add-on on your Woodpecker account; without it the script stops and says so. On an agency account, use a key of the client company whose prospects you check. Keep the key like a password.

Run it

cd email-validation-woodpecker                   # the unzipped folder
export EV_API_KEY=…  WOODPECKER_API_KEY=…
node woodpecker.mjs --lists                      # your campaigns, with their ids, prospect counts and statuses
node woodpecker.mjs --campaign <id> --dry-run    # what it would check and the most it would cost; spends nothing
node woodpecker.mjs --campaign <id>              # asks, then checks and tags the prospects
node woodpecker.mjs --all-prospects --yes        # every prospect, without asking (for a scheduled run)

Before it spends, the script shows the prospects it will check, the distinct addresses, the most credits it will use (one per distinct address; unknown results, duplicates and malformed addresses are free) and your balance, and asks you to confirm. With --yes it goes on without asking; without a terminal and without --yes it stops before spending.

It checks the prospects that have an address and no status tag yet (or #EV_STATUS_UNKNOWN), and skips bounced, blacklisted and invalid prospects. It also skips, without charging, a prospect with a tag that does not start with #: it could not send that prospect's tags back unchanged. --revalidate also checks prospects that already have a status; --include-stopped also checks bounced, blacklisted and invalid ones. --region eu checks and keeps the list in the EU, with the same key.

Woodpecker handles one API request of your account at a time. The script never sends two at once and spaces them (--rate N requests a second, 4 by default, at most 10), so your other Woodpecker integrations keep working; when Woodpecker answers "too many requests" it waits and tries again.

What it writes

Prospect tagMeaning
#EV_STATUS_VALID, #EV_STATUS_INVALID, #EV_STATUS_CATCH_ALL, #EV_STATUS_UNKNOWN, #EV_STATUS_DISPOSABLEthe status
#EV_ACTION_SEND, #EV_ACTION_SEND_WITH_CAUTION, #EV_ACTION_REMOVE, #EV_ACTION_RETRY_LATERwhat to do with the address

Leave out the prospects tagged #EV_ACTION_REMOVE: that includes spam traps and complainers, which are #EV_STATUS_VALID with #EV_ACTION_REMOVE. A new check replaces the two old tags. Every other tag of the prospect stays as it is: the script reads each prospect again right before it writes and sends its tags back with ours replaced. A prospect whose address changed since the check is not tagged; the next run checks its new address.

Woodpecker's prospect update replaces the import batch name shown in the "imported" column, and its API does not return the old name, so the script cannot keep it: each prospect it tags shows "email-validation.org check" there instead, so you can see what changed it. A prospect that already has the same two tags is not written again and keeps its import name. Nothing else of the prospect changes: address, name, snippets, status and campaigns stay as they are.

Run it again

Run the same command again after any stop (no credits, a closed laptop, the bulk list still running): it resumes the same bulk list and never pays twice (within the 30 days a list is kept). Run it from the same folder each time (or pass the same --state FILE): the file it keeps there holds the bulk list it is working on, never an address or a key. Prospects already tagged are skipped. When every prospect is tagged, that file is removed and the next run checks only prospects without a status tag (or with #EV_STATUS_UNKNOWN), such as new ones, so you can run it on a schedule with --yes.

If Woodpecker refuses a prospect for good (the report names its code, for example E_INV_STATUS) while it accepts the others, the run finishes: the address is recorded in a file next to the state file (<state file>.refused.json: the upload's reference, the code and a hash of the address, never the address), and later runs do not check or charge for it again while it stays the same; a prospect whose address changed is checked again. Delete that file to have them checked, and charged, again. When Woodpecker refuses most prospects of a run, the run keeps the bulk list and exits 1; run it again once Woodpecker accepts the writes (nothing is charged twice). Refused again then, they are recorded.

Exit codes: 0 done (or you answered no), 1 a write failed or the run stopped (run it again), 2 wrong arguments, 75 the bulk list was still running when the script stopped waiting (run it again later).

The script prints counts, prospect ids, job ids and the campaign's name, never an address or a key.

More on Woodpecker

Updated · Maintained by: Email Validation LLC

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