# Email Validation API: Bulk List Cleaning, Risk and Typo Check (`nabeelbaghoor/email-address-validation-api`) Actor

Email validation API and bulk email verifier: deliverable, undeliverable, catch-all and do-not-send results, risk level, disposable and role address flags, typo suggestions and bulk list cleaning jobs with summaries, on US or EU hosts (Mailgun Validate). Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/email-address-validation-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Developer tools, Lead generation, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 email validation results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Email Validation API: Bulk List Cleaning, Risk and Typo Check

Validate email addresses in real time or clean a whole list in one bulk job, with deliverable, undeliverable, catch-all and do-not-send results, a risk level, the reasons behind each verdict, disposable and role address flags and typo suggestions, as clean rows you can export to CSV, Excel or JSON.

This actor wraps the Mailgun Validate API v4 (Mailgun's email verification service) on the US or EU host: single address validation, bulk list validation jobs and List Health Preview job reads. Use it for sign-up form checks, CRM and lead list hygiene, bounce prevention before a campaign, and sender reputation protection. Bring your own Mailgun private API key.

BYOK, not live tested: every route, parameter and response field comes from Mailgun's own OpenAPI description and guides (documentation.mailgun.com), and every route was probed on 2026-11-05 with an invalid key of realistic length. The routes have not been run against a live key.

### What it does

- **Email validation**: one real-time result per address: `result` (deliverable, undeliverable, do_not_send, catch_all or unknown), `risk` (high, medium, low or unknown), `reasons` such as mailbox_does_not_exist, no_mx, high_risk_domain or catch_all, plus `isDisposableAddress`, `isRoleAddress`, `didYouMean` for domain typos, `rootAddress` for aliases and engagement data where Mailgun has it.
- **Keep only what you need**: keep all results, deliverable addresses only, or drop undeliverable and do_not_send addresses. Left out rows are not charged.
- **Provider lookup switch**: let Mailgun ask the mailbox provider when its own data is not enough (the API default), or turn it off for a data-only check.
- **Bulk list validation**: the addresses become one CSV bulk job; the actor waits until Mailgun finishes and returns one summary row with result, risk and engagement counts and the CSV and JSON download links of the full results.
- **Validation jobs**: read the status and summary of existing bulk jobs or List Health Preview jobs, by job ID or all at once.
- **US and EU hosts**: pick the region your Mailgun account lives in.
- **Safe by design**: no email is ever sent, and no job is cancelled, deleted or promoted to a paid job. Lines that are not email addresses are skipped without a call and cost nothing.

### What you need

A Mailgun account whose plan includes Mailgun Validate. The actor never signs up or buys anything for you.

1. Log in to Mailgun and open **Account Settings**, **API Keys**.
2. Copy your **private API key**.
3. Paste it into the **Mailgun private API key** field (or set the DATA_API_KEY secret) and pick your account region. The key is sent only as HTTP Basic auth (user `api`) to api.mailgun.net or api.eu.mailgun.net, and is removed from every log line and message.

### Input

| Field | Modes | Notes |
| --- | --- | --- |
| `mode` | all | `validateAddresses`, `bulkValidation`, `validationJobs` |
| `apiKey` | all | your Mailgun private API key; falls back to the DATA_API_KEY secret |
| `region` | all | `us` (default) or `eu` |
| `addresses` | validateAddresses, bulkValidation | one email address per line, at most 512 characters |
| `providerLookup` | validateAddresses | on by default |
| `resultFilter` | validateAddresses | `all`, `deliverable`, `dropUndeliverable` |
| `jobName` | bulkValidation | unique job name, no @; generated when empty |
| `waitMinutes` | bulkValidation | how long to wait for the job (default 30) |
| `jobType` | validationJobs | `bulk` or `preview` |
| `jobIds` | validationJobs | job names; empty lists every job |
| `maxResults` | all | stop after this many rows (default 1,000) |

Example input:

```json
{
    "mode": "validateAddresses",
    "region": "us",
    "addresses": ["john.smith@example.com", "sales@example.org", "jane@gmial.com"],
    "providerLookup": true,
    "resultFilter": "all"
}
```

### Output

An email validation row (the values are illustrative):

```json
{
    "recordType": "validation",
    "found": true,
    "mode": "validateAddresses",
    "query": "jane@gmial.com",
    "region": "us",
    "address": "jane@gmial.com",
    "domain": "gmial.com",
    "result": "undeliverable",
    "risk": "high",
    "isDeliverable": false,
    "reasons": ["no_mx"],
    "reasonText": "no_mx",
    "isDisposableAddress": false,
    "isRoleAddress": false,
    "didYouMean": "jane@gmail.com"
}
```

A bulk job row carries `jobId`, `status`, `isFinished`, `quantity`, `recordsProcessed`, `createdAt`, `deliverable`, `undeliverable`, `doNotSend`, `catchAll`, `unknown`, `riskHigh`, `riskMedium`, `riskLow`, `riskUnknown`, engagement counts when present, `downloadCsvUrl` and `downloadJsonUrl`. List Health Preview rows carry the same columns with `summaryUnit` set to `percent`, because previews summarise a sample.

### Pricing

Pay per event, only for rows with data:

| Event | Price |
| --- | --- |
| Email validation result | $0.005 |
| Validation job summary (bulk or preview job with a summary) | $0.01 |

Mailgun bills the validations themselves to your Mailgun account, separately from this actor.

### FAQ

#### What is the Mailgun Validate API?

Mailgun Validate is the email verification service of Mailgun, the email delivery platform. Its v4 API checks an address with syntax checks, DNS and MX validation, spell checks, provider specific mailbox grammar and mailbox detection, and returns a result, a risk level and the reasons.

#### What do deliverable, undeliverable, do_not_send, catch_all and unknown mean?

Deliverable addresses should accept email. Undeliverable addresses will bounce. do_not_send addresses are highly risky and would hurt your sending reputation. catch_all means the domain accepts all mail, so the mailbox cannot be confirmed. unknown means the check was inconclusive; the `reasons` column says why.

#### Does it detect disposable, role and typo addresses?

Yes. `isDisposableAddress` flags temporary inbox domains, `isRoleAddress` flags mailboxes such as admin@, sales@ or support@, and `didYouMean` suggests the closest domain when the domain looks like a typo, such as gmial.com for gmail.com.

#### When should I use bulk list validation instead of single validation?

Use single validation for sign-up forms and lists up to a few thousand addresses, when you want one row per address. Use bulk list validation for large lists: Mailgun processes the CSV as one job and the actor returns a summary row with download links to the full per-address results. Mailgun allows up to 5 bulk jobs in parallel and 25MB per file.

#### Does it work with an EU Mailgun account?

Yes. Set the region to EU and the actor calls api.eu.mailgun.net, where Mailgun serves single and bulk validation for EU accounts.

#### Does it send any email?

No. Only validation and job read routes are called. Sending, cancelling or deleting jobs and promoting a preview to a paid job are never called.

#### What do I pay?

$0.005 per validated address and $0.01 per job summary to this actor, plus whatever your Mailgun plan charges for the validations. Skipped lines, filtered out rows, running jobs without a summary, empty answers and refused lookups are free.

### Keyword map

email validation API, email verification API, email verifier, bulk email verifier, email list cleaning, email deliverability check, catch-all detection, disposable email detection, role address detection, email typo correction, bounce prevention, Mailgun Validate API, Mailgun email validation.

### Routes and verification

| Mode | Route | Probe with an invalid 50 character key (twice) |
| --- | --- | --- |
| Email validation | GET /v4/address/validate (address, provider_lookup) | 401 JSON "Invalid private key" on US and EU hosts |
| Bulk list validation | POST /v4/address/validate/bulk/{list_id}, then GET /v4/address/validate/bulk/{list_id} | 401 JSON "Invalid private key" |
| Validation jobs | GET /v4/address/validate/bulk, GET /v4/address/validate/preview and their /{list_id} routes | 401 JSON "Invalid private key" |
| Invented control routes | /v4/address/validatez, /v4/address/validate/bulkz, /v4/address/validate/previewz | 404 JSON "not found" |

### Licensing and data use

This actor works only with your own Mailgun key, and your agreement with Mailgun applies, including its Acceptable Use Policy: Mailgun intends validation for addresses collected through your own forms, registrations and customer lists. Validation results are deliverables for your internal use; the addresses you validate remain your own customer data. This actor is not affiliated with or endorsed by Mailgun.

# Actor input Schema

## `mode` (type: `string`):

Each mode calls documented Mailgun Validate API v4 routes with your own private API key. No email is ever sent, and no job is cancelled or deleted.

## `apiKey` (type: `string`):

Your own Mailgun private API key: in the Mailgun dashboard open Account Settings, API Keys. Sent only as HTTP Basic auth (user api) to the Mailgun API host you pick below, and removed from every log line. Validations are billed by Mailgun to that account. Leave empty to use the DATA_API_KEY secret.

## `region` (type: `string`):

The region your Mailgun account is hosted in. US calls api.mailgun.net, EU calls api.eu.mailgun.net. A key used on the wrong region is refused.

## `addresses` (type: `array`):

Email validation and Bulk list validation. One email address per line, at most 512 characters each. Duplicates are sent once, and lines that are not an email address are skipped for free.

## `providerLookup` (type: `boolean`):

Email validation. On (the API default), Mailgun may contact the mailbox provider when its own data is not enough. Off, an address Mailgun has no data on comes back as unknown with the reason no_data.

## `resultFilter` (type: `string`):

Email validation. Which validated addresses to keep in the dataset. Every address is still validated (and billed by Mailgun); left out rows are not charged by this actor.

## `jobName` (type: `string`):

Bulk list validation. A unique name for the new job: letters, digits, dots, dashes and underscores, no @. Leave empty for apify-validation plus the date and time. Mailgun runs at most 5 bulk jobs in parallel per account.

## `waitMinutes` (type: `integer`):

Bulk list validation. How long to keep checking the new job before ending the run. A job still running after this is saved as a free row; read it later with the Validation jobs mode.

## `jobType` (type: `string`):

Validation jobs. Bulk validation jobs or List Health Preview jobs.

## `jobIds` (type: `array`):

Validation jobs. One job name per line, as given when the job was created. Leave empty to list every job of the chosen type (bulk jobs: up to 500, newest first).

## `maxResults` (type: `integer`):

The run stops after this many rows. In Email validation mode it also caps how many addresses are sent.

## Actor input object example

```json
{
  "mode": "validateAddresses",
  "region": "us",
  "addresses": [
    "john.smith@example.com"
  ],
  "providerLookup": true,
  "resultFilter": "all",
  "waitMinutes": 30,
  "jobType": "bulk",
  "maxResults": 1000
}
```

# Actor output Schema

## `records` (type: `string`):

One row per address validated or job read.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "addresses": [
        "john.smith@example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/email-address-validation-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "addresses": ["john.smith@example.com"] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/email-address-validation-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "addresses": [
    "john.smith@example.com"
  ]
}' |
apify call nabeelbaghoor/email-address-validation-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/email-address-validation-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AelnUnxnL2UgcPzTV/builds/TcnSeyuL962tiD1og/openapi.json
