# Contact List Cleaner – Clean CSV Phones, Emails, Names, Dates (`gazidev/contact-list-cleaner`) Actor

Clean contact lists in bulk: phones to E.164, email syntax, first and last name split, ISO dates and country codes, broken text (mojibake) repair, duplicate flags. CSV, Excel or Apify dataset in. Every change is logged. Offline rules, no AI. $0.20 per 1,000 rows.

- **URL**: https://apify.com/gazidev/contact-list-cleaner.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (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 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

## Contact list cleaner: clean phone numbers, emails, names, dates and countries in CSV, Excel or datasets

**Contact List Cleaner** turns a messy contact list into rows you can import into a CRM, dialer or mailing tool. It finds the contact columns by itself and fixes them:

| Column | What it does | Example |
|---|---|---|
| **Phones** | E.164 format, checked with Google's libphonenumber rules | `0044 20 7946 0958` → `+442079460958` |
| **E-mails** | Syntax check, lower case, removes `mailto:`, `<...>`, `[at]` | `jose [at] example [dot] org` → `jose@example.org` |
| **Names** | Upper/lower case, split into first and last name | `SMITH, JANE` → `Jane` + `Smith` |
| **Dates** | ISO 8601 | `14.02.2024`, `March 5, 2024` → `2024-02-14`, `2024-03-05` |
| **Countries** | ISO 3166 codes or English names, input in about 40 languages | `Deutschland`, `U.S.A.` → `DE`, `US` |
| **All text** | Broken characters (mojibake), invisible characters, outer spaces | `JosÃ© GarcÃ­a` → `José García` |

Every changed cell is listed in `_changes` (from, to, rule). Every problem is listed in `_issues`. Duplicates are flagged or removed. Price: **$0.20 per 1,000 rows** plus $0.002 per 1,000 rows read.

**Privacy:** all rules run offline inside your run. There is no AI model, no DNS lookup, no third-party API. No contact value is written to the log or to a named storage. Your data stays in this run's input, dataset and key-value store, under your account's data retention.

### Use cases

- Clean leads from Google Maps or other scrapers before a CRM import (HubSpot, Salesforce, Pipedrive)
- Convert phone numbers to E.164 for SMS, WhatsApp or dialer tools
- Repair CSV exports with broken accents
- Put dates and countries from several sources into one format
- Find the same person twice in a list, even when the e-mail or phone is written differently

### Input example

```json
{
  "rows": [
    {"Full Name": "SMITH, JANE", "Email": " Jane.Smith@Example.COM ", "Phone": "(415) 555-0132", "Country": "U.S.A.", "Signup Date": "3/25/2024"},
    {"Full Name": "Dr. Anna van der Berg", "Email": "anna@gmial.com", "Phone": "030 23125 014", "Country": "Deutschland", "Signup Date": "14.02.2024"}
  ],
  "defaultCountry": "US"
}
```

A file or a dataset instead of rows:

```json
{
  "fileUrls": ["https://example.com/leads.xlsx"],
  "defaultCountry": "GB",
  "dateOrder": "DMY",
  "rules": [
    {"field": "Tel 2", "type": "phone", "country": "DE"},
    {"field": "Internal note", "type": "skip"}
  ],
  "duplicates": "remove",
  "exportFormat": "xlsx"
}
```

Sources: pasted rows, one Apify dataset (read only), CSV, TSV, XLSX, XLS, XLSB, ODS, JSON, JSON Lines. Shared Google Sheets, Drive, Dropbox and OneDrive links work. To clean every run of a scraper: *Integrations → Connect Actor*, with `"datasetId": "{{resource.defaultDatasetId}}"`.

### Output example

```json
{
  "Full Name": "Dr. Anna van der Berg", "Email": "anna@gmial.com", "Phone": "+493023125014", "Country": "DE", "Signup Date": "2024-02-14",
  "firstName": "Anna", "lastName": "van der Berg", "namePrefix": "Dr.",
  "_row": 2, "_duplicateOfRow": null,
  "_changes": [
    {"field": "Phone", "from": "030 23125 014", "to": "+493023125014", "rule": "phone"},
    {"field": "Signup Date", "from": "14.02.2024", "to": "2024-02-14", "rule": "date"}
  ],
  "_issues": [
    {"field": "Email", "code": "EMAIL_TYPO_SUSPECTED", "message": "The domain looks like a typo.", "suggestion": "anna@gmail.com"}
  ]
}
```

All other columns are kept. The `OUTPUT` record has the counts, the columns found, warnings and charges. `exportFormat` adds one CSV, XLSX or JSON file.

