# Email List Cleaner (`night111/email-list-cleaner`) Actor

Bulk email validator: checks the format and the mail servers (MX) of every domain, flags disposable and role addresses, suggests fixes for typos, removes duplicates. No mailbox check. $0.50 per 1,000 emails.

- **URL**: https://apify.com/night111/email-list-cleaner.md
- **Developed by:** [ng. night](https://apify.com/night111) (community)
- **Categories:** Lead generation, Marketing, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 email checkeds

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 List Cleaner

Clean an email list before you send to it. Paste addresses or give links to CSV or text files. You get one row per different address with a status (`valid`, `risky`, `invalid` or `unknown`), the reason, a "did you mean" fix for typos and the mail servers of the domain.

The Actor checks the format of every address and the DNS records of its domain. **It does not check whether the mailbox exists.** That check needs a connection to the mail server on port 25, and Apify blocks that port. Some mail servers also accept every address and bounce it later, so the answer would not be reliable anyway. The Actor sends no email and never contacts the owners of the addresses.

`valid` means: the format is correct, the domain exists, it publishes mail servers, and no risk check flagged the address. A `valid` address can still bounce, for example when nobody uses that mailbox.

### What it checks

- **Format.** One @ sign, at most 64 characters before it and 254 in total, only allowed characters, and a domain that ends in a real top-level domain such as `.com`. Domains with accents or other scripts (`straße.de`) are converted to the form mail servers use (`xn--strae-oqa.de`). Quoted local parts (`"john doe"@example.com`), comments in brackets and IP addresses instead of a domain are treated as invalid. These forms are allowed in theory and almost never used.
- **Domain.** Does it exist, and does it publish MX records (mail servers)? A domain with a "null MX" says it accepts no email. A domain with no MX record but a public address record gets `no_mx_record` and is risky, because mail would go to its web server.
- **Disposable addresses.** About 10,000 domains of temporary mail services, such as `mailinator.com`. The list is the open `disposable-email-domains` list. It ships with the Actor, and the newest version is added when GitHub can be reached at the start of the run. Subdomains of a listed domain count too.
- **Role addresses.** Shared mailboxes such as `info@`, `sales@`, `support@`, `admin@`, `billing@`, `noreply@` and `postmaster@`. They reach a team, not one person. They are `risky`, not `invalid`, because they do receive mail.
- **Typos.** `john@gmial.com`, `john@gmail.con`, `john@gmail` and `john@gmailcom` come back with a `suggestion` such as `john@gmail.com`. Domains are compared with seven big providers (Gmail, Yahoo, Hotmail, Outlook, iCloud, Proton, Yandex). Endings that do not exist and are almost always a mistyped `.com` (`.con`, `.cmo`, `.vom`, ...) are suggested as `.com` for any domain.
- **Duplicates.** The whole address is lowercased and trimmed before it is compared. `Jane@Gmail.com` and `jane@gmail.com` are one address. The first one is kept.
- **Mail provider.** The provider behind the MX records (Google, Microsoft, Yahoo, Proton, Zoho, Proofpoint, Mimecast and about 20 more) when it is one of those. Otherwise `null`.

### Input

| Field | What it does |
|---|---|
| Email addresses | One address per entry. An entry with several addresses separated by commas, semicolons or spaces is split. `Jane Doe <jane@example.com>` and `mailto:jane@example.com` are understood. |
| Links to files | Up to 20 links to `.txt` or `.csv` files, 50 MB each. The link has to return the file itself, without a login page in between. Every email address found anywhere in the file is checked, whatever the columns are. Excel files (`.xlsx`) are not read, save them as CSV first. |

You can use both fields in one run. Up to 500,000 different addresses per run. Without any input the Actor checks six sample addresses, so you can see the output.

An entry with exactly one @ sign is read as one address, so `Contact: jane@example.com` is invalid because of the space. If your addresses sit inside longer text, put the text in a file and give the link.

Example input:

```json
{
  "emails": ["jane.smith@gmail.com", "John Doe <john.doe@gmial.com>", "info@apify.com"],
  "listUrls": ["https://example.com/contacts.csv"]
}
```

### Example output

The six sample addresses:

| Address | Status | Reason |
|---|---|---|
| jane.smith@gmail.com | valid | ok |
| info@apify.com | risky | role_account |
| john.doe@gmial.com | risky | possible_typo |
| temp123@mailinator.com | risky | disposable |
| someone@no-such-domain-xyz123.com | invalid | domain_not_found |
| not-an-email | invalid | invalid_syntax |

A valid address. The list of mail servers is shortened here:

```json
{
  "input": "jane.smith@gmail.com",
  "email": "jane.smith@gmail.com",
  "status": "valid",
  "reason": "ok",
  "reasons": [],
  "details": "The format is valid and the domain has mail servers. The mailbox itself was not checked.",
  "suggestion": null,
  "syntaxValid": true,
  "domain": "gmail.com",
  "domainExists": true,
  "hasMxRecords": true,
  "mxRecords": ["gmail-smtp-in.l.google.com", "alt1.gmail-smtp-in.l.google.com"],
  "mailProvider": "Google",
  "disposable": false,
  "roleAccount": false,
  "freeProvider": true,
  "checkedAt": "2026-11-13T07:43:52.801Z"
}
```

A typo. `reason` is the most useful reason and `reasons` lists all of them:

```json
{
  "input": "john.doe@gmial.com",
  "email": "john.doe@gmial.com",
  "status": "risky",
  "reason": "possible_typo",
  "reasons": ["possible_typo", "no_mx_record", "disposable"],
  "details": "The domain gmial.com looks like a typo of gmail.com.",
  "suggestion": "john.doe@gmail.com",
  "syntaxValid": true,
  "domain": "gmial.com",
  "domainExists": true,
  "hasMxRecords": false,
  "mxRecords": [],
  "mailProvider": null,
  "disposable": true,
  "roleAccount": false,
  "freeProvider": false,
  "checkedAt": "2026-11-13T07:43:52.801Z"
}
```

A malformed address. What cannot be known is `null`:

```json
{
  "input": "not-an-email",
  "email": "not-an-email",
  "status": "invalid",
  "reason": "invalid_syntax",
  "reasons": ["invalid_syntax"],
  "details": "There is no @ sign.",
  "suggestion": null,
  "syntaxValid": false,
  "domain": null,
  "domainExists": null,
  "hasMxRecords": null,
  "mxRecords": [],
  "mailProvider": null,
  "disposable": null,
  "roleAccount": null,
  "freeProvider": null,
  "checkedAt": "2026-11-13T07:43:52.801Z"
}
```

A link that could not be read. This row is not charged:

```json
{
  "input": "https://example.com",
  "email": null,
  "status": "error",
  "reason": "list_url_failed",
  "details": "No email address found in the file."
}
```

### Statuses and reasons

| Status | Meaning | Usual action |
|---|---|---|
| `valid` | Correct format, the domain has mail servers, no flag. | Keep. |
| `risky` | The address may receive mail, but something is off. See the reasons. | Look at the reason. |
| `invalid` | Mail cannot reach this address. | Remove. |
| `unknown` | The DNS lookup kept failing (timeout or server failure). Not charged. | Run these again later. |
| `error` | A link could not be read. Not charged. | Check the link. |

| Reason | Status | What it means |
|---|---|---|
| `ok` | valid | Nothing found. |
| `invalid_syntax` | invalid | The format is wrong. `details` says what is wrong, and `suggestion` may hold a fix. |
| `domain_not_found` | invalid | The domain does not exist. |
| `no_mail_server` | invalid | The domain exists but has no MX record and no usable address record. |
| `no_mail_accepted` | invalid | The domain publishes a null MX: it accepts no email. |
| `possible_typo` | risky | The domain looks like a typo. `suggestion` has the likely address. |
| `no_mx_record` | risky | No MX record, but a public address record. Mail would go to the web server. |
| `disposable` | risky | A temporary mail service. |
| `role_account` | risky | A shared mailbox such as `info@`. |
| `non_ascii_local_part` | risky | The part before the @ has characters outside ASCII (`josé@gmail.com`). Some mail systems reject them. |
| `dns_error` | unknown | The lookup failed. Try again later. |
| `list_url_failed` | error | The link could not be read, or the file holds no email address. |

When several reasons apply, `reason` is the first of this order: `possible_typo`, `no_mx_record`, `disposable`, `role_account`, `non_ascii_local_part`. `reasons` has all of them.

### More results of a run

The run also saves two records in its key-value store:

- `VALID_EMAILS`: a text file with the addresses of status `valid`, one per line. Ready to import into your mail tool.
- `SUMMARY`: counts per status and reason, duplicates removed, addresses not checked, DNS failures and which disposable list was used. For example:

```json
{
  "entriesInInput": 6,
  "addressesFound": 6,
  "duplicatesRemoved": 0,
  "uniqueAddresses": 6,
  "checked": 6,
  "unknownNotCharged": 0,
  "notChecked": 0,
  "stoppedByCostLimit": false,
  "byStatus": { "valid": 1, "risky": 3, "invalid": 2 },
  "flags": { "disposable": 2, "roleAccount": 1, "freeProvider": 1, "withSuggestion": 1 },
  "disposableList": { "source": "latest list from GitHub plus bundled list", "domains": 10181 },
  "seconds": 0
}
```

### Price

- $0.50 per 1,000 addresses ($0.0005 each).
- A start fee of $0.00004 per run.

Every address that appears in the results is charged, including invalid ones. Duplicates are removed before checking and are free. Rows with status `unknown` and rows for links that failed are free.

Example: 10,000 addresses with 1,000 duplicates cost 9,000 × $0.0005 = $4.50, plus the start fee.

If you set a maximum cost per run, the Actor stops when it is reached. Everything saved up to then is kept, and `notChecked` in `SUMMARY` says how many addresses were left.

### Limits

- No mailbox check. A `valid` address is not a promise that mail will arrive.
- Addresses at big free providers (`gmail.com`, `outlook.com`, ...) only prove that the format is right. Those domains have mail servers anyway.
- DNS answers come from the resolver that Apify's servers use at the time of the run. A few domains, mostly parked or typo domains, give different answers on different networks or on different days.
- Lookups for dead domains sometimes fail with a timeout or a server failure. In a test with 9,367 disposable-mail domains, 101 (about 1%) came back as `unknown`. These rows are free. A timeout is usually gone on the next run, a server failure often stays.
- The disposable list is not complete. New temporary services appear every day.
- The typo check knows seven providers and the mistyped `.com` endings above. It does not find typos in company domains such as `microsft.com`.
- Duplicates are found by exact match after lowercasing. `jane+news@gmail.com` and `jane@gmail.com` are two addresses, and so are `j.ane@gmail.com` and `jane@gmail.com`.
- Up to 500,000 different addresses per run. For a longer list, split it and start more runs.
- Speed depends on the number of different domains, because each domain is looked up once and shared by all its addresses. In a test, about 9,000 different domains took 36 seconds.
- Email addresses are personal data. Use only lists that you may process, and check the privacy law that applies to you (GDPR and similar).

### Run it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/night111~email-list-cleaner/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"emails": ["jane.smith@gmail.com", "john.doe@gmial.com"]}'
```

This call waits for the run to end. For long lists, start a run and read the dataset afterwards.

### Questions

Open an issue in the Issues tab of this Actor with your input and the row you did not expect.

# Actor input Schema

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

One address per entry. An entry that holds several addresses separated by commas, semicolons or spaces is split. "Name <name@example.com>" is understood. Duplicates are removed. Up to 500,000 different addresses per run.

## `listUrls` (type: `array`):

Direct links to .txt or .csv files, up to 50 MB each and 20 files per run. Every email address found anywhere in the file is checked, whatever the columns are.

## Actor input object example

```json
{
  "emails": [
    "jane.smith@gmail.com",
    "info@apify.com",
    "john.doe@gmial.com",
    "temp123@mailinator.com",
    "someone@no-such-domain-xyz123.com",
    "not-an-email"
  ]
}
```

# Actor output Schema

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

One row per address: status, reason, suggestion, mail servers and flags.

## `validEmails` (type: `string`):

The addresses with status valid, one per line.

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

Counts per status and reason, duplicates removed and DNS failures.

# 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": [
        "jane.smith@gmail.com",
        "info@apify.com",
        "john.doe@gmial.com",
        "temp123@mailinator.com",
        "someone@no-such-domain-xyz123.com",
        "not-an-email"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("night111/email-list-cleaner").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": [
        "jane.smith@gmail.com",
        "info@apify.com",
        "john.doe@gmial.com",
        "temp123@mailinator.com",
        "someone@no-such-domain-xyz123.com",
        "not-an-email",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("night111/email-list-cleaner").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 '{
  "emails": [
    "jane.smith@gmail.com",
    "info@apify.com",
    "john.doe@gmial.com",
    "temp123@mailinator.com",
    "someone@no-such-domain-xyz123.com",
    "not-an-email"
  ]
}' |
apify call night111/email-list-cleaner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,night111/email-list-cleaner"
        }
    }
}
```

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/mZWRbHLz2zSdbhRz1/builds/yRHmy0pmIqrA9pRyB/openapi.json
