# Email Validator — Syntax, MX & Risk Checks (`muhammadafzal/email-address-validator`) Actor

Validate email addresses in bulk. Checks syntax, IDNA-normalized domains, DNS, MX records, disposable domains, role accounts, free providers, and returns one structured record per email.

- **URL**: https://apify.com/muhammadafzal/email-address-validator.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Developer tools, Lead generation, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / 1,000 email validateds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Email Validator - Syntax, MX & Risk Checks

Validate email addresses in bulk with a deterministic Apify Actor built for lead cleaning, CRM hygiene, signup screening, and AI-agent workflows. It checks mailbox syntax, IDNA-normalized domains, DNS records, MX records, disposable domains, role accounts, and common free email providers, then returns one structured dataset row per email.

Use this actor when you need a fast, transparent email validation pass before enrichment, outreach, CRM import, or marketing automation. Do not use it as proof that a specific mailbox inbox exists; the actor does not perform SMTP handshakes, send messages, bypass catch-all domains, or verify human ownership of an address.

### Output

| Field | Description |
| --- | --- |
| `email` | Original input email address. |
| `normalizedEmail` | Trimmed email with IDNA ASCII domain normalization. |
| `status` | `valid`, `risky`, or `invalid`. |
| `confidence` | Score from `0` to `1` for easy filtering. |
| `syntaxValid` | Whether the address matches a safe RFC-style mailbox pattern. |
| `domainAscii` | DNS-safe domain used for lookups. |
| `hasMx` | Whether MX records exist when MX checks are enabled. |
| `isDisposable` | Whether the domain is in the built-in temporary mailbox list. |
| `isRoleAccount` | Whether the mailbox is generic, such as `sales@` or `support@`. |
| `isFreeProvider` | Whether the domain is a common consumer email provider. |
| `reasons` | Human-readable explanation for the result. |

### Pricing

Pay per event is enabled:

- Actor start: `$0.00005` per run
- Email validated: `$0.0002` per email processed

A typical 1,000-email run costs about `$0.20` plus the small actor start event and standard Apify platform usage.

### Input

You can provide email addresses in two ways:

- `emails`: a list with one email per item
- `emailText`: pasted text; the actor extracts email-looking strings

Duplicate addresses are removed case-insensitively before validation. `maxEmails` caps how many unique addresses are processed in one run.

### Validation Logic

The actor marks hard failures as `invalid`, including malformed syntax, DNS failures when DNS checks are enabled, MX failures when MX checks are enabled, and disposable domains when `allowDisposable` is false. It marks usable but lower-quality addresses as `risky`, including free providers and role accounts when role accounts are not allowed. Clean addresses that pass enabled checks are marked `valid`.

DNS behavior is controlled by `checkDns` and `checkMx`. Keep both enabled for production cleaning. Turn them off only for fast local syntax-only testing or when your network environment blocks DNS lookups.

### Example Input

```json
{
  "emails": [
    "alex@example.com",
    "sales@example.org",
    "bad@@example"
  ],
  "checkDns": true,
  "checkMx": true,
  "allowDisposable": false,
  "allowRoleAccounts": true,
  "maxEmails": 1000
}
````

### Example Output Item

```json
{
  "email": "alex@example.com",
  "normalizedEmail": "alex@example.com",
  "isValid": true,
  "status": "valid",
  "confidence": 0.95,
  "syntaxValid": true,
  "domain": "example.com",
  "domainAscii": "example.com",
  "localPart": "alex",
  "dnsChecked": true,
  "domainHasDns": true,
  "mxChecked": true,
  "mxRecords": ["mail.example.com"],
  "hasMx": true,
  "isDisposable": false,
  "isRoleAccount": false,
  "isFreeProvider": false,
  "reasons": ["Email passed all enabled validation checks."],
  "checkedAt": "2026-07-08T05:00:00.000Z"
}
```

### API Usage

```bash
apify call USERNAME/email-address-validator --input='{
  "emails": ["alex@example.com", "bad@@example"],
  "checkDns": true,
  "checkMx": true
}'
```

### Python Client

```python
from apify_client import ApifyClient

client = ApifyClient("APIFY_TOKEN")
run = client.actor("USERNAME/email-address-validator").call(run_input={
    "emails": ["alex@example.com", "bad@@example"],
    "checkDns": True,
    "checkMx": True,
})

