# Contact List Cleaner & Deduplicator (`vantoannguyen/contact-list-cleaner`) Actor

Clean contact and lead lists from CSV, Excel, Google Sheets or Apify datasets: phones to E.164 (240+ countries), email fixes, name splitting, date formats, exact + fuzzy dedupe. Clean CSV/Excel + report.

- **URL**: https://apify.com/vantoannguyen/contact-list-cleaner.md
- **Developed by:** [Van Toan Nguyen](https://apify.com/vantoannguyen) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / 1,000 contact row cleaneds

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

### What does Contact List Cleaner & Deduplicator do?

**Contact List Cleaner & Deduplicator** turns a messy contact or lead list into a clean, de-duplicated list
that is ready to import into a CRM, an email tool or an SMS/WhatsApp tool. It works on:

- **CSV, Excel (.xlsx) and JSON files**: a link, a Google Sheets / Google Drive / Dropbox share link, or an upload
- **Apify datasets**: for example the results of **Google Maps Scraper** or any lead scraper. Merge several runs
  and remove the overlap in one step
- **JSON rows** sent through the API, an integration or an AI agent

In one run it fixes **phone numbers** (E.164 format for 240+ countries, using Google's libphonenumber),
**emails**, **names**, **dates**, **websites** and **whitespace**. It also removes **exact and near-duplicate**
contacts and tells you, row by row, what still needs a human look.

No API keys, no proxies, no scraping: the Actor only processes the data you give it.

### Why use it?

Lists that come from several exports, sign-up forms or scraper runs are rarely ready to use:

- `(503) 555-0142`, `503.555.0142` and `+1 503 555 0142` are the same number, but a CRM sees three contacts
- `Maria.Lopez@Example.com `, `mailto:maria.lopez@example.com` and `maria.lopez@@example.com` are one person
- "Bob Chen" and "Robert Chen" at the same company are one person
- two Google Maps Scraper runs over overlapping areas return the same businesses twice
- dates arrive as `03/14/2026`, `14.03.2026`, `March 3, 2026` or Excel serial numbers

Cleaning that by hand takes hours and is easy to get wrong. This Actor does it in seconds and **keeps an audit
trail**: every output row says which input rows (file / dataset and row number) were merged into it.

### Features

| Step | What it does |
|---|---|
| **Phones** | Parses and validates with libphonenumber. Output as E.164 `+15035550142`, international `+1 503-555-0142` or national `(503) 555-0142`. Adds `phone_country` (US, GB, VN...) and `phone_type` (MOBILE, FIXED_LINE, TOLL_FREE, VOIP...). Keeps extensions (`x204`). Uses a per-row `Country` / `countryCode` column when present |
| **Emails** | Lower-cases and repairs `mailto:`, `<...>`, `@@`, `,com`, `.con`, `..`, then checks the syntax. Flags role accounts (`info@`, `sales@`), free providers (gmail.com...) and disposable domains. Cells with several emails keep the first valid one in `email` and the rest in `other_emails` |
| **Names** | `JAMES O'CONNOR` → `James O'Connor`, `Lopez, Maria` → first `Maria`, last `Lopez`. Handles titles (Dr.), suffixes (Jr., III) and particles (van der, de la). Deliberate mixed case such as `DeShawn` is kept |
| **Businesses** | For Google Maps-style data the business name (`title`) is used as the company, and websites are normalised to `https://...` plus a bare `domain` column |
| **Dates** | ISO, US and EU numeric dates, 2-digit years, month names, ordinals, timestamps and Excel serials → `YYYY-MM-DD`. Ambiguous dates (03/04) follow your setting and get a warning |
| **Duplicates** | Removes rows that are identical after cleaning, rows with the same ID (Google Maps `placeId` automatically, or any column you choose), and near-duplicates: same email; same phone + similar name; similar name (typos, nicknames such as Bob/Robert) at the same company or city; same website + similar business name. The most complete record is kept and its gaps are filled from the others. Conflicting emails or phones are kept in `merge_notes`, so nothing is silently lost |
| **Checks** | `status = REVIEW` with a plain-English `issues` column for a missing name, invalid email or phone, no contact method, an unreadable date or a date in the future |
| **Columns** | Detected automatically ("E-mail", "Phone #", "Organisation", "Date Joined"...). You can override the mapping. Your other columns are kept |

### How to use it

1. Click **Try for free**.
2. Add your list: paste a file link, upload a file, pick one or more datasets, or paste JSON rows.
3. Set **Default phone country** to the country most of your numbers are from (numbers with `+` keep their own country).
4. Click **Start**. Download the clean list from the **Output** tab as CSV, Excel or JSON.

**Tip for Google Maps Scraper users:** add this Actor as an **integration** on your scraper task ("run Actor
after"), or pick the scraper's datasets in the *Apify datasets* field to merge and de-duplicate several runs.

### Input example

```json
{
    "fileUrls": ["https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit#gid=0"],
    "datasetIds": ["YOUR_GOOGLE_MAPS_DATASET_ID"],
    "defaultCountry": "US",
    "phoneFormat": "E164",
    "dateFormat": "MDY",
    "recordType": "auto",
    "fuzzyMatching": true,
    "outputRows": "ALL"
}
```

| Field | Default | Meaning |
|---|---|---|
| `fileUrls` | - | Links to CSV / XLSX / JSON files. Google Sheets, Drive and Dropbox share links work if shared as "Anyone with the link" |
| `uploadedFile` | - | One uploaded file |
| `datasetIds` | - | Apify datasets to read (read-only access) |
| `rows` | - | JSON array of objects |
| `sheetName` | first sheet | Worksheet to read from Excel files |
| `defaultCountry` | `US` | 2-letter country for numbers without a country code |
| `phoneFormat` | `E164` | `E164`, `INTERNATIONAL` or `NATIONAL` |
| `dateFormat` | `MDY` | How to read ambiguous dates: `MDY` (US) or `DMY` (EU/Asia) |
| `recordType` | `auto` | `people`, `businesses` or `auto` |
| `fuzzyMatching` | `true` | Merge near-duplicates, not only exact ones |
| `nameSimilarityPercent` | `88` | Name similarity needed for a near-duplicate (50-100) |
| `dedupeKeyColumns` | auto | Columns that identify a record (e.g. a CRM ID). `placeId` is used automatically |
| `columnMapping` | auto | e.g. `{"email": "Work E-mail", "phone": "Mobile"}` |
| `outputRows` | `ALL` | `ALL` or `OK_ONLY` (dataset only; the files always contain every row) |
| `saveCsv` / `saveExcel` | `true` | Save `clean_contacts.csv` / `clean_contacts.xlsx` |
| `maxRows` | `0` | Stop after this many rows (0 = no limit) |

### Output

**Dataset**: one item per unique contact. Example (two input rows merged into one):

```json
{
    "first_name": "Robert",
    "last_name": "Chen",
    "email": "rchen@example.com",
    "phone": "+13125550199 x204",
    "company": "Blue Heron Logistics",
    "city": "Chicago",
    "signup_date": "2026-02-20",
    "phone_country": "US",
    "phone_type": "FIXED_LINE_OR_MOBILE",
    "website": "",
    "domain": "",
    "email_is_role": false,
    "email_is_free": false,
    "email_is_disposable": false,
    "other_emails": "",
    "other_phones": "",
    "Notes": "met at trade fair",
    "status": "OK",
    "issues": "",
    "merge_notes": "",
    "source_rows": "7, 8",
    "source": "messy_contacts.xlsx row 7; messy_contacts.xlsx row 8"
}
```

The input rows were `Robert Chen, rchen@example.com, (312) 555-0199 ext 204, ..., 2026-02-20` and
`Bob Chen, , 312-555-0199, ..., Feb 21 2026, met at trade fair`.

**Key-value store**:

| Key | Content |
|---|---|
| `clean_contacts.csv` | All clean contacts (UTF-8, opens correctly in Excel) |
| `clean_contacts.xlsx` | Same, with REVIEW rows highlighted, filters and frozen header |
| `review_rows.csv` | Only the rows that need a human look (written when there are any) |
| `report.md` | Summary, fixes applied, column mapping, issues, every duplicate merge and why |
| `OUTPUT` | JSON summary: counts, column mapping, sources and file links |

On a sample list of 47 rows of typical CRM mess (1 blank row), a run gives: 46 rows read, 5 exact and
6 near-duplicates removed, 35 clean contacts (30 OK, 5 to review), 41 phone numbers and 23 dates standardised.

### How much does it cost?

This Actor uses **pay-per-event** pricing: you pay **$0.20 per 1,000 rows cleaned** (one `row-cleaned` event per
non-blank input row), plus Apify's small standard start fee. Platform usage is included. For example:

| List size | Price |
|---|---|
| 1,000 rows | $0.20 |
| 10,000 rows | $2.00 |
| 100,000 rows | $20.00 |

You set the **maximum cost per run** when you start the Actor. If the list is bigger than that budget, the Actor
cleans as many rows as the budget allows and tells you in the status message, so you are never charged more
than your limit. Use `maxRows` for a cheap test run first.

### Is my data safe?

The Actor runs in your own Apify account and storage. It does not send your data to any third-party service:
phone validation uses an offline library and no email is sent or probed. It only reads the datasets you pick
(read-only permission). You are responsible for having the right to process the personal data in your lists
(for example under GDPR).

### Limitations

- Email checks are **syntax and typo repair only**. The Actor does not connect to mail servers, so it cannot tell
  whether a mailbox exists. Use an email verification Actor for that after cleaning.
- `phone_type` and validity come from libphonenumber metadata. In a few countries fixed and mobile numbers look
  the same (`FIXED_LINE_OR_MOBILE`), and brand-new number ranges can be reported as invalid until the library is updated.
- Name splitting and nickname matching are tuned for Western names. For other naming orders, provide separate
  first-name and last-name columns or turn off near-duplicate matching.
- Files up to 50 MB per link. For very large lists (millions of rows) split the list into several runs.

### FAQ

**Can I run it from my own code?** Yes, through the Apify API or the Apify Python / JavaScript clients, for
example `POST https://api.apify.com/v2/acts/<username>~contact-list-cleaner/run-sync-get-dataset-items` with the
input JSON above.

**How fast is it?** Roughly 1,000-2,000 rows per second including duplicate matching: about 6 seconds for
10,000 rows and under a minute for 50,000 rows with the default 1 GB memory. For lists above ~150,000 rows,
give the run 2-4 GB of memory.

**Does it change my original file or dataset?** No. Results go to the run's own dataset and key-value store.

**Something looks wrong?** Open an issue on the Actor page with a few example rows (with personal data removed)
and the result you expected.

# Actor input Schema

## `fileUrls` (type: `array`):

Public links to .csv, .xlsx or .json files. Google Sheets, Google Drive and Dropbox share links are converted to download links automatically (the file must be shared as 'Anyone with the link').

## `uploadedFile` (type: `string`):

Upload a CSV, Excel or JSON file from your computer.

## `datasetIds` (type: `array`):

Pick datasets from earlier runs, e.g. results of Google Maps Scraper or any lead scraper. Rows from all datasets are merged and de-duplicated together. The Actor only reads them.

## `rows` (type: `array`):

An array of objects, handy for API and AI-agent use. Example: \[{"name": "maria LOPEZ", "email": "Maria.Lopez@Example.com ", "phone": "(503) 555-0142"}]

## `sheetName` (type: `string`):

Name of the worksheet to read from Excel files. Leave empty to read the first sheet.

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

Two-letter country code used for phone numbers written without +country code, e.g. US, GB, DE, FR, IN, AU, VN. Numbers that start with + or 00 keep their own country. If a row has a 'Country' / 'countryCode' column with a 2-letter code, that row uses it instead.

## `phoneFormat` (type: `string`):

E164: +15035550142 (best for CRMs, SMS and WhatsApp tools). INTERNATIONAL: +1 503-555-0142. NATIONAL: (503) 555-0142.

## `dateFormat` (type: `string`):

How to read dates like 03/04/2026 where both parts could be the month. Dates such as 14/03/2026 or 2026-03-14 are always read correctly. Output is always YYYY-MM-DD.

## `recordType` (type: `string`):

People: a 'Name' column is split into first and last name. Businesses: a 'Name' or 'title' column is the business name. Auto: businesses when the data looks like a Google Maps export, otherwise people.

## `fuzzyMatching` (type: `boolean`):

Besides exact duplicates, merge rows that share an email, a phone plus a similar name, or a similar name (typos, nicknames such as Bob/Robert) at the same company or city. The most complete row is kept and its gaps are filled from the others.

## `nameSimilarityPercent` (type: `integer`):

How similar two names must be to count as the same contact (with the same company or city). Lower = more merging.

## `dedupeKeyColumns` (type: `array`):

Optional. Rows with the same values in all these columns are always merged, e.g. a CRM ID. Google Maps 'placeId' is used automatically when present.

## `columnMapping` (type: `object`):

Columns are detected automatically ("E-mail", "Phone #", "Organisation", "Date Joined" ...). Override when needed, e.g. {"email": "Work E-mail", "phone": "Mobile"}. Fields: full_name, first_name, last_name, email, phone, company, city, website, signup_date.

## `outputRows` (type: `string`):

ALL: every clean contact with status OK or REVIEW (the issues column says what to check). OK_ONLY: only contacts that passed all checks. The CSV/Excel files always contain all rows.

## `saveCsv` (type: `boolean`):

Save clean_contacts.csv (UTF-8, opens in Excel) to the key-value store.

## `saveExcel` (type: `boolean`):

Save clean_contacts.xlsx with REVIEW rows highlighted.

## `maxRows` (type: `integer`):

Stop after this many input rows (0 = no limit). Useful for a cheap test run.

## Actor input object example

```json
{
  "fileUrls": [
    "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit#gid=0"
  ],
  "rows": [
    {
      "name": "  maria   LOPEZ ",
      "email": "Maria.Lopez@Example.com ",
      "phone": "(503) 555-0142",
      "company": "harbor lane boutique",
      "city": "portland",
      "signup date": "2026-01-15"
    },
    {
      "name": "Lopez, Maria",
      "email": "maria.lopez@example.com",
      "phone": "503.555.0142",
      "company": "Harbor Lane Boutique",
      "city": "Portland",
      "signup date": "01/15/2026"
    },
    {
      "name": "Bob Chen",
      "email": "",
      "phone": "312-555-0199",
      "company": "Blue Heron Logistics",
      "city": "Chicago",
      "signup date": "Feb 21 2026"
    },
    {
      "name": "Robert Chen",
      "email": "mailto:RChen@Example.com",
      "phone": "(312) 555-0199 ext 204",
      "company": "BLUE HERON LOGISTICS",
      "city": "Chicago",
      "signup date": "2026-02-20"
    },
    {
      "name": "Dr. Priya Raman",
      "email": "priya.raman@@example.org",
      "phone": "+44 20 7946 0958",
      "company": "Copperline Studio",
      "city": "London",
      "signup date": "14/03/2026"
    },
    {
      "name": "Samantha Reed",
      "email": "samantha.reed@example",
      "phone": "555-0134",
      "company": "Lakeshore Print Co.",
      "city": "Cleveland",
      "signup date": "2026-13-01"
    }
  ],
  "defaultCountry": "US",
  "phoneFormat": "E164",
  "dateFormat": "MDY",
  "recordType": "auto",
  "fuzzyMatching": true,
  "nameSimilarityPercent": 88,
  "outputRows": "ALL",
  "saveCsv": true,
  "saveExcel": true,
  "maxRows": 0
}
```

# Actor output Schema

## `contacts` (type: `string`):

One item per unique contact with status, issues and source rows.

## `cleanCsv` (type: `string`):

clean_contacts.csv - all clean contacts, ready to import into a CRM.

## `cleanExcel` (type: `string`):

clean_contacts.xlsx - REVIEW rows highlighted.

## `report` (type: `string`):

report.md - every fix, duplicate merge and row to review.

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

OUTPUT record with counts, column mapping and file links.

# 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 = {
    "rows": [
        {
            "name": "  maria   LOPEZ ",
            "email": "Maria.Lopez@Example.com ",
            "phone": "(503) 555-0142",
            "company": "harbor lane boutique",
            "city": "portland",
            "signup date": "2026-01-15"
        },
        {
            "name": "Lopez, Maria",
            "email": "maria.lopez@example.com",
            "phone": "503.555.0142",
            "company": "Harbor Lane Boutique",
            "city": "Portland",
            "signup date": "01/15/2026"
        },
        {
            "name": "Bob Chen",
            "email": "",
            "phone": "312-555-0199",
            "company": "Blue Heron Logistics",
            "city": "Chicago",
            "signup date": "Feb 21 2026"
        },
        {
            "name": "Robert Chen",
            "email": "mailto:RChen@Example.com",
            "phone": "(312) 555-0199 ext 204",
            "company": "BLUE HERON LOGISTICS",
            "city": "Chicago",
            "signup date": "2026-02-20"
        },
        {
            "name": "Dr. Priya Raman",
            "email": "priya.raman@@example.org",
            "phone": "+44 20 7946 0958",
            "company": "Copperline Studio",
            "city": "London",
            "signup date": "14/03/2026"
        },
        {
            "name": "Samantha Reed",
            "email": "samantha.reed@example",
            "phone": "555-0134",
            "company": "Lakeshore Print Co.",
            "city": "Cleveland",
            "signup date": "2026-13-01"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vantoannguyen/contact-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 = { "rows": [
        {
            "name": "  maria   LOPEZ ",
            "email": "Maria.Lopez@Example.com ",
            "phone": "(503) 555-0142",
            "company": "harbor lane boutique",
            "city": "portland",
            "signup date": "2026-01-15",
        },
        {
            "name": "Lopez, Maria",
            "email": "maria.lopez@example.com",
            "phone": "503.555.0142",
            "company": "Harbor Lane Boutique",
            "city": "Portland",
            "signup date": "01/15/2026",
        },
        {
            "name": "Bob Chen",
            "email": "",
            "phone": "312-555-0199",
            "company": "Blue Heron Logistics",
            "city": "Chicago",
            "signup date": "Feb 21 2026",
        },
        {
            "name": "Robert Chen",
            "email": "mailto:RChen@Example.com",
            "phone": "(312) 555-0199 ext 204",
            "company": "BLUE HERON LOGISTICS",
            "city": "Chicago",
            "signup date": "2026-02-20",
        },
        {
            "name": "Dr. Priya Raman",
            "email": "priya.raman@@example.org",
            "phone": "+44 20 7946 0958",
            "company": "Copperline Studio",
            "city": "London",
            "signup date": "14/03/2026",
        },
        {
            "name": "Samantha Reed",
            "email": "samantha.reed@example",
            "phone": "555-0134",
            "company": "Lakeshore Print Co.",
            "city": "Cleveland",
            "signup date": "2026-13-01",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("vantoannguyen/contact-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 '{
  "rows": [
    {
      "name": "  maria   LOPEZ ",
      "email": "Maria.Lopez@Example.com ",
      "phone": "(503) 555-0142",
      "company": "harbor lane boutique",
      "city": "portland",
      "signup date": "2026-01-15"
    },
    {
      "name": "Lopez, Maria",
      "email": "maria.lopez@example.com",
      "phone": "503.555.0142",
      "company": "Harbor Lane Boutique",
      "city": "Portland",
      "signup date": "01/15/2026"
    },
    {
      "name": "Bob Chen",
      "email": "",
      "phone": "312-555-0199",
      "company": "Blue Heron Logistics",
      "city": "Chicago",
      "signup date": "Feb 21 2026"
    },
    {
      "name": "Robert Chen",
      "email": "mailto:RChen@Example.com",
      "phone": "(312) 555-0199 ext 204",
      "company": "BLUE HERON LOGISTICS",
      "city": "Chicago",
      "signup date": "2026-02-20"
    },
    {
      "name": "Dr. Priya Raman",
      "email": "priya.raman@@example.org",
      "phone": "+44 20 7946 0958",
      "company": "Copperline Studio",
      "city": "London",
      "signup date": "14/03/2026"
    },
    {
      "name": "Samantha Reed",
      "email": "samantha.reed@example",
      "phone": "555-0134",
      "company": "Lakeshore Print Co.",
      "city": "Cleveland",
      "signup date": "2026-13-01"
    }
  ]
}' |
apify call vantoannguyen/contact-list-cleaner --silent --output-dataset

```

## MCP server setup

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