**Issue codes:** `EMAIL_INVALID`, `EMAIL_TYPO_SUSPECTED`, `EMAIL_MULTIPLE`, `PHONE_INVALID`, `PHONE_NO_COUNTRY`, `PHONE_ASSUMED_INTERNATIONAL`, `PHONE_SCIENTIFIC_NOTATION`, `PHONE_EXTENSION_REMOVED`, `PHONE_MULTIPLE`, `DATE_INVALID`, `DATE_AMBIGUOUS`, `DATE_INCOMPLETE`, `DATE_TWO_DIGIT_YEAR`, `DATE_FROM_EXCEL_NUMBER`, `COUNTRY_UNKNOWN`, `NAME_LOOKS_LIKE_COMPANY`, `TEXT_DAMAGED`, `ROW_NOT_CLEANED`.

### Pricing (pay per event)

| Event | Price |
|---|---|
| Row cleaned | **$0.0002** ($0.20 per 1,000) |
| 1,000 source rows read (per started 1,000) | $0.002 |
| Export file (CSV / XLSX / JSON) | $0.003 |
| Actor start | $0.00005 |

- The 1-click example (5 rows): about **$0.003**. 1,000 rows: about **$0.202**. 10,000 rows: about **$2.02**.
- Removed duplicates, failed sources, invalid input and skipped rows are not charged as rows. A maximum cost per run stops the Actor cleanly.

| Actor (Apify Store, 24 Nov 2026) | Price |
|---|---|
| **This Actor** | **$0.0002 per row** + $0.002 per 1,000 rows read |
| cleaner_86/address-phone-cleaner | $0.0004 per record |
| tamatama/data-normalizer | $0.0008 per row |
| taroyamada/csv-data-cleaner | $0.001 per row |
| opstoolkit/dataset-cleaner | $0.003 per row |
| draeg82/csv-cleaner | $0.015 per CSV file (cheaper for large files; other feature set) |

### What it does not do

