# Email Validation Api (`ghewaretech/email-validation-api`) Actor

Validate email addresses at scale with enterprise-grade accuracy. This API performs comprehensive email verification including syntax validation, DNS/MX record checks, disposable email detection, and optional SMTP mailbox verification.

- **URL**: https://apify.com/ghewaretech/email-validation-api.md
- **Developed by:** [Unisuraksha Tracking Systems Pvt Ltd](https://apify.com/ghewaretech) (community)
- **Categories:** Automation, Developer tools, Lead generation
- **Features:** Limited permissions
- **Stats:** 22 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 email-validations

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 Validation API

Validate email addresses at scale with enterprise-grade accuracy. This API performs comprehensive email verification including syntax validation, DNS/MX record checks, disposable email detection, and optional SMTP mailbox verification.

**Stop wasting money on invalid emails.** Whether you're cleaning a marketing list, validating signups, or qualifying leads, this API gives you the data you need to make informed decisions.

### Why Use This Actor?

- **Save Money**: Reduce bounce rates and protect your sender reputation
- **Increase Conversions**: Focus on real, deliverable email addresses
- **Prevent Fraud**: Detect disposable and temporary emails at signup
- **Scale Easily**: Process up to 10,000 emails per batch
- **Get Insights**: Detailed risk scoring and deliverability predictions

### Features

| Feature | Description |
|---------|-------------|
| **Syntax Validation** | RFC 5322 compliant email format checking |
| **DNS MX Lookup** | Verify domain has valid mail exchange servers |
| **Disposable Detection** | 150K+ known temporary email domains (tempmail, guerrillamail, etc.) |
| **Role-Based Detection** | Identify generic emails (info@, admin@, support@, sales@) |
| **Free Provider Detection** | Detect Gmail, Yahoo, Outlook, ProtonMail, etc. |
| **Typo Suggestions** | Smart suggestions for common typos (gmial.com → gmail.com) |
| **SMTP Verification** | Optional deep mailbox verification |
| **Risk Scoring** | 0-100 score with actionable risk levels |
| **Catch-All Detection** | Identify domains that accept all emails |

### Input

```json
{
  "emails": [
    "john.doe@gmail.com",
    "contact@company.com",
    "test@tempmail.com"
  ],
  "enableSmtpCheck": false,
  "timeout": 10000,
  "maxConcurrency": 10
}
```

#### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `emails` | array | Yes | - | List of email addresses to validate (max 10,000) |
| `enableSmtpCheck` | boolean | No | `false` | Enable SMTP mailbox verification for higher accuracy |
| `timeout` | number | No | `10000` | Timeout per SMTP connection in milliseconds |
| `maxConcurrency` | number | No | `10` | Number of emails to validate in parallel |

### Output

Each email returns a comprehensive validation result:

```json
{
  "email": "john.doe@gmail.com",
  "valid": true,
  "syntaxValid": true,
  "domain": "gmail.com",
  "mxRecords": ["gmail-smtp-in.l.google.com", "alt1.gmail-smtp-in.l.google.com"],
  "mxValid": true,
  "deliverable": "yes",
  "deliverableConfidence": "high",
  "disposable": false,
  "roleBased": false,
  "freeProvider": true,
  "catchAll": false,
  "suggestion": null,
  "riskScore": 10,
  "riskLevel": "low",
  "smtpCheck": {
    "performed": false,
    "success": false,
    "smtpResponse": null,
    "error": null
  },
  "checksPerformed": ["syntax", "disposable_check", "role_check", "free_provider_check", "mx_lookup", "typo_check"],
  "validationTimeMs": 23
}
```

#### Output Fields Explained

| Field | Type | Description |
|-------|------|-------------|
| `valid` | boolean | Overall validity (syntax + MX + not disposable) |
| `syntaxValid` | boolean | Email format is RFC 5322 compliant |
| `domain` | string | Extracted domain part of the email |
| `mxRecords` | array | Mail exchange server records found |
| `mxValid` | boolean | Domain has valid MX records |
| `deliverable` | string | Deliverability status: `yes`, `no`, `risky`, `unknown` |
| `deliverableConfidence` | string | Confidence level: `high`, `medium`, `low` |
| `disposable` | boolean | Is a temporary/throwaway email service |
| `roleBased` | boolean | Is a generic role email (admin@, info@, etc.) |
| `freeProvider` | boolean | Is from a free email provider |
| `catchAll` | boolean | Domain accepts all email addresses |
| `suggestion` | string | Typo correction suggestion if detected |
| `riskScore` | number | Risk score from 0 (safe) to 100 (risky) |
| `riskLevel` | string | Risk category: `low`, `medium`, `high`, `critical` |

### Risk Levels

| Level | Score | Recommendation |
|-------|-------|----------------|
| **Low** | 0-20 | Safe to use - high quality email |
| **Medium** | 21-40 | Use with caution - may have issues |
| **High** | 41-60 | Likely problematic - consider removing |
| **Critical** | 61-100 | Do not use - will likely bounce or cause issues |

### Use Cases

#### Email List Cleaning

Clean your marketing lists before campaigns to improve deliverability and protect sender reputation.

#### Lead Qualification

Score incoming leads based on email quality. Role-based emails and free providers may indicate lower intent.

#### Signup Validation

Prevent fake registrations by blocking disposable emails and validating in real-time.

#### CRM Hygiene

Regularly validate your contact database to maintain data quality.

#### Marketing Automation

Integrate with your marketing stack to automatically filter low-quality emails.

### API Integration

#### Synchronous Request

```bash
curl -X POST "https://api.apify.com/v2/acts/ghewaretech~email-validation-api/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "emails": ["test@gmail.com", "user@tempmail.com"],
    "enableSmtpCheck": false
  }'
```

#### Asynchronous Request

```bash
curl -X POST "https://api.apify.com/v2/acts/ghewaretech~email-validation-api/runs" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "emails": ["email1@example.com", "email2@example.com"]
  }'
```

#### JavaScript/Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('ghewaretech/email-validation-api').call({
  emails: ['test@gmail.com', 'user@company.com'],
  enableSmtpCheck: false,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("ghewaretech/email-validation-api").call(run_input={
    "emails": ["test@gmail.com", "user@company.com"],
    "enableSmtpCheck": False,
})

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

### Technical Details

- **Runtime**: Node.js 20 with TypeScript
- **SDK**: Apify SDK v3
- **Email Parsing**: RFC 5322 compliant validation
- **Disposable Database**: 150K+ domains, regularly updated
- **Typo Detection**: Levenshtein distance algorithm
- **Performance**: Concurrent processing with configurable parallelism
- **Memory**: 512MB - 2GB depending on batch size

### Frequently Asked Questions

**Q: How accurate is the validation?**
A: Basic validation (syntax + DNS + disposable) is highly accurate. SMTP verification adds additional confidence but may have false negatives due to greylisting.

**Q: Can I validate emails in real-time?**
A: Yes, use the synchronous API endpoint for real-time validation. Response time is typically under 1 second per email.

**Q: What's the difference with and without SMTP check?**
A: Without SMTP, we verify the domain can receive emails. With SMTP, we actually connect to the mail server to verify the specific mailbox exists.

**Q: How often is the disposable domain list updated?**
A: The list is updated with each actor version release, typically incorporating new disposable domains found in the wild.

### Support

- **GitHub**: [brainupgrade-in](https://github.com/brainupgrade-in)
- **LinkedIn**: [company/brains-upgrade](https://linkedin.com/company/brains-upgrade)
- **YouTube**: [@GhewareDevOpsAI](https://youtube.com/@GhewareDevOpsAI)

***

Built by [Gheware](https://gheware.com) for the [Apify $1M Challenge](https://apify.com/million-dollar-challenge)

# Actor input Schema

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

List of email addresses to validate. Maximum 10,000 emails per run.

## `enableSmtpCheck` (type: `boolean`):

Perform deep SMTP mailbox verification. This connects to mail servers to verify if the mailbox exists. More accurate but slower and may incur additional charges.

## `timeout` (type: `integer`):

Timeout for each SMTP connection in milliseconds. Only applies when SMTP verification is enabled.

## `maxConcurrency` (type: `integer`):

Number of emails to validate in parallel. Higher values are faster but may hit rate limits.

## Actor input object example

```json
{
  "emails": [
    "test@example.com",
    "info@google.com"
  ],
  "enableSmtpCheck": false,
  "timeout": 10000,
  "maxConcurrency": 10
}
```

# Actor output Schema

## `validatedEmails` (type: `string`):

Complete validation results for all emails in JSON format.

## `csvExport` (type: `string`):

Download validation results as CSV for spreadsheet import.

## `excelExport` (type: `string`):

Download validation results as Excel file.

# 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@example.com",
        "info@google.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ghewaretech/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@example.com",
        "info@google.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ghewaretech/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@example.com",
    "info@google.com"
  ]
}' |
apify call ghewaretech/email-validation-api --silent --output-dataset

```

## MCP server setup

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