items = client.dataset(run["defaultDatasetId"]).list_items().items
```

### Limitations

This actor does not send email, log in to mail providers, or guarantee a human reads the mailbox. Some domains accept all mail through catch-all routing, and DNS success does not prove an individual inbox exists. Disposable-domain detection uses a curated built-in list, not a paid real-time global feed.

### Legal

Use email validation responsibly and comply with applicable privacy, anti-spam, and marketing laws, including CAN-SPAM, GDPR, and local consent requirements. The actor is a data-quality utility, not permission to contact people.

# Actor input Schema

## `emails` (type: `array`):

List of email addresses to validate. Use one mailbox per item, for example alex@example.com. Defaults to the sample address when no task input is edited. NOT a list of names, websites, or lead objects.

## `emailText` (type: `string`):

Optional pasted text scanned for email addresses. Accepts raw text such as 'Contact alex@example.com and sales@example.org'. Defaults to empty text. NOT used for names or phone extraction.

## `checkDns` (type: `boolean`):

Verifies the domain has DNS records. Uses A, AAAA, or MX lookups, for example example.com. Defaults to true for stronger validation. NOT an SMTP inbox-delivery test.

## `checkMx` (type: `boolean`):

Verifies that the email domain accepts mail through MX records. Uses DNS MX lookup, for example gmail.com. Defaults to true and may mark domains without MX as invalid. NOT a mailbox ping or SMTP login.

## `allowDisposable` (type: `boolean`):

Controls whether known temporary mailbox domains can pass. Example disposable domains include mailinator.com and yopmail.com. Defaults to false for lead-quality workflows. NOT a full real-time disposable-domain subscription.

## `allowRoleAccounts` (type: `boolean`):

Controls whether generic addresses such as info@, sales@, or support@ can pass without a risk flag. Defaults to true because many business contacts use shared inboxes. NOT a person-name verification check.

## `outputInvalidOnly` (type: `boolean`):

Writes only invalid records to the dataset while still counting all checked emails in OUTPUT. Use this when cleaning a large list and only needing rejects. Defaults to false so every email gets a row. NOT a filter that skips validation or billing.

## `maxEmails` (type: `integer`):

Maximum number of unique email addresses processed in one run. Accepts 1 to 10000, for example 500. Defaults to 1000 to keep runs predictable. NOT the number of rows guaranteed in output when invalid-only mode is enabled.

## Actor input object example

```json
{
  "emails": [
    "john@apify.com",
    "sales@example.org",
    "bad@@example"
  ],
  "emailText": "",
  "checkDns": true,
  "checkMx": true,
  "allowDisposable": false,
  "allowRoleAccounts": true,
  "outputInvalidOnly": false,
  "maxEmails": 1000
}
```

# Actor output Schema

## `summary` (type: `string`):

Link to the OUTPUT key containing total, valid, risky, invalid, DNS settings, and estimated PPE cost.

## `results` (type: `string`):

Link to dataset items. Each item is one validated email address with status, confidence, DNS, MX, and risk fields.

# 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 = {
    "emails": [
        "john@apify.com",
        "sales@example.org",
        "bad@@example"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/email-address-validator").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 = { "emails": [
        "john@apify.com",
        "sales@example.org",
        "bad@@example",
    ] }

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

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

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

```

## CLI example

```bash
echo '{
  "emails": [
    "john@apify.com",
    "sales@example.org",
    "bad@@example"
  ]
}' |
apify call muhammadafzal/email-address-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=muhammadafzal/email-address-validator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Email Validator — Syntax, MX & Risk Checks",
        "description": "Validate email addresses in bulk. Checks syntax, IDNA-normalized domains, DNS, MX records, disposable domains, role accounts, free providers, and returns one structured record per email.",
        "version": "1.0",
        "x-build-id": "MCXKBKrHNGRs20Qz4"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/muhammadafzal~email-address-validator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-muhammadafzal-email-address-validator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/muhammadafzal~email-address-validator/runs": {
            "post": {
                "operationId": "runs-sync-muhammadafzal-email-address-validator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/muhammadafzal~email-address-validator/run-sync": {
            "post": {
                "operationId": "run-sync-muhammadafzal-email-address-validator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "emails": {
                        "title": "Email addresses",
                        "type": "array",
                        "description": "List of email addresses to validate. Use one mailbox per item, for example alex@example.com. Defaults to the sample address when no task input is edited. NOT a list of names, websites, or lead objects.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "emailText": {
                        "title": "Text containing emails",
                        "type": "string",
                        "description": "Optional pasted text scanned for email addresses. Accepts raw text such as 'Contact alex@example.com and sales@example.org'. Defaults to empty text. NOT used for names or phone extraction.",
                        "default": ""
                    },
                    "checkDns": {
                        "title": "Check domain DNS",
                        "type": "boolean",
                        "description": "Verifies the domain has DNS records. Uses A, AAAA, or MX lookups, for example example.com. Defaults to true for stronger validation. NOT an SMTP inbox-delivery test.",
                        "default": true
                    },
                    "checkMx": {
                        "title": "Check MX records",
                        "type": "boolean",
                        "description": "Verifies that the email domain accepts mail through MX records. Uses DNS MX lookup, for example gmail.com. Defaults to true and may mark domains without MX as invalid. NOT a mailbox ping or SMTP login.",
                        "default": true
                    },
                    "allowDisposable": {
                        "title": "Allow disposable emails",
                        "type": "boolean",
                        "description": "Controls whether known temporary mailbox domains can pass. Example disposable domains include mailinator.com and yopmail.com. Defaults to false for lead-quality workflows. NOT a full real-time disposable-domain subscription.",
                        "default": false
                    },
                    "allowRoleAccounts": {
                        "title": "Allow role accounts",
                        "type": "boolean",
                        "description": "Controls whether generic addresses such as info@, sales@, or support@ can pass without a risk flag. Defaults to true because many business contacts use shared inboxes. NOT a person-name verification check.",
                        "default": true
                    },
                    "outputInvalidOnly": {
                        "title": "Output invalid only",
                        "type": "boolean",
                        "description": "Writes only invalid records to the dataset while still counting all checked emails in OUTPUT. Use this when cleaning a large list and only needing rejects. Defaults to false so every email gets a row. NOT a filter that skips validation or billing.",
                        "default": false
                    },
                    "maxEmails": {
                        "title": "Maximum emails",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of unique email addresses processed in one run. Accepts 1 to 10000, for example 500. Defaults to 1000 to keep runs predictable. NOT the number of rows guaranteed in output when invalid-only mode is enabled.",
                        "default": 1000
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