- **It does not check whether a contact exists.** A number can be valid by the numbering plan and still be out of service. An e-mail with correct syntax may bounce. For MX records and disposable domains use [Email Syntax & MX Validator](https://apify.com/gazidev/email-syntax-mx-validator).
- Phones without a country code need a country: the rule's `country`, else the country column of the row, else `defaultCountry`.
- Values that cannot be cleaned stay as they are by default (`invalidValues: "empty"` clears them). E-mail typos are only corrected with `fixEmailTypos`.
- Name splitting is a rule of thumb. It knows titles, suffixes, `Last, First` and particles such as *van der*, but not every culture. Names in mixed case are not changed. Company-like names are not split.
- Day and month: the order is taken from the first 500 rows of the column. Unclear dates are reported as `DATE_AMBIGUOUS`; set `dateOrder` to be sure.
- Automatic column detection uses the header (8 languages), and for e-mails and +phones also the content. Nested objects are not searched; lists of phones or e-mails are cleaned.
- CSV encodings: UTF-8, UTF-16 and Windows-1252. Other old encodings should be saved as UTF-8 first.
- Limits: files up to 100 MB, rows up to 1 MB and 1,000 columns. `_changes` shows the first 200 characters of a value.

### Use with AI agents / Apify MCP

Add the Actor to the [Apify MCP server](https://mcp.apify.com). An agent passes up to a few hundred contacts in `rows` and reads back cleaned rows with `_issues` to ask about. Same input, same output: no model is involved.

### Related Actors

- [Dataset Filter & Transform](https://apify.com/gazidev/dataset-filter-transform): filters, sorting, renaming, trim and type conversion for any table. It has **no phone, person-name or country rules** and no change log per row; this Actor has those and no filters.
- [Dataset Merge & Dedupe](https://apify.com/gazidev/dataset-merge-dedupe): join, merge and compare tables. Clean the lists here first, then match them there by e-mail or phone.
- [Phone Validator](https://apify.com/gazidev/phone-validator): one result per number with **line type, carrier, location and time zone**. This Actor only formats and checks numbers, but together with the rest of the row.
- [Email Syntax & MX Validator](https://apify.com/gazidev/email-syntax-mx-validator): **DNS / MX check, disposable and role addresses, score** per address. This Actor checks the syntax only.

### FAQ

**How do I clean a CSV of contacts?** Put a link to the file in `fileUrls`, set `defaultCountry`, start the run and download the dataset or the export file.

**Which phone format is best for a CRM?** E.164, the default. In Excel, open the XLSX export: Excel removes the `+` when it opens a CSV.

**Can it clean several files in one run?** Yes. Duplicates are found across all of them, and each row gets `_source`.

**How are duplicates found?** By the cleaned e-mail address (Gmail dots and +tags ignored). Rows without an e-mail are matched by phone and name. Or choose your own columns in `dedupeBy`.

**Am I allowed to process these contacts?** You are responsible for having a legal basis for personal data (for example under GDPR).

**Which open-source data is used?** [libphonenumber / phonenumbers](https://github.com/daviddrysdale/python-phonenumbers) (Apache-2.0), [ftfy](https://github.com/rspeer/python-ftfy) (Apache-2.0), [email-validator](https://github.com/JoshData/python-email-validator) (Unlicense), country names from Unicode CLDR (Unicode License v3).

# Actor input Schema

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

Paste rows as a JSON array of objects. The example has five messy, made-up contacts. Use a dataset or file below for real lists.

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

Clean the output of another Actor, for example a lead or Google Maps scraper. The dataset is only read. In an integration use {{resource.defaultDatasetId}}.

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

Public links to CSV, TSV, XLSX, XLS, ODS, JSON or JSON Lines files. Shared Google Sheets, Drive, Dropbox and OneDrive links work. Private network addresses are refused.

## `firstRowIsHeader` (type: `boolean`):

Turn off for CSV / Excel files without column names. Columns are then called column_A, column_B and so on.

## `autoDetect` (type: `boolean`):

Recognises phone, e-mail, name, date and country columns by their header (English, German, French, Spanish, Italian, Portuguese, Dutch, Turkish) and by content.

## `rules` (type: `array`):

Overrides the automatic choice. Types: phone, email, name, firstName, lastName, date, country, text (repair only), skip (leave untouched). Optional: country (phone), dateOrder. Example: \[{"field": "Tel 2", "type": "phone", "country": "DE"}]

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

Two-letter code such as US, GB or DE. Used when a phone number has no country code and the row has no country column. Also decides how 03/04/2024 is read when the column gives no hint.

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

E.164 is what CRMs, dialers and SMS tools expect.

## `countryFormat` (type: `string`):

How countries are written.

## `dateOrder` (type: `string`):

Auto reads the order from the column (25/12 can only be day first). Dates that stay unclear are reported as DATE_AMBIGUOUS. Output is always YYYY-MM-DD.

## `splitNames` (type: `boolean`):

Adds firstName and lastName (and middleName, namePrefix, nameSuffix when present). Not used when the list already has first and last name columns.

## `fixNameCase` (type: `boolean`):

JOHN SMITH and john smith become John Smith. Mixed case such as McDonald stays as typed.

## `repairText` (type: `boolean`):

Fixes mojibake (JosÃ© becomes José), invisible characters, HTML entities and outer spaces in all text columns.

## `fixEmailTypos` (type: `boolean`):

Off: gmial.com is only reported with a suggestion. On: it is changed to gmail.com (and reported).

## `invalidValues` (type: `string`):

What happens to phones, e-mails, dates and countries that cannot be cleaned. They are always listed in \_issues.

## `duplicates` (type: `string`):

Same e-mail address, or same phone and name when a row has no e-mail.

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

Optional, e.g. 'Phone' or 'firstName' + 'lastName' + 'City'. All listed columns must match after cleaning. Empty = automatic.

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

Stop after this many cleaned rows. 0 = all rows.

## `exportFormat` (type: `string`):

One file in the key-value store, link in the OUTPUT record. Choose Excel if you open it in Excel: it would cut the + from phones in a CSV.

## `exportFileName` (type: `string`):

Without extension.

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped.

## Actor input object example

```json
{
  "rows": [
    {
      "Full Name": "SMITH, JANE",
      "Email": " Jane.Smith@Example.COM ",
      "Phone": "(415) 555-0132",
      "Country": "U.S.A.",
      "Signup Date": "3/25/2024",
      "City": "San Francisco"
    },
    {
      "Full Name": "josÃ© garcÃ­a",
      "Email": "jose [at] example [dot] org",
      "Phone": "0044 20 7946 0958",
      "Country": "England",
      "Signup Date": "March 5, 2024",
      "City": "London"
    },
    {
      "Full Name": "Dr. Anna van der Berg",
      "Email": "anna@gmial.com",
      "Phone": "030 23125 014",
      "Country": "Deutschland",
      "Signup Date": "14.02.2024",
      "City": "KÃ¶ln"
    },
    {
      "Full Name": "Mark O'Neil Jr.",
      "Email": "mark.oneil@example",
      "Phone": "12345",
      "Country": "Ireland",
      "Signup Date": "31/02/2024",
      "City": "Cork"
    },
    {
      "Full Name": "Jane Smith",
      "Email": "jane.smith@example.com",
      "Phone": "+1 415 555 0132",
      "Country": "United States",
      "Signup Date": "2024-03-25",
      "City": "San Francisco"
    }
  ],
  "firstRowIsHeader": true,
  "autoDetect": true,
  "defaultCountry": "US",
  "phoneFormat": "e164",
  "countryFormat": "iso2",
  "dateOrder": "auto",
  "splitNames": true,
  "fixNameCase": true,
  "repairText": true,
  "fixEmailTypos": false,
  "invalidValues": "keep",
  "duplicates": "flag",
  "maxRows": 0,
  "exportFormat": "none",
  "exportFileName": "contacts-clean",
  "maxFileSizeMb": 50
}
```

# Actor output Schema

## `rows` (type: `string`):

No description

## `files` (type: `string`):

No description

## `summary` (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 = {
    "rows": [
        {
            "Full Name": "SMITH, JANE",
            "Email": " Jane.Smith@Example.COM ",
            "Phone": "(415) 555-0132",
            "Country": "U.S.A.",
            "Signup Date": "3/25/2024",
            "City": "San Francisco"
        },
        {
            "Full Name": "josÃ© garcÃ­a",
            "Email": "jose [at] example [dot] org",
            "Phone": "0044 20 7946 0958",
            "Country": "England",
            "Signup Date": "March 5, 2024",
            "City": "London"
        },
        {
            "Full Name": "Dr. Anna van der Berg",
            "Email": "anna@gmial.com",
            "Phone": "030 23125 014",
            "Country": "Deutschland",
            "Signup Date": "14.02.2024",
            "City": "KÃ¶ln"
        },
        {
            "Full Name": "Mark O'Neil Jr.",
            "Email": "mark.oneil@example",
            "Phone": "12345",
            "Country": "Ireland",
            "Signup Date": "31/02/2024",
            "City": "Cork"
        },
        {
            "Full Name": "Jane Smith",
            "Email": "jane.smith@example.com",
            "Phone": "+1 415 555 0132",
            "Country": "United States",
            "Signup Date": "2024-03-25",
            "City": "San Francisco"
        }
    ],
    "defaultCountry": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/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": [
        {
            "Full Name": "SMITH, JANE",
            "Email": " Jane.Smith@Example.COM ",
            "Phone": "(415) 555-0132",
            "Country": "U.S.A.",
            "Signup Date": "3/25/2024",
            "City": "San Francisco",
        },
        {
            "Full Name": "josÃ© garcÃ­a",
            "Email": "jose [at] example [dot] org",
            "Phone": "0044 20 7946 0958",
            "Country": "England",
            "Signup Date": "March 5, 2024",
            "City": "London",
        },
        {
            "Full Name": "Dr. Anna van der Berg",
            "Email": "anna@gmial.com",
            "Phone": "030 23125 014",
            "Country": "Deutschland",
            "Signup Date": "14.02.2024",
            "City": "KÃ¶ln",
        },
        {
            "Full Name": "Mark O'Neil Jr.",
            "Email": "mark.oneil@example",
            "Phone": "12345",
            "Country": "Ireland",
            "Signup Date": "31/02/2024",
            "City": "Cork",
        },
        {
            "Full Name": "Jane Smith",
            "Email": "jane.smith@example.com",
            "Phone": "+1 415 555 0132",
            "Country": "United States",
            "Signup Date": "2024-03-25",
            "City": "San Francisco",
        },
    ],
    "defaultCountry": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("gazidev/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": [
    {
      "Full Name": "SMITH, JANE",
      "Email": " Jane.Smith@Example.COM ",
      "Phone": "(415) 555-0132",
      "Country": "U.S.A.",
      "Signup Date": "3/25/2024",
      "City": "San Francisco"
    },
    {
      "Full Name": "josÃ© garcÃ­a",
      "Email": "jose [at] example [dot] org",
      "Phone": "0044 20 7946 0958",
      "Country": "England",
      "Signup Date": "March 5, 2024",
      "City": "London"
    },
    {
      "Full Name": "Dr. Anna van der Berg",
      "Email": "anna@gmial.com",
      "Phone": "030 23125 014",
      "Country": "Deutschland",
      "Signup Date": "14.02.2024",
      "City": "KÃ¶ln"
    },
    {
      "Full Name": "Mark O'\''Neil Jr.",
      "Email": "mark.oneil@example",
      "Phone": "12345",
      "Country": "Ireland",
      "Signup Date": "31/02/2024",
      "City": "Cork"
    },
    {
      "Full Name": "Jane Smith",
      "Email": "jane.smith@example.com",
      "Phone": "+1 415 555 0132",
      "Country": "United States",
      "Signup Date": "2024-03-25",
      "City": "San Francisco"
    }
  ],
  "defaultCountry": "US"
}' |
apify call gazidev/contact-list-cleaner --silent --output-dataset

```

## MCP server setup

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