# Email Validation API (`gentle_cloud/email-validation-api`) Actor

Validate email addresses with syntax checks, DNS MX record lookup, disposable email detection, and role-based address detection. No API key required.

- **URL**: https://apify.com/gentle_cloud/email-validation-api.md
- **Developed by:** [Monkey Coder](https://apify.com/gentle_cloud) (community)
- **Categories:** Automation, Developer tools, E-commerce
- **Features:** Limited permissions
- **Stats:** 4 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.001 / actor start

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/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

Validate email addresses in bulk with comprehensive checks — no API key required. Perfect for cleaning email lists, verifying leads, and filtering out disposable or invalid addresses.

### ✅ What It Does

For each email address, the Actor performs:

1. **Syntax Validation** — RFC 5322 compliance check (format, length, special characters)
2. **DNS MX Record Lookup** — Verifies the domain has mail servers configured to receive email
3. **Disposable Email Detection** — Flags addresses from 100+ known temporary/throwaway email providers (Mailinator, Guerrilla Mail, etc.)
4. **Role-Based Address Detection** — Identifies generic addresses like `info@`, `admin@`, `noreply@` that often don't belong to real people
5. **Free Provider Detection** — Flags addresses from free email services (Gmail, Yahoo, Outlook, etc.)

### 🔧 How It Works

1. Enter your email addresses (one per line or comma-separated)
2. Configure validation options (DNS check, disposable rejection)
3. Run the Actor
4. Download results as JSON, CSV, or Excel

No external APIs or keys needed — all validation runs locally using DNS lookups and pattern matching.

### 📥 Input

| Field | Type | Description |
|-------|------|-------------|
| `emails` | String | Email addresses to validate (one per line or comma-separated) |
| `check_dns` | Boolean | Perform DNS MX record lookup (default: true) |
| `reject_disposable` | Boolean | Mark disposable emails as invalid (default: true) |

### 📤 Sample Output

```json
[
    {
        "email": "john@gmail.com",
        "is_valid": true,
        "syntax_valid": true,
        "domain": "gmail.com",
        "has_mx_records": true,
        "mx_records": "gmail-smtp-in.l.google.com, alt1.gmail-smtp-in.l.google.com",
        "is_disposable": false,
        "is_role_based": false,
        "is_free_provider": true,
        "reason": "Valid email address",
        "checked_at": "2025-01-15T10:30:00.000000"
    },
    {
        "email": "user@mailinator.com",
        "is_valid": false,
        "syntax_valid": true,
        "domain": "mailinator.com",
        "has_mx_records": true,
        "mx_records": "mail.mailinator.com",
        "is_disposable": true,
        "is_role_based": false,
        "is_free_provider": false,
        "reason": "Disposable email domain",
        "checked_at": "2025-01-15T10:30:01.000000"
    },
    {
        "email": "invalid-email",
        "is_valid": false,
        "syntax_valid": false,
        "domain": null,
        "has_mx_records": false,
        "mx_records": "",
        "is_disposable": false,
        "is_role_based": false,
        "is_free_provider": false,
        "reason": "Invalid email format",
        "checked_at": "2025-01-15T10:30:02.000000"
    }
]
```

### 💡 Use Cases

- **Email List Cleaning** — Remove invalid, disposable, and role-based addresses before campaigns
- **Lead Verification** — Validate prospect emails before outreach
- **Registration Filtering** — Block disposable email signups in real-time
- **Data Quality** — Audit and score email databases for deliverability

### ⚡ Performance

- Processes ~5 emails/second with DNS checks enabled
- Syntax-only mode (DNS disabled) processes thousands per second
- Uses Google and Cloudflare public DNS (8.8.8.8, 1.1.1.1) for reliable lookups

### ⚠️ Notes

- DNS MX checks require network access (enabled by default on Apify)
- SMTP-level verification (RCPT TO) is intentionally not included as most mail servers block or give unreliable responses
- Disposable domain list covers 100+ providers; some newer services may not be detected
- Results are point-in-time — domain DNS records can change

# Actor input Schema

## `emails` (type: `string`):

List of email addresses to validate. One email per line, or comma-separated.

## `check_dns` (type: `boolean`):

Whether to perform DNS MX record lookup for each email domain. Disable for faster syntax-only validation.

## `reject_disposable` (type: `boolean`):

Mark emails from known disposable/temporary email providers as invalid.

## Actor input object example

```json
{
  "emails": "test@gmail.com\ninvalid-email\nuser@mailinator.com\nadmin@microsoft.com\nhello@nonexistent-domain-xyz123.com",
  "check_dns": true,
  "reject_disposable": true
}
```

# 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": `test@gmail.com
invalid-email
user@mailinator.com
admin@microsoft.com
hello@nonexistent-domain-xyz123.com`
};

// Run the Actor and wait for it to finish
const run = await client.actor("gentle_cloud/email-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 = { "emails": """test@gmail.com
invalid-email
user@mailinator.com
admin@microsoft.com
hello@nonexistent-domain-xyz123.com""" }

# Run the Actor and wait for it to finish
run = client.actor("gentle_cloud/email-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 '{
  "emails": "test@gmail.com\\ninvalid-email\\nuser@mailinator.com\\nadmin@microsoft.com\\nhello@nonexistent-domain-xyz123.com"
}' |
apify call gentle_cloud/email-validation-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gentle_cloud/email-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/Ls0BTrwDGoUpebwkh/builds/XDkElaMqwZzJ7Qdis/openapi.json
