# 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
- **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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 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
