# Phone Number Validator & Formatter (Bulk, 240+ Countries) (`icedata/phone-number-validator`) Actor

Validate and format thousands of phone numbers in seconds. Get E.164, international and national formats, line type (mobile, landline, VoIP, toll-free), country and a WhatsApp link. Can also pull phone numbers out of free text.

- **URL**: https://apify.com/icedata/phone-number-validator.md
- **Developed by:** [Ice Data](https://apify.com/icedata) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 phone number checkeds

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

## Phone Number Validator & Formatter (Bulk, 240+ Countries)

Clean a phone list in seconds. Paste numbers in **any format** and get back, for each one:

- ✅ **Valid or not** – and *why* not (too short, too long, wrong length, not in that country's numbering plan)
- 📞 **Line type** – mobile, landline, VoIP, toll-free, premium-rate, pager, shared-cost…
- 🌍 **Country** – ISO code, country name and calling code
- 🔢 **Standard formats** – E.164 (`+16502530000`), international, national and `tel:` link
- 💬 **WhatsApp link** – ready-made `https://wa.me/…` for every valid number
- 🧹 **Duplicates removed** – `0812345678`, `+66 81 234 5678` and `081-234-5678` count as one

It can also **pull phone numbers out of any text** – email signatures, scraped web pages, CSV exports.

Validation uses Google's libphonenumber metadata (the same rules Android uses), fully offline: **no number is ever dialled, messaged or sent to a third-party lookup service**.

### Why use this one

| | This Actor | Typical alternatives |
|---|---|---|
| Price | **$1 per 1,000 numbers** | $3 – $15 per 1,000 |
| Speed | ~100,000 numbers per run in minutes | often one API call per number |
| Free text extraction | ✅ | rarely |
| Reason for invalid numbers | ✅ | usually just `false` |
| Sends your data to third parties | ❌ never | often |

### How to use

1. Paste numbers into **Phone numbers** (one per line) and/or text into **Extract numbers from text**.
2. Set **Default country** – used for numbers written without `+country code` (e.g. `TH`, `US`, `GB`, `IN`).
3. Click **Start**. Download results as Excel, CSV or JSON, or connect via API / Make / Zapier / n8n.

### Input example

```json
{
  "phoneNumbers": ["+1 650-253-0000", "(020) 7031 3000", "081 234 5678"],
  "defaultCountry": "GB",
  "removeDuplicates": true,
  "onlyValid": false
}
```

### Output example

```json
{
  "input": "081 234 5678",
  "valid": true,
  "possible": true,
  "type": "MOBILE",
  "e164": "+66812345678",
  "international": "+66 81 234 5678",
  "national": "081 234 5678",
  "rfc3966": "tel:+66812345678",
  "countryCode": "TH",
  "countryName": "Thailand",
  "callingCode": "+66",
  "nationalNumber": "812345678",
  "extension": null,
  "whatsappUrl": "https://wa.me/66812345678",
  "invalidReason": null
}
```

### Pricing

Pay per event: **$0.001 per number checked** ($1 per 1,000). Duplicates removed before charging are free. Set "Maximum cost per run" and the Actor stops cleanly when it is reached.

### FAQ

**Does "valid" mean the number is in use?** No. It means the number exists in that country's official numbering plan and has the right length and prefix. No tool can tell if a number is active without calling or messaging it – this Actor deliberately does neither.

**Why is a US number shown as `FIXED_LINE_OR_MOBILE`?** In the US and Canada mobile and landline numbers share the same ranges, so they cannot be told apart from the number alone.

**My numbers are from many countries.** Write them with `+country code` and the default country is ignored for those.

**Is it legal?** It only formats and checks numbers you already have. Make sure you have the right to process the numbers you upload.

# Actor input Schema

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

One phone number per line, in any format: +1 650-253-0000, (650) 253-0000, 0812345678 ... Numbers without a + country code use the default country below.

## `text` (type: `string`):

Paste any text (email signatures, web page text, CSV export). Every phone number found in it is extracted and validated.

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

Two-letter country code used for numbers written without +country code, e.g. US, GB, TH, DE, IN, BR.

## `removeDuplicates` (type: `boolean`):

Output each distinct number only once (compared by E.164 format).

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

Skip invalid numbers instead of returning them with a reason.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+1 650-253-0000",
    "+44 20 7031 3000",
    "02-123-4567",
    "+49 30 303986300",
    "12345"
  ],
  "defaultCountry": "TH",
  "removeDuplicates": true,
  "onlyValid": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `allFields` (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 = {
    "phoneNumbers": [
        "+1 650-253-0000",
        "+44 20 7031 3000",
        "02-123-4567",
        "+49 30 303986300",
        "12345"
    ],
    "defaultCountry": "TH"
};

// Run the Actor and wait for it to finish
const run = await client.actor("icedata/phone-number-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",
        "+44 20 7031 3000",
        "02-123-4567",
        "+49 30 303986300",
        "12345",
    ],
    "defaultCountry": "TH",
}

# Run the Actor and wait for it to finish
run = client.actor("icedata/phone-number-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",
    "+44 20 7031 3000",
    "02-123-4567",
    "+49 30 303986300",
    "12345"
  ],
  "defaultCountry": "TH"
}' |
apify call icedata/phone-number-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,icedata/phone-number-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/gwMJGiWyRPH6rsCNk/builds/tIr72frfKZd4TpFGS/openapi.json
