# Bulk Phone Number Validator and Formatter (`clearcheck/phone-validator`) Actor

Bulk phone number validator: check validity, E.164 and national format, country and line type (mobile, fixed, toll-free) for up to 100,000 numbers.

- **URL**: https://apify.com/clearcheck/phone-validator.md
- **Developed by:** [ClearCheck Tools](https://apify.com/clearcheck) (community)
- **Categories:** Lead generation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 phone number validateds

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

## Bulk Phone Number Validator and Formatter

Clean a list of phone numbers **before** you call, text or import it. Give it up to **100,000 numbers** in any common format and get, for each one: is it valid, the canonical **E.164** form, national and international formatting, the **country**, and the **line type** (mobile, fixed line, toll-free, VoIP...).

Everything runs **offline** on Google's open libphonenumber rules. The Actor never calls a phone-lookup service, never dials a number and never stores anything except the list you provide. That is why it is fast and cheap.

### What you get for each number

| Field | Meaning |
|---|---|
| `valid` | The number matches a real numbering plan of its country |
| `possible` | The length is plausible (weaker than `valid`) |
| `e164` | Canonical `+33612345678` form, ideal key for deduplication and for CRMs |
| `international`, `national`, `rfc3966` | Display formats (`+33 6 12 34 56 78`, `06 12 34 56 78`, `tel:+33...`) |
| `countryCode`, `countryName`, `callingCode` | `FR`, `France`, `+33` |
| `type` | `MOBILE`, `FIXED_LINE`, `FIXED_LINE_OR_MOBILE`, `TOLL_FREE`, `PREMIUM_RATE`, `VOIP`, `PERSONAL_NUMBER`, `PAGER`, `UAN`, `VOICEMAIL`, `SHARED_COST` |
| `extension` | Extension if the input had one (`ext. 123`) |
| `reason` | Why the number is invalid: `missing_country_code`, `invalid_number_for_region`, `wrong_length`, `too_short`, `not_a_phone_number`... |

### Use cases

- Clean a CRM, lead list or sign-up export before an SMS or call campaign.
- Normalise numbers from many sources to E.164 and remove duplicates written in different formats.
- Keep only mobile numbers (filter `type = MOBILE`) for SMS.
- Pipe the contact lists produced by other Actors into it.

### Input

```json
{
    "phoneNumbers": ["+1 650-253-0000", "06 12 34 56 78", "0712 345678", "+228 90 12 34 56", "not a number"],
    "defaultCountry": "FR",
    "onlyValid": false
}
```

- `defaultCountry` (ISO code such as `FR`, `US`, `GB`, `KE`, `TG`) is applied only to numbers written **without** a `+` or `00` prefix. Numbers with an international prefix ignore it.
- Duplicates (same digits, whatever the formatting) and empty entries are removed and **not charged**.
- `onlyValid: true` hides invalid numbers from the dataset (they are still counted and billed, because the check was done).

### Output example

```json
{
    "input": "06 12 34 56 78",
    "valid": true,
    "possible": true,
    "e164": "+33612345678",
    "international": "+33 6 12 34 56 78",
    "national": "06 12 34 56 78",
    "rfc3966": "tel:+33612345678",
    "countryCode": "FR",
    "countryName": "France",
    "callingCode": "+33",
    "nationalNumber": "612345678",
    "extension": null,
    "type": "MOBILE",
    "reason": null
}
```

A run summary (counts of valid and invalid numbers, by line type and by country) is saved under the `SUMMARY` key of the key-value store.

### Pricing

Pay per event. You can cap spending with the maximum cost per run.

| Event | Price | When it is charged |
|---|---|---|
| Phone number validated | $0.0008 per number ($0.80 per 1,000) | Once per unique number checked, valid or invalid |
| Actor start | $0.00005 per run | Flat fee per run start |

Duplicates (same digits, any formatting) and empty lines are never charged. The Actor stops cleanly when your maximum cost is reached.

### Limits and honesty

- This checks the **format and numbering plan**, not whether the line is active or who owns it. A `valid` number can still be disconnected. No carrier lookup, no HLR query, no owner name.
- `FIXED_LINE_OR_MOBILE` means the numbering plan of that country (for instance the US) does not distinguish the two.
- Numbering plans change; the Actor is rebuilt with updated rules regularly.

### Technical notes

- 20,000 numbers per second on a laptop; a 5,000-number run on the platform finishes in about 3 seconds with a 512 MB container.
- Call it from the API or schedule it: `POST /v2/acts/clearcheck~phone-validator/runs` with the JSON input above.

### FAQ

**Does it call or text the number?** No. It is an offline check of the number against numbering plans. It cannot tell whether the line is active or who owns it.

**What does defaultCountry do?** It is applied only to numbers written without a + or 00 prefix. Numbers with an international prefix ignore it.

**Can I keep only mobile numbers?** Yes. Filter the dataset on type = MOBILE.

**Is the line type always known?** No. In some countries the type is FIXED_LINE_OR_MOBILE or not determinable.

### More Actors by clearcheck

- [Email Validator](https://apify.com/clearcheck/email-validator)
- [Domain Health Checker](https://apify.com/clearcheck/domain-health-checker)
- [Broken Link Checker and Sitemap SEO Auditor](https://apify.com/clearcheck/link-sitemap-audit)
- [PDF, DOCX and HTML to Markdown Converter](https://apify.com/clearcheck/document-to-markdown-converter)
- [Website Contact Finder](https://apify.com/clearcheck/website-contact-finder)
- [Bulk Image Optimizer](https://apify.com/clearcheck/image-optimizer)
- [OCR Text Extractor](https://apify.com/clearcheck/ocr-text-extractor)
- [Dataset Merger and Deduplicator](https://apify.com/clearcheck/dataset-merge-dedupe)
- [Excel and CSV to JSON Converter](https://apify.com/clearcheck/spreadsheet-to-json)

# Actor input Schema

## `phoneNumbers` (type: `array`):

List of phone numbers, in any common format: +33 6 12 34 56 78, (650) 253-0000, 0712 345678, tel:+1650..., with or without extension. Up to 100,000 unique numbers per run.

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

Two-letter country code (FR, US, GB, KE, TG, DE...) used for numbers written without the + country prefix. Numbers that start with + or 00 ignore this setting. Leave empty if all your numbers are international.

## `onlyValid` (type: `boolean`):

Hide invalid numbers from the dataset. Every submitted number is still counted and billed, because the check is performed either way.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+1 650-253-0000",
    "06 12 34 56 78",
    "0712 345678",
    "+228 90 12 34 56",
    "not a number"
  ],
  "defaultCountry": "FR",
  "onlyValid": false
}
```

# Actor output Schema

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

Dataset with one item per phone number.

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

JSON with counts of valid/invalid numbers, line types and countries.

# 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 = {
    "phoneNumbers": [
        "+1 650-253-0000",
        "06 12 34 56 78",
        "0712 345678",
        "+228 90 12 34 56",
        "not a number"
    ],
    "defaultCountry": "FR"
};

// Run the Actor and wait for it to finish
const run = await client.actor("clearcheck/phone-validator").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 = {
    "phoneNumbers": [
        "+1 650-253-0000",
        "06 12 34 56 78",
        "0712 345678",
        "+228 90 12 34 56",
        "not a number",
    ],
    "defaultCountry": "FR",
}

# Run the Actor and wait for it to finish
run = client.actor("clearcheck/phone-validator").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 '{
  "phoneNumbers": [
    "+1 650-253-0000",
    "06 12 34 56 78",
    "0712 345678",
    "+228 90 12 34 56",
    "not a number"
  ],
  "defaultCountry": "FR"
}' |
apify call clearcheck/phone-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,clearcheck/phone-validator"
        }
    }
}
```

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/qrgcEGae2DUNnvLuX/builds/pHOQnJXAYoli1qXRi/openapi.json
