# Bulk Email Validator & MX Lookup API (`solidscrape/bulk-email-dns-validator`) Actor

Clean email lists with syntax checks and domain-level DNS evidence. Distinguish null MX, missing domains and implicit mail routes. Pay once per distinct domain per run.

- **URL**: https://apify.com/solidscrape/bulk-email-dns-validator.md
- **Developed by:** [SolidScrape](https://apify.com/solidscrape) (community)
- **Categories:** Developer tools, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 unique domain 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

## Bulk Email Validator & MX Lookup API

Before importing a list into your CRM, find malformed addresses, domains that explicitly refuse email, and domains that publish a mail route. Submit up to 100 addresses and receive one ordered result per input. The API checks each distinct eligible domain once per run. An address at an MX-enabled domain can still belong to a nonexistent mailbox.

Use the API when your list has many addresses at the same companies, or when you want to inspect the DNS evidence behind a decision. It uses Google Public DNS over HTTPS and sends only the normalized domain name. It makes no SMTP connections. Original email addresses stay out of the dataset by default. Apify retains the supplied input in the run's `INPUT` record.

[Try the four-address MX example](https://apify.com/solidscrape/bulk-email-dns-validator/examples/bulk-email-validation-mx-null-mx-nxdomain) or [read the guide to validating email domains](https://solidscrape-monitoring-guides.techmuhafiz.chatgpt.site/email-domain-validation/).

### Try four example addresses

```json
{
  "emails": ["a@gmail.com", "a@example.com", "a@example.invalid", "b@gmail.com"],
  "maxSpendUsd": 0.02
}
```

On the reference check the results were:

| Input index | Domain | Status | What the evidence shows |
|---:|---|---|---|
| 0 | gmail.com | `mx_present` | Published MX records identify mail exchangers. |
| 1 | example.com | `null_mx` | A null MX record declares that the domain does not accept email. |
| 2 | example.invalid | `domain_not_found` | The resolver returned NXDOMAIN. |
| 3 | gmail.com | `mx_present` | The second Gmail address reuses the first DNS check. |

This four-row example costs **$0.005** in listed Actor events. DNS can change between runs. Open the **Email DNS validation results** dataset, then inspect `DOMAINS` under Storage for the checked domains, record types attempted and exchangers. The `mailboxStatus` field is always `unverified`.

### Price per run

| Event | Listed price | What is included |
|---|---:|---|
| 512 MB Actor start | $0.002 | Input checks, syntax-only rows, dataset output and coverage summary. |
| New normalized domain attempted | $0.001 | One MX lookup and, when needed, up to one A and one AAAA lookup. Negative responses and temporary lookup failures count as attempts. |

A list of **100 addresses on 10 distinct eligible domains costs $0.012** when all 10 domains are attempted. A list with 100 syntax failures costs the $0.002 start only. Each new run starts a fresh DNS cache; use one batch to share a check across addresses at the same company.

The default `maxSpendUsd` of $0.02 covers the start and up to 18 distinct domains at the listed prices. Lower it to $0.002 for syntax-only processing. The smaller of the input limit and the platform's run limit applies. The input limit ranges from $0.002 to $1. If a limit is reached, unattempted domains get `not_checked`; every supplied position is represented in the dataset on a normally completed run. See the [current event prices](https://apify.com/solidscrape/bulk-email-dns-validator/pricing).

### Call from Python

Save your Apify token locally as `APIFY_TOKEN` and run the following with Python's standard library. It starts one run and prints the status of each input. The token is sent in the HTTPS authorization header.

```python
import json
import os
from urllib.request import Request, urlopen

url = (
    "https://api.apify.com/v2/acts/solidscrape~bulk-email-dns-validator/"
    "run-sync-get-dataset-items?maxTotalChargeUsd=0.02&memory=512&timeout=120"
)
sample = {"emails": ["a@gmail.com", "a@example.com", "a@example.invalid", "b@gmail.com"],
          "maxSpendUsd": 0.02}
request = Request(
    url, data=json.dumps(sample).encode(),
    headers={"Content-Type": "application/json", "Authorization": "Bearer " + os.environ["APIFY_TOKEN"]},
)
with urlopen(request, timeout=135) as response:
    for row in json.load(response):
        print(row["inputIndex"], row["domain"], row["status"])
```

If your connection drops after submitting a request, inspect the run history before retrying. For scheduled integrations, use the asynchronous runs endpoint, then read that run's default dataset and `SUMMARY` record. In an MCP client connected to Apify, request `solidscrape/bulk-email-dns-validator` by name and supply the same input and maximum run charge.

### Interpret each result

- **`invalid_syntax`** covers malformed dot-atom addresses and domain syntax. **`unsupported`** covers forms that need a specialist parser or nonpublic configuration, including quoted local parts, display names, IP literals, internationalized local parts and single-label domains. These rows skip DNS. Common ASCII local parts including plus tags are supported. Internationalized domains are normalized to ASCII using IDNA.
- **`mx_present`** identifies an explicit mail exchanger. Open `DOMAINS` for the first 12 exchanges in priority order and their total count. A resolver's advertised route does not establish that the server is reachable or that a particular mailbox accepts mail.
- **`implicit_mx`** means the domain has no explicit MX and returned an A or AAAA address. SMTP permits this fallback. **`no_mail_route`** means the resolver returned no MX, A or AAAA route under these checks.
- **`null_mx`** is an explicit no-mail declaration. **`domain_not_found`** records an MX query that returned NXDOMAIN. **`ambiguous_dns`** flags conflicting or malformed MX records. Keep **`temporary_failure`** separate from hard failures; resolver outages and rate limits can affect healthy domains.

The `inputIndex` is zero-based. Join it to your own original list. Turn on `includeEmail` only when you want original strings copied into the dataset. The domain evidence includes timestamps and query types. `SUMMARY` records input rows, unattempted rows, status counts, unique eligible domains, confirmed domain attempts, DNS query count, the stop reason and modeled Actor charges. The default lookup deadline is 45 seconds; individual lookups are bounded to three seconds and a maximum response size of 32 KiB. Temporary failure is a normal output when that deadline or the resolver's limits intervene.

This API evaluates syntax and DNS routing. It does not send mail, probe a mailbox, detect catch-all recipients, score spam traps, verify inbox ownership or predict bounce rates. Use it to flag technical problems and to prioritize further checks on addresses you have permission to process. Standards and data source: [Null MX, RFC 7505](https://www.rfc-editor.org/rfc/rfc7505), [SMTP domain routing, RFC 5321 section 5.1](https://datatracker.ietf.org/doc/html/rfc5321#section-5.1), [Google Public DNS JSON API](https://developers.google.com/speed/public-dns/docs/doh/json).

# Actor input Schema

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

Enter 1–100 address strings, at most 320 characters each. A zero-based inputIndex joins sanitized rows to your original list. Only eligible domain names go to Google Public DNS.

## `includeEmail` (type: `boolean`):

Off by default. Turn on to copy the original input string into each dataset row. Apify already retains the original run input under INPUT.

## `maxSpendUsd` (type: `number`):

The smaller of this input and the platform limit applies. One start costs $0.002 and each unique domain attempt costs $0.001. Remaining domains are marked not_checked.

## `maxSeconds` (type: `integer`):

Total soft lookup deadline. Individual requests may take up to three seconds. The Actor saves summaries after lookup work stops.

## Actor input object example

```json
{
  "emails": [
    "a@gmail.com",
    "a@example.com",
    "a@example.invalid",
    "b@gmail.com"
  ],
  "includeEmail": false,
  "maxSpendUsd": 0.02,
  "maxSeconds": 45
}
```

# Actor output Schema

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

No description

## `domains` (type: `string`):

No description

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

No description

# 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": [
        "a@gmail.com",
        "a@example.com",
        "a@example.invalid",
        "b@gmail.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("solidscrape/bulk-email-dns-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": [
        "a@gmail.com",
        "a@example.com",
        "a@example.invalid",
        "b@gmail.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("solidscrape/bulk-email-dns-validator").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": [
    "a@gmail.com",
    "a@example.com",
    "a@example.invalid",
    "b@gmail.com"
  ]
}' |
apify call solidscrape/bulk-email-dns-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,solidscrape/bulk-email-dns-validator"
        }
    }
}
```

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/owurgj5ckqahpm3Rf/builds/XwIt0M7U00Avm3DSd/openapi.json
