# Contact Data Cleaner: Phone, Email & Name Validator (`dodiabak/contact-data-cleaner`) Actor

Validate and format phone numbers (libphonenumber, 240+ regions), verify email syntax + MX + disposable/role/typos, clean names, parse money in any locale, normalize countries and postal codes, and dedupe CRM rows. Bulk, offline-fast, agent-ready JSON.

- **URL**: https://apify.com/dodiabak/contact-data-cleaner.md
- **Developed by:** [Dodi Abak](https://apify.com/dodiabak) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

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 Data Cleaner: Phone, Email & Name Validator

**Clean and validate messy contact data in bulk, for people and for AI agents.** Phone numbers from 240+ countries and regions (Google libphonenumber data), email syntax with MX lookup and disposable/role/typo detection, person names, money and numbers in any locale, country names in 40 languages, postal codes, and whole CRM/CSV rows with duplicate detection. Everything returns as structured JSON, one result per item.

No scraping and no third-party APIs. The only network call is an optional DNS MX lookup. That keeps runs fast (about 20,000 items in 12 seconds) and cheap.

### What does it do?

| Type | Example input | Example output |
| --- | --- | --- |
| **phone** | `(415) 555-2671`, `0049 30 901820`, `4.91701234567E+11` | `+14155552671`, `+49 30 901820`, type `mobile` / `fixed_line` / `toll_free`…, country, calling code, country time zones, extension, and a reason when invalid (`TOO_SHORT`, `INVALID_COUNTRY`…) |
| **email** | `Jane.Doe+news@GMAIL.com`, `jane@gmial.com` | normalized and canonical (`janedoe@gmail.com`), syntax check, **MX check**, disposable (8,800+ domains), role address (`info@`, `sales@`…), free provider, typo suggestion (`did you mean jane@gmail.com?`), verdict `valid` / `risky` / `invalid` / `unknown` |
| **name** | `JOHN MCDONALD JR`, `Smith, John Paul`, `Dr. ludwig van beethoven` | `John McDonald Jr.` split into honorific, first, middle, last and suffix, keeping particles such as *van*, *de la* and *bin* |
| **amount** | `1.234,56 €`, `CHF 1'234.50`, `₹1,23,456.78`, `(1,200.00)`, `2.5k` | `1234.56` + `EUR`, separators detected, ambiguity flagged, re-formatted in your locale |
| **country** | `Deutschland`, `U.S.A.`, `السعودية`, `日本`, `DEU` | `DE`, `US`, `SA`, `JP` with the English name and time zones |
| **postalCode** | `sw1a1aa` (GB), `902101234` (US) | `SW1A 1AA`, `90210-1234`, format valid or not (45 countries) |
| **record** | `{"first_name":"mary","email":"…","phone":"020 7946 0958","country":"UK"}` | the same row with every recognized column cleaned, a list of issues, a dedupe key, and `isDuplicate` / `duplicateOf` |

### Why use it?

- **Better data, better campaigns.** Fix numbers before SMS or WhatsApp sends, and catch typos and dead email domains before they bounce.
- **CRM imports without the pain.** It repairs numbers that Excel mangled (`4.9170E+11`), normalizes names and countries, and flags duplicates across the batch.
- **Made for AI agents.** Agents can't reliably validate phone numbers or parse `1.234,56` by guessing. Every result has stable field names, error codes and a one-line `summary`.
- **Worldwide.** Phone metadata for every ITU region, country names in 40 languages, and Arabic-Indic and full-width digits.

### How to use it

1. Open the Actor and paste values or rows into **Items**. The prefilled example covers every type.
2. Set **Default country** for local phone numbers without `+`, for example `GB`, `DE`, `IN` or `BR`.
3. Click **Start**, then open the **Overview**, **Phones**, **Emails** or **Records** view. Download as JSON, CSV or Excel, or use the API.

#### Input example

```json
{
  "defaultCountry": "US",
  "checkMx": true,
  "items": [
    "+1 (415) 555-2671",
    "jane@gmial.com",
    "JOHN MCDONALD JR",
    "1.234,56 €",
    { "type": "phone", "value": "030 901820", "country": "DE" },
    { "first_name": "mary", "last_name": "O'BRIEN", "email": "Mary.OBrien+crm@GMAIL.com",
      "phone": "020 7946 0958", "country": "UK", "zip": "sw1a 1aa", "deal_value": "£12.500,00" },
    { "name": "Mary O'Brien", "email": "maryobrien@gmail.com" }
  ]
}
```

Record columns are recognized by name: `email`; `phone`, `mobile`, `tel`, `whatsapp`; `name`, `first_name`, `last_name`, `surname`; `country`; `zip`, `postal_code`, `plz`; `price`, `amount`, `total`, `value`. Map other names with `fieldMap`, for example `{"Handy": "phone", "Land": "country"}`.

#### Output example (record)

```json
{
  "index": 5,
  "type": "record",
  "ok": true,
  "record": {
    "first_name": "Mary", "last_name": "O'Brien", "email": "Mary.OBrien+crm@gmail.com",
    "phone": "+442079460958", "country": "GB", "zip": "SW1A 1AA", "deal_value": 12500
  },
  "issues": [],
  "dedupeKey": "maryobrien@gmail.com",
  "isDuplicate": false,
  "summary": "7 field(s) cleaned, no issues"
}
```

#### Output example (email)

```json
{
  "type": "email",
  "ok": true,
  "clean": "jane@gmial.com",
  "email": {
    "normalized": "jane@gmial.com", "validSyntax": true, "isDisposable": true, "isRoleBased": false,
    "suggestion": "jane@gmail.com", "mx": { "checked": true, "hasMx": false, "acceptsMailViaA": true }, "verdict": "risky"
  },
  "summary": "jane@gmial.com: risky (did you mean jane@gmail.com?), disposable"
}
```

### Use it with AI agents (Apify MCP server)

```
https://mcp.apify.com?tools=actors,dodiabak/contact-data-cleaner
```

Add this URL to Claude, Cursor, VS Code, n8n or any MCP client. Example prompts:

- *"Validate these 300 phone numbers for an SMS campaign in Brazil and drop the landlines."*
- *"Clean this CSV of leads, fix the names and tell me which emails will bounce."*
- *"What is 1.234,56 € as a number?"*

Tip: send many items in **one** run. It's cheaper and faster.

API example:

```bash
curl -X POST "https://api.apify.com/v2/acts/dodiabak~contact-data-cleaner/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"defaultCountry":"GB","items":["07700 900123","bob@example.com"]}'
```

### How much does it cost?

You pay **$0.001 per result**, which is **$1 per 1,000 items**, plus Apify's tiny start fee. A whole CRM row with phone, email, name and country counts as **one** result. MX lookups are included. Set *Max cost per run* to cap spending; the Actor stops when the limit is reached.

### FAQ

**Does it check that a mailbox exists?** No. It checks syntax, that the domain exists and has a mail server (MX, or an A record per RFC 5321), the RFC 7505 "null MX", disposable domains, role addresses and typos. It never connects to mail servers (no SMTP probing), which is slow, often blocked, and can harm sender reputation. `verdict: "valid"` means *deliverable domain, no red flags*.

**Can it tell me the phone carrier or owner?** No. It gives the number type (mobile, fixed line, VoIP, toll-free…) from official numbering-plan metadata. There's no carrier lookup, HLR lookup or owner lookup.

**What does `fixed_line_or_mobile` mean?** In some countries, such as the US and Canada, the numbering plan doesn't distinguish mobile from landline numbers.

**How are ambiguous numbers like `1,234` handled?** By default a single separator followed by exactly three digits is read as a thousands separator, and the result says `separatorAmbiguous: true`. Set `numberLocale` (for example `de-DE`) to read it as a decimal comma.

**Is my data stored?** Only in your own run's dataset. Email domains are sent to a DNS-over-HTTPS resolver (Cloudflare, with Google as fallback) for MX lookups. Turn `checkMx` off or use `dnsMode: "system"` if you prefer.

### Limitations

- Phone validity uses numbering-plan metadata. A valid number may still be unassigned or disconnected.
- Name parsing is rule-based and tuned for Western, Hispanic, Dutch/German and Arabic name patterns. Names in scripts without letter case (Chinese, Japanese, Arabic…) are cleaned but not re-cased, and no first/last split is guessed for them.
- Postal codes are checked for **format** only, in 45 countries. Street addresses are not parsed; full global address parsing needs very large models.
- Up to 50,000 items per run. Duplicate detection works within a run.

### Data sources

- Phone metadata: [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) "max" metadata, derived from Google's [libphonenumber](https://github.com/google/libphonenumber).
- Disposable domains: [disposable-email-domains](https://github.com/disposable-email-domains/disposable-email-domains) (CC0), via `disposable-email-domains-js`.
- Country names: Unicode CLDR via ICU in Node.js. Country time zones: `countries-and-timezones` (IANA tz database).

Found a wrong result? Open an issue in the **Issues** tab.

# Changelog

This Actor's version history is a separate document: https://apify.com/dodiabak/contact-data-cleaner/changelog.md

# Actor input Schema

## `items` (type: `array`):

Values, typed values or records (CRM/CSV rows). Record columns are recognized by name: email, phone/mobile/tel, name/first_name/last_name, country, zip/postal_code, price/amount/total. Use fieldMap for other column names.

## `defaultType` (type: `string`):

How to read plain string/number items. Auto-detect looks at the value.

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

Used for phone numbers without +countrycode and for postal codes, e.g. US, GB, DE, IN, SA. A record's own country column wins.

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

Look up the domain's mail servers (DNS) to catch domains that cannot receive mail. Cached per domain. No SMTP/mailbox probing is done.

## `dnsMode` (type: `string`):

How MX lookups are made.

## `dnsTimeoutMs` (type: `integer`):

Per lookup.

## `numberLocale` (type: `string`):

Only used when a separator is ambiguous, e.g. "1,234". "auto" treats a lone separator followed by 3 digits as thousands; "de-DE" reads it as a decimal comma.

## `outputLocale` (type: `string`):

BCP 47 tag for the "formatted" field, e.g. en-US, de-DE, fr-FR, ar-SA.

## `nameCase` (type: `string`):

auto keeps intentional mixed case like "McDonald" or "DeShawn".

## `markDuplicates` (type: `boolean`):

Flag repeated people in the batch (same canonical email, then E.164 phone, then name) with isDuplicate and duplicateOf.

## `fieldMap` (type: `object`):

Force how record columns are read, e.g. {"Kontakt":"name","Handy":"phone","Land":"country"}.

## Actor input object example

```json
{
  "items": [
    "+1 (415) 555-2671",
    "jane@gmial.com",
    "JOHN MCDONALD JR",
    "1.234,56 €",
    "Deutschland",
    "4.91701234567E+11",
    {
      "type": "phone",
      "value": "030 901820",
      "country": "DE"
    },
    {
      "type": "postalCode",
      "value": "sw1a1aa",
      "country": "United Kingdom"
    },
    {
      "first_name": "mary",
      "last_name": "O'BRIEN",
      "email": "Mary.OBrien+crm@GMAIL.com",
      "phone": "020 7946 0958",
      "country": "UK",
      "zip": "sw1a 1aa",
      "deal_value": "£12.500,00"
    },
    {
      "name": "Mary O'Brien",
      "email": "maryobrien@gmail.com"
    }
  ],
  "defaultType": "auto",
  "defaultCountry": "US",
  "checkMx": true,
  "dnsMode": "doh",
  "dnsTimeoutMs": 4000,
  "numberLocale": "auto",
  "outputLocale": "en-US",
  "nameCase": "auto",
  "markDuplicates": true,
  "fieldMap": {}
}
```

# Actor output Schema

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

No description

## `records` (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 = {
    "items": [
        "+1 (415) 555-2671",
        "jane@gmial.com",
        "JOHN MCDONALD JR",
        "1.234,56 €",
        "Deutschland",
        "4.91701234567E+11",
        {
            "type": "phone",
            "value": "030 901820",
            "country": "DE"
        },
        {
            "type": "postalCode",
            "value": "sw1a1aa",
            "country": "United Kingdom"
        },
        {
            "first_name": "mary",
            "last_name": "O'BRIEN",
            "email": "Mary.OBrien+crm@GMAIL.com",
            "phone": "020 7946 0958",
            "country": "UK",
            "zip": "sw1a 1aa",
            "deal_value": "£12.500,00"
        },
        {
            "name": "Mary O'Brien",
            "email": "maryobrien@gmail.com"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dodiabak/contact-data-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 = { "items": [
        "+1 (415) 555-2671",
        "jane@gmial.com",
        "JOHN MCDONALD JR",
        "1.234,56 €",
        "Deutschland",
        "4.91701234567E+11",
        {
            "type": "phone",
            "value": "030 901820",
            "country": "DE",
        },
        {
            "type": "postalCode",
            "value": "sw1a1aa",
            "country": "United Kingdom",
        },
        {
            "first_name": "mary",
            "last_name": "O'BRIEN",
            "email": "Mary.OBrien+crm@GMAIL.com",
            "phone": "020 7946 0958",
            "country": "UK",
            "zip": "sw1a 1aa",
            "deal_value": "£12.500,00",
        },
        {
            "name": "Mary O'Brien",
            "email": "maryobrien@gmail.com",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("dodiabak/contact-data-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 '{
  "items": [
    "+1 (415) 555-2671",
    "jane@gmial.com",
    "JOHN MCDONALD JR",
    "1.234,56 €",
    "Deutschland",
    "4.91701234567E+11",
    {
      "type": "phone",
      "value": "030 901820",
      "country": "DE"
    },
    {
      "type": "postalCode",
      "value": "sw1a1aa",
      "country": "United Kingdom"
    },
    {
      "first_name": "mary",
      "last_name": "O'\''BRIEN",
      "email": "Mary.OBrien+crm@GMAIL.com",
      "phone": "020 7946 0958",
      "country": "UK",
      "zip": "sw1a 1aa",
      "deal_value": "£12.500,00"
    },
    {
      "name": "Mary O'\''Brien",
      "email": "maryobrien@gmail.com"
    }
  ]
}' |
apify call dodiabak/contact-data-cleaner --silent --output-dataset

```

## MCP server setup

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