Google Sheets + VerifyAnyEmail

API recipe

Add a custom =VERIFYEMAIL() function to any Google Sheet with a short Apps Script. Paste an address in one cell and get its status in the next.

Setup

  1. 1
    Open Apps Script

    In your sheet, go to Extensions → Apps Script.

  2. 2
    Paste the script

    Replace the contents with the code below and set YOUR_API_KEY. Save.

  3. 3
    Use it in a cell

    Type =VERIFYEMAIL(A2) to get the status for the address in A2. Results are cached for 6 hours to save credits and quota.

Apps Script (Code.gs)
const VAE_API_KEY = 'YOUR_API_KEY';

/**
 * Verify an email address. Returns: deliverable | undeliverable | risky | unknown
 * @customfunction
 */
function VERIFYEMAIL(email) {
  if (!email) return '';
  const cache = CacheService.getScriptCache();
  const key = 'vae_' + email;
  const hit = cache.get(key);
  if (hit) return hit;
  const res = UrlFetchApp.fetch('https://api.verifyany.email/v1/verify', {
    method: 'post',
    contentType: 'application/json',
    headers: { Authorization: 'Bearer ' + VAE_API_KEY, 'X-VAE-Source': 'sheets' },
    payload: JSON.stringify({ email: String(email).trim() }),
    muteHttpExceptions: true,
  });
  if (res.getResponseCode() !== 200) return 'unknown';
  const status = JSON.parse(res.getContentText()).result.status;
  cache.put(key, status, 6 * 60 * 60);
  return status;
}

Handling the result

Every verification returns a result object with a status, a 0–100 score and a “did you mean” suggestion for typos. Branch on the status:

statusMeaningRecommended action
deliverableMailbox exists and accepts mailAccept
undeliverableInvalid syntax, no MX, or rejected mailboxBlock / reject
riskyAccepts but low quality (catch-all, role, disposable)Allow with caution, or challenge
unknownCouldn’t determine (greylist, timeout, blocked port)Allow (fail-open) or retry later

For sign-up and checkout forms, the safe default is to block only undeliverable so you never turn away a real customer, and to surface the suggestion (“did you mean gmail.com?”) inline to recover typos.

Security & reliability

  • Keep your API key server-side. Never expose it in client-side JavaScript. In Google Sheets, store it in the integration’s credential/secret store, not in a shared script.
  • Fail open. If the API errors or times out, let the address through rather than blocking a real user over a transient issue.
  • Retry transient errors. Back off and retry on 429 (rate limit) and 5xx; don’t retry 4xx validation errors.
  • Cache per address. One credit is spent per unique verification — cache results (e.g. 12–24h) so re-submits don’t re-charge.
  • Tag the source. This recipe sends X-VAE-Source: sheets so your dashboard shows where verifications come from.

Troubleshooting

ResponseCause & fix
401Missing or wrong API key — check the Authorization header is Bearer YOUR_API_KEY.
402Out of credits — top up in the dashboard. (The plugin fails open in this case.)
429Rate limited — slow down or upgrade your plan; back off and retry.
No result writtenConfirm you’re reading result.status, and that the request body is { "email": "…" } as JSON.

This is an API recipe, not a one-click app — you wire it up once with the steps above. See the full API reference for every field and error code.

You’ll need a VerifyAnyEmail API key — create a free account and find it in the dashboard under API keys. New accounts include free verification credits.