# Website Contact Scraper & Email Extractor (Flat-Rate MX/DMARC) (`enrichstack/flat-rate-contact-mx-enricher`) Actor

Flat-rate website contact scraper & email extractor with live DNS MX verification, SPF/DMARC checker, and Google Workspace/M365 detection. Never billed per subpage, $0 on dead domains. n8n & MCP ready.

- **URL**: https://apify.com/enrichstack/flat-rate-contact-mx-enricher.md
- **Developed by:** [SP SWE Services Ltd](https://apify.com/enrichstack) (community)
- **Categories:** Lead generation, Business, Automation
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 domain contacts enriched

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

## Website Contact Scraper & Email Extractor (Flat-Rate MX/DMARC)

> **Built by [EnrichStack (SP SWE Services Ltd)](https://spswe.co.uk)** · Pure HTTP + native DNS · **Flat per-domain billing (`$5.00 / 1K` with default MX/DMARC enabled; `$3.50 / 1K` contacts-only)** · **Zero result fees on unreachable, DNS-failed, HTTP-error, or blocked-challenge domains** *(Apify platform actor-start fee applies per run)* · [Free MIT n8n Workflow Templates](https://github.com/SP-SWE-SERVICES-LTD/enrichstack-n8n-templates)

Extract clean business emails, phone numbers, social media profiles, JSON-LD team/founder contacts, and live **domain-level DNS MX, SPF, and DMARC** mail provider intelligence from any list of company domains — at a **predictable flat per-domain price**.

Unlike per-subpage website contact scrapers that charge per URL crawled, this **email extractor and DNS MX/DMARC checker** crawls up to 10 high-signal contact pages per domain while billing **one flat domain event per live domain**.

***

### Scope & Architecture

- **Static-HTML extraction only:** Fetches public HTML and JSON-LD directly via HTTP + Cheerio without a headless browser. Contacts or widgets rendered exclusively by client-side JavaScript after page load may not appear in static HTML.
- **Domain-level DNS MX/SPF/DMARC (not SMTP mailbox verification):** Checks whether a domain publishes valid MX mail exchangers, SPF (`v=spf1`), and DMARC (`_dmarc.` with RFC 7489 organizational-domain fallback), and identifies the mail provider (`Google Workspace`, `Microsoft 365`, `Proofpoint`, `Mimecast`, `Barracuda`, `Cisco / IronPort`, `Hostinger`, `Stackmail / 20i`, `Zoho Mail`, `Proton Mail`, `Fastmail`, `Cloudflare Email Routing`, `Amazon WorkMail / SES`, `GoDaddy`, `IONOS`, etc.). It does **not** send SMTP RCPT TO probes to verify individual inboxes.
- **SSRF & billing integrity:** Validates DNS resolution before every HTTP hop (blocking private/loopback/link-local/CGNAT/ULA IPs and unsafe redirects) and charges incrementally per domain, respecting your run's `maxTotalChargeUsd` budget cap.

***

### What This Website Contact Scraper Extracts

- **Clean, ranked business emails (`bestEmail`, `bestEmailType`, `bestEmailMatchesDomain`, `emails[]`):** Crawls homepage plus highest-priority contact subpages (`/contact`, `/contact-us`, `/about`, `/team`, `/impressum`, `/policies/contact-information`), handles `mailto:`, JSON-LD, and obfuscated `[at]`/`[dot]` emails, rejects masked/wildcard strings, asset filenames (`@2x.png`), Sentry hashes, and `noreply@` traps, classifies `personal` vs `role` (including `data@`, `dpo@`, `privacy@`, `gdpr@`, `legal@`, `compliance@`, `humans@`), flags disposable domains, and checks per-email-domain DNS MX readiness.
- **Live domain-level DNS MX, SPF & DMARC:** Resolves live `MX`, `SPF`, and `_dmarc` TXT records in parallel with organizational-domain DMARC fallback (`dmarcSourceDomain`) and explicit lookup statuses (`mxLookupStatus` / `dmarcLookupStatus`: `found`, `missing`, or `error`).
- **Phones, social profiles & structured team members:** Extracts URI-decoded `tel:` and JSON-LD phone numbers (preserving `+` and deduplicating by digits), normalized LinkedIn company URLs, Instagram, Facebook, TikTok, X/Twitter, YouTube, GitHub (including JSON-LD `sameAs`), and structured JSON-LD `Person` / founder entries.
- **Zero-contact safety toggle (`onlyChargeIfContactFound`):** Optional flag so live domains with zero extracted emails, phones, or social profiles emit zero result events.

***

### Transparent Pay-Per-Event Pricing

No hidden per-page multipliers. **Zero result fees** are charged on unreachable, DNS-failed, HTTP-error, empty-body, or blocked-challenge domains (`isLive: false`). Apify's platform `apify-actor-start` fee applies once per run.

| Event Name | Price per Event | Price per 1,000 Live Domains | When Charged |
| :--- | :--- | :--- | :--- |
| `domain-contact-enriched` *(Primary)* | **$0.0035** | **$3.50 / 1K** | Once per live domain enriched (regardless of `maxPagesPerDomain`, 1–10 subpages) |
| `mx-deliverability-check` *(Default on)* | **$0.0015** | **$1.50 / 1K** | Once per live domain when `verifyMxAndProvider: true` |
| `apify-actor-start` *(Platform)* | **$0.00005** | One-time per run | Charged once per GB on Actor start by Apify |
| **Unreachable / DNS-failed / HTTP-error / blocked-challenge domains** | **$0.00** | **$0.00** | **Zero result events emitted** (`isLive: false`, explicit `statusReason`) |

**Example batch totals (excluding platform `apify-actor-start`):**

- **1,000 live domains with defaults (`verifyMxAndProvider: true`):** **`$5.00`** (`$3.50` contacts + `$1.50` MX/SPF/DMARC).
- **1,000 live domains contacts-only (`verifyMxAndProvider: false`):** **`$3.50`**.
- **1,000 raw domains with 150 unreachable/challenge domains (defaults):** **`$4.25`** (150 non-live domains incur zero result fees).

***

### Quick Start: Copy-Paste JSON Input

```json
{
  "domains": [
    "apify.com",
    "n8n.io",
    "stripe.com"
  ],
  "maxPagesPerDomain": 5,
  "verifyMxAndProvider": true,
  "extractTeamPeople": true,
  "onlyChargeIfContactFound": false,
  "concurrency": 10,
  "timeoutSecs": 12
}
```

#### Input Parameters

| Field | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `domains` | `string[]` | *required* | Non-empty list of bare domains or full URLs (missing/empty arrays fail cleanly with a validation error — never silently billed against demo domains). Automatically deduplicated; SSRF/private IPs rejected. |
| `maxPagesPerDomain` | `integer` (1–10) | `5` | Homepage + top priority contact/about/team/impressum subpages checked — **always billed flat per live domain**. |
| `verifyMxAndProvider` | `boolean` | `true` | Runs domain-level DNS MX, SPF, DMARC & mail provider checks (`mx-deliverability-check`, `$1.50/1K`). |
| `extractTeamPeople` | `boolean` | `true` | Extracts structured JSON-LD `Person` / founder names, roles, and LinkedIn URLs. |
| `onlyChargeIfContactFound` | `boolean` | `false` | If `true`, live domains with zero extracted emails, phones, or socials emit zero result events. |
| `concurrency` | `integer` (1–20) | `10` | Parallel domains processed simultaneously (clamped to `1..20`). |
| `timeoutSecs` | `integer` (5–30) | `12` | Homepage HTTP timeout per domain. |

***

### Copy-Paste JSON Output Example

```json
{
  "domain": "acme-agency.co.uk",
  "finalUrl": "https://www.acme-agency.co.uk/",
  "isLive": true,
  "statusReason": "ok",
  "httpStatus": 200,
  "companyName": "Acme Digital Agency",
  "pagesChecked": 4,
  "bestEmail": "sarah.patel@acme-agency.co.uk",
  "bestEmailType": "personal",
  "bestEmailMatchesDomain": true,
  "emails": [
    {
      "email": "sarah.patel@acme-agency.co.uk",
      "type": "personal",
      "sourcePath": "/team",
      "mxValid": true,
      "isDisposable": false
    }
  ],
  "phones": ["+44 20 7946 0958"],
  "teamMembers": [
    {
      "name": "Sarah Patel",
      "role": "Managing Director",
      "linkedinUrl": "https://www.linkedin.com/in/sarahpatel"
    }
  ],
  "socials": {
    "linkedin": "https://www.linkedin.com/company/acme-digital-agency",
    "instagram": "https://www.instagram.com/acmedigital",
    "facebook": null,
    "tiktok": null,
    "x": "https://x.com/acmedigital",
    "youtube": null,
    "github": null
  },
  "emailProvider": "Google Workspace",
  "hasValidMx": true,
  "mxLookupStatus": "found",
  "hasSpf": true,
  "hasDmarc": true,
  "dmarcLookupStatus": "found",
  "dmarcPolicy": "reject",
  "dmarcSourceDomain": "acme-agency.co.uk",
  "enrichedAt": "2026-12-01T09:00:00.000Z"
}
```

***

### n8n Lead Enrichment & Free MIT Templates

Import our free, MIT-licensed **n8n workflow templates** (with `SplitInBatches` chunking, native `httpBearerAuth` credentials, and CRM-ready tables) from [`SP-SWE-SERVICES-LTD/enrichstack-n8n-templates`](https://github.com/SP-SWE-SERVICES-LTD/enrichstack-n8n-templates):

1. **[`cold-email-mx-dmarc-deliverability-cleaner.json`](https://github.com/SP-SWE-SERVICES-LTD/enrichstack-n8n-templates/blob/main/workflows/cold-email-mx-dmarc-deliverability-cleaner.json)** — Cleans raw prospect lists in batches of 25 and splits **`Ready for Outreach (Google/M365 MX/DNS Ready)`** vs **`Risky / Unreachable`**.
2. **[`google-maps-to-agency-outreach.json`](https://github.com/SP-SWE-SERVICES-LTD/enrichstack-n8n-templates/blob/main/workflows/google-maps-to-agency-outreach.json)** — Enriches a supplied domain list and chains into the Technical SEO / AI-Crawler / DMARC Auditor in chunked batches.

#### Direct REST API Call (n8n / Clay / Make / cURL)

```bash
curl -X POST "https://api.apify.com/v2/acts/enrichstack~flat-rate-contact-mx-enricher/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domains": ["apify.com", "n8n.io"], "maxPagesPerDomain": 5, "verifyMxAndProvider": true}'
```

***

### MCP Server & Standby HTTP Usage

This Actor works with the **Apify MCP Server** (`mcp.apify.com`) and supports Standby HTTP mode (`POST /` with JSON body up to 50 domains and 256 KB max payload; `GET /health` for health checks).

#### Direct Standby HTTP Call

```bash
curl -X POST "https://enrichstack--flat-rate-contact-mx-enricher.apify.actor/" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domains": ["stripe.com", "apify.com"], "maxPagesPerDomain": 5}'
```

***

### Frequently Asked Questions (FAQ)

**Do I get charged per subpage when `maxPagesPerDomain` is set to 5 or 10?**\
No. Whether the Actor checks 1 page or 10 subpages on a domain, you pay **1 flat `domain-contact-enriched` event** per live domain (`$3.50/1K`), plus `1 mx-deliverability-check` event (`$1.50/1K`) when `verifyMxAndProvider: true` (`$5.00/1K` total with defaults).

**What happens on unreachable, DNS-failed, HTTP-error, or Cloudflare-challenge domains?**\
Zero result fees are charged (`isLive: false` with an explicit `statusReason` such as `dns_failed`, `http_error`, `blocked_challenge`, `empty_body`, or `timeout`). Apify's platform `apify-actor-start` fee still applies once per run.

**Does this perform SMTP mailbox verification?**\
No. It performs live **domain-level DNS MX, SPF, and DMARC** checks plus disposable-domain detection and mail-host classification. It does not probe individual mailboxes over SMTP.

***

Maintained by **[SP SWE Services Ltd](https://spswe.co.uk)** · Questions: `contact@spswe.co.uk` · Free MIT n8n templates: [github.com/SP-SWE-SERVICES-LTD/enrichstack-n8n-templates](https://github.com/SP-SWE-SERVICES-LTD/enrichstack-n8n-templates)

# Actor input Schema

## `domains` (type: `array`):

Required non-empty list of company domains or URLs. Duplicate domains are automatically deduplicated; private/internal hosts are blocked. Unreachable, DNS-failed, HTTP-error, or blocked-challenge domains incur zero result fees (Apify platform actor-start fee applies per run).

## `maxPagesPerDomain` (type: `integer`):

Crawls homepage plus top priority contact/about/team/impressum subpages up to this cap — always billed flat per live domain, never per subpage.

## `verifyMxAndProvider` (type: `boolean`):

Runs domain-level DNS MX, SPF, and DMARC checks (not SMTP mailbox verification) and identifies Google Workspace, Microsoft 365, Proofpoint, Hostinger, Zoho, etc. Emits 1 mx-deliverability-check event ($0.0015) per live domain.

## `extractTeamPeople` (type: `boolean`):

Extracts structured Person/founder names, roles, and LinkedIn profile URLs from static JSON-LD metadata.

## `onlyChargeIfContactFound` (type: `boolean`):

When enabled, live domains with zero extracted emails, phones, or social profiles emit zero result charge events.

## `concurrency` (type: `integer`):

Number of domains processed concurrently (clamped to 1-20).

## `timeoutSecs` (type: `integer`):

Per-domain homepage HTTP timeout in seconds.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "n8n.io",
    "stripe.com"
  ],
  "maxPagesPerDomain": 5,
  "verifyMxAndProvider": true,
  "extractTeamPeople": true,
  "onlyChargeIfContactFound": false,
  "concurrency": 10,
  "timeoutSecs": 12
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `fullDataset` (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 = {
    "domains": [
        "apify.com",
        "n8n.io",
        "stripe.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("enrichstack/flat-rate-contact-mx-enricher").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 = { "domains": [
        "apify.com",
        "n8n.io",
        "stripe.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("enrichstack/flat-rate-contact-mx-enricher").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 '{
  "domains": [
    "apify.com",
    "n8n.io",
    "stripe.com"
  ]
}' |
apify call enrichstack/flat-rate-contact-mx-enricher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,enrichstack/flat-rate-contact-mx-enricher"
        }
    }
}
```

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/Z8bycdfYd0oWn89fP/builds/RXuflJssxlnLMdX7A/openapi.json
