# Lead List Cleaner: Dedupe, Phone, Website and MX (`opendatadesk/lead-list-cleaner`) Actor

Clean a lead list or CRM export: find duplicates, normalise phones, check websites and mail servers, and get CRM-ready columns. Failed and duplicate rows are marked, never dropped.

- **URL**: https://apify.com/opendatadesk/lead-list-cleaner.md
- **Developed by:** [Open Data Desk](https://apify.com/opendatadesk) (community)
- **Categories:** Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 rows

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

## Lead List Cleaner: Dedupe, Phone, Website and MX

Clean a lead list or a CRM export into flat, ready-to-use columns. The Actor finds duplicates, normalises phone numbers, checks whether a website responds, and looks up the mail server for each e-mail domain. Rows that fail a check, or that look like duplicates, are not dropped. They stay in the results with a status and a list of issues.

This Actor does not scrape websites for new contacts. It only works on the rows you give it.

### What does Lead List Cleaner do?

Typical uses:

- Clean a Google Maps, LinkedIn or CSV export before you import it into a CRM.
- Find duplicate companies and people in a list you already have.
- Check which websites still respond, and which e-mail domains have a mail server.
- Standardise phone numbers to international E.164 format.

### What data do you get?

Each input row becomes one output row.

| Field | What it is |
| --- | --- |
| `inputIndex` | Position of the row in your input, starting at 0 |
| `rowStatus` | `ok`, `duplicate`, `invalid`, or `skipped_limit` |
| `issues` | A list of problems, for example `duplicate_of_0`, `no_mx`, `website_timeout` |
| `companyName`, `fullName`, `firstName`, `lastName` | Names, when they can be read from the input |
| `email`, `emailNormalized` | The original address and a lower-case trimmed copy |
| `emailSyntaxOk`, `emailIsRoleAddress`, `emailIsDisposable`, `emailTypoSuggestion` | Syntax, role addresses such as info@, disposable inboxes, and a suggested domain if a typo is likely |
| `emailHasMx`, `mxHosts` | Whether the domain has MX records, and the hosts |
| `phone`, `phoneE164`, `phoneValid`, `phoneCountry` | The original number and a normalised E.164 number |
| `website`, `websiteNormalized`, `websiteRootDomain` | The site you gave, a full URL, and the host without `www` |
| `websiteReachable`, `websiteStatusCode`, `websiteFinalUrl`, `websiteError` | Whether the site answered, the HTTP status, and the URL after redirects |
| `isDuplicate`, `duplicateOf`, `duplicateMatchedOn` | Set when this row matches an earlier one |
| `original` | The input record, unchanged |

Nothing is guessed that was not in the input, except typo *suggestions* (the original address is never rewritten).

#### Example output

One cleaned row from a test run on a small example list. Duplicate and flagged rows are also kept; they are just marked.

```json
{
    "inputIndex": 0,
    "companyName": "Example Labs",
    "fullName": "Alex Example",
    "firstName": "Alex",
    "lastName": "Example",
    "email": "alex@example.com",
    "emailNormalized": "alex@example.com",
    "emailSyntaxOk": true,
    "emailIsRoleAddress": false,
    "emailIsDisposable": false,
    "emailTypoSuggestion": null,
    "emailDomain": "example.com",
    "phone": "+1 415 555 2671",
    "phoneE164": "+14155552671",
    "phoneValid": true,
    "phoneCountry": "US",
    "website": "https://example.com",
    "websiteRootDomain": "example.com",
    "issues": [],
    "original": {
        "company": "Example Labs",
        "name": "Alex Example",
        "email": "alex@example.com",
        "phone": "+1 415 555 2671",
        "website": "https://example.com"
    },
    "emailHasMx": true,
    "mxHosts": [
        ""
    ],
    "mxError": null,
    "websiteNormalized": "https://example.com/",
    "websiteReachable": true,
    "websiteStatusCode": 200,
    "websiteFinalUrl": "https://example.com/",
    "websiteError": null,
    "isDuplicate": false,
    "duplicateOf": null,
    "duplicateMatchedOn": [],
    "rowStatus": "ok",
    "checkedWebsites": true,
    "checkedMx": true
}
```

### Nothing is silently dropped

Every input row is written to the results. Duplicates are marked, not removed. Invalid e-mails and failed website checks are marked, not removed. If you set `Max rows to check` lower than the size of your list, the remaining rows are still written with status `skipped_limit`.

### How to use it

1. Paste your leads as JSON in `Records`, or give a dataset ID from a previous Apify run.
2. Set `Default phone country` if many numbers have no country prefix (for example `DK` or `US`).
3. Choose how duplicates should be found. The default is matching e-mail or phone number.
4. Leave the website and MX checks on, unless you only want formatting and deduplication.
5. Set `Max rows to check` and click Start.
6. Download the result as JSON, CSV or Excel, or read it with the API.

Common column names such as `email`, `phone`, `website`, `company` and `name` are detected automatically. If your columns are named something else, fill in the column fields.

### Limits

- Website checks follow redirects and wait a few seconds. A site behind a strict bot filter may look down even if a browser can open it.
- The MX check only looks at DNS. It does not test whether a mailbox exists, and it does not send mail.
- Disposable-domain detection uses a bundled public list (MIT licence, see `src/disposable-domains.LICENSE`). The list is a snapshot, not a live feed.

### How much does it cost?

You pay for each row that is written, including duplicates, invalid rows and rows skipped because the max was reached. The price per 1,000 rows is shown at the top of this page, and you can set a maximum cost per run.

### Data and privacy

The Actor works on data you already have. It does not keep a copy after the run ends, beyond what Apify stores for your run in the usual way. You are responsible for how you use personal data in the list, including e-mail addresses and phone numbers.

### Issues and requests

If a column is not picked up, or a check looks wrong, please open an issue on the Issues tab with a couple of sample rows (you can hide personal data).

# Actor input Schema

## `records` (type: `array`):

Your leads as JSON objects. Common column names such as email, phone, website and company are detected automatically. Every input row is written back, including duplicates and rows that fail a check.

## `datasetId` (type: `string`):

Optional. Read rows from an existing Apify dataset (for example the result of a previous scrape) and clean them too.

## `defaultCountry` (type: `string`):

ISO country code used when a phone number has no country prefix, for example US, DK, FR or GB.

## `dedupeBy` (type: `array`):

A later row that matches an earlier one on any of these keys is marked as a duplicate. It is still returned.

## `checkWebsites` (type: `boolean`):

Sends a request to each website and records the status and the final URL after redirects.

## `checkMx` (type: `boolean`):

Looks up MX records in DNS. This does not open an SMTP connection or test whether a mailbox exists.

## `emailField` (type: `string`):

Use this column name instead of auto-detection.

## `phoneField` (type: `string`):

Use this column name instead of auto-detection.

## `websiteField` (type: `string`):

Use this column name instead of auto-detection.

## `companyField` (type: `string`):

Use this column name instead of auto-detection.

## `nameField` (type: `string`):

Use this column name instead of auto-detection.

## `firstNameField` (type: `string`):

Use this column name instead of auto-detection.

## `lastNameField` (type: `string`):

Use this column name instead of auto-detection.

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

How many websites to check at the same time, from 1 to 10.

## `maxItems` (type: `integer`):

Website and MX checks stop after this many rows. Any remaining rows are still written, with status skipped_limit, so nothing is silently dropped.

## Actor input object example

```json
{
  "records": [
    {
      "company": "Example Labs",
      "name": "Alex Example",
      "email": "alex@example.com",
      "phone": "+1 415 555 2671",
      "website": "https://example.com"
    },
    {
      "company": "Example Labs",
      "name": "Alex Example",
      "email": "ALEX@example.com",
      "phone": "415-555-2671",
      "website": "example.com"
    },
    {
      "company": "Temporary Inbox",
      "email": "hello@mailinator.com",
      "website": "not a url"
    }
  ],
  "defaultCountry": "US",
  "dedupeBy": [
    "email",
    "phone"
  ],
  "checkWebsites": true,
  "checkMx": true,
  "concurrency": 5,
  "maxItems": 100
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset of cleaned rows. Each input row is written back, including duplicates and failed checks.

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

A short JSON summary of the run, including counts.

# 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 = {
    "records": [
        {
            "company": "Example Labs",
            "name": "Alex Example",
            "email": "alex@example.com",
            "phone": "+1 415 555 2671",
            "website": "https://example.com"
        },
        {
            "company": "Example Labs",
            "name": "Alex Example",
            "email": "ALEX@example.com",
            "phone": "415-555-2671",
            "website": "example.com"
        },
        {
            "company": "Temporary Inbox",
            "email": "hello@mailinator.com",
            "website": "not a url"
        }
    ],
    "defaultCountry": "US",
    "dedupeBy": [
        "email",
        "phone"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("opendatadesk/lead-list-cleaner").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 = {
    "records": [
        {
            "company": "Example Labs",
            "name": "Alex Example",
            "email": "alex@example.com",
            "phone": "+1 415 555 2671",
            "website": "https://example.com",
        },
        {
            "company": "Example Labs",
            "name": "Alex Example",
            "email": "ALEX@example.com",
            "phone": "415-555-2671",
            "website": "example.com",
        },
        {
            "company": "Temporary Inbox",
            "email": "hello@mailinator.com",
            "website": "not a url",
        },
    ],
    "defaultCountry": "US",
    "dedupeBy": [
        "email",
        "phone",
    ],
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("opendatadesk/lead-list-cleaner").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 '{
  "records": [
    {
      "company": "Example Labs",
      "name": "Alex Example",
      "email": "alex@example.com",
      "phone": "+1 415 555 2671",
      "website": "https://example.com"
    },
    {
      "company": "Example Labs",
      "name": "Alex Example",
      "email": "ALEX@example.com",
      "phone": "415-555-2671",
      "website": "example.com"
    },
    {
      "company": "Temporary Inbox",
      "email": "hello@mailinator.com",
      "website": "not a url"
    }
  ],
  "defaultCountry": "US",
  "dedupeBy": [
    "email",
    "phone"
  ],
  "maxItems": 100
}' |
apify call opendatadesk/lead-list-cleaner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opendatadesk/lead-list-cleaner"
        }
    }
}
```

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/3kTwrPgfHsgmAWWT3/builds/mQaidomAc1u0S11GY/openapi.json
