# Bulk Phone Number Validator & Formatter – E.164, Line Type (`kestrelwick/phone-validator`) Actor

Validate and normalize thousands of phone numbers in seconds: valid/possible, mobile or fixed line, country, E.164, international and national formats. Duplicates removed, invalid numbers free. Fully offline, no API keys.

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

## Pricing

from $0.72 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 & Formatter – E.164, Line Type, Country (Offline)

Paste a list of phone numbers in any format and get **one clean row per unique number**: whether it's valid, whether it's at least possible, the line type (mobile, fixed line, toll-free, VoIP...), the country, and ready-to-use **E.164, international and national formats**. We remove duplicates for you, so you only pay for unique valid numbers. Invalid numbers are free.

Everything runs **offline** on Google's libphonenumber numbering-plan metadata (the full "max" dataset). We don't need API keys, proxies or third-party lookups, and your numbers never leave the run. A list of 10,000 numbers is validated in about a second.

Built and maintained by **Kestrelwick Studios**.

### Who it's for

- **Sales and CRM teams** cleaning up phone fields before an import, a dialer campaign or a migration.
- **Lead-list buyers and agencies** checking scraped or purchased lists before handing them over.
- **SMS and marketing ops** separating mobile numbers from landlines, toll-free and premium-rate numbers.
- **Developers and data engineers** normalizing numbers to E.164 for Twilio, Vonage, AWS SNS or a database key.

### What we return

| Field | Example | Meaning |
|---|---|---|
| `input` | `(415) 555-2671` | The number as you sent it |
| `valid` | `true` | Matches a real, assignable range in the national numbering plan |
| `possible` | `true` | Has a plausible length for the country (looser check) |
| `type` | `mobile` | `mobile`, `fixed_line`, `fixed_line_or_mobile`, `toll_free`, `premium_rate`, `shared_cost`, `voip`, `personal_number`, `pager`, `uan`, `voicemail` or `unknown` (valid numbers only) |
| `country` | `US` | ISO 3166-1 alpha-2 code (valid numbers only; `null` for non-geographic numbers such as +800) |
| `callingCode` | `+1` | Country calling code |
| `e164` | `+14155552671` | Canonical format for APIs and databases |
| `international` | `+1 415 555 2671` | Human-readable international format |
| `national` | `(415) 555-2671` | Local format |
| `formatted` | `+14155552671` | The number in your **preferred output format** (one column to map back into a CRM) |
| `error` | `null` | Why a number failed: `NOT_A_NUMBER`, `INVALID_COUNTRY`, `TOO_SHORT`, `TOO_LONG`, `INVALID_LENGTH` or `INVALID_NUMBER` (right length but not an assigned range) |

Formats are filled for every number that is at least `possible`. Filter on `valid = true` for a strict list.

### Input

- **Phone numbers**: one per line, in any format (`+44 20 7031 3000`, `011 44 20 7031 3000`, `(650) 253-0000`, `650.253.0000`...). You can paste a whole spreadsheet column; we also split entries on commas and semicolons.
- **Default country**: the two-letter country code used for numbers written without `+` (defaults to `US`). Numbers with `+` or an international dialing prefix are always detected automatically.
- **Preferred output format**: `E.164` (default), `INTERNATIONAL`, `NATIONAL` or `RFC3966`, used for the `formatted` column.
- **Max numbers**: a cap on unique numbers per run, to control spend.

```json
{ "phoneNumbers": ["+1 650-253-0000", "(415) 555-2671", "+44 20 7031 3000", "07400 123456", "12345"],
  "defaultCountry": "US", "outputFormat": "E.164" }
```

### Output example

```json
{ "input": "+33 6 12 34 56 78", "valid": true, "possible": true, "type": "mobile", "country": "FR",
  "callingCode": "+33", "e164": "+33612345678", "international": "+33 6 12 34 56 78",
  "national": "06 12 34 56 78", "formatted": "+33612345678", "error": null }
```

```json
{ "input": "12345", "valid": false, "possible": false, "type": null, "country": null,
  "callingCode": "+1", "e164": null, "international": null, "national": null, "formatted": null, "error": "TOO_SHORT" }
```

A run summary (numbers received, duplicates removed, valid and invalid counts) is saved as `SUMMARY` in the run's key-value store. Export the dataset as CSV, Excel, JSON or XML, or call the actor from the Apify API, Make, Zapier or n8n.

### Deduplication

We dedupe twice: first on the exact text, then on the normalized E.164 number. `+1 650-253-0000`, `(650) 253-0000` and `16502530000` become one row (the first one you sent), and you're charged once.

### Pricing

Pay per result: **$0.97 per 1,000 valid numbers** on the Free plan, going down to **$0.72 per 1,000** on higher Apify plans. **There's no start fee, duplicates are removed before billing, and invalid numbers are free.** Platform usage is included.

### Tips

- Store the `e164` column as your canonical phone key. It makes duplicate detection across systems reliable.
- For SMS campaigns, keep `type` = `mobile` or `fixed_line_or_mobile`. In the US and Canada, the numbering plan doesn't separate mobile from landline, so most numbers there come back as `fixed_line_or_mobile`.
- Set a maximum charge per run in Apify to cap spend.

### FAQ

**Does it check that a number is live or reachable?** No. We check numbers against the official numbering plans, offline. We don't call or text numbers, query carriers or HLR, or verify ownership or consent. Use the results as data hygiene, not as a TCPA or do-not-call determination.
**Why is a real-looking number `valid: false`?** It has the right length but falls in a range that isn't assigned (for example US area code 555), so `error` is `INVALID_NUMBER`.
**Why did a local number fail?** Numbers without `+` are read using the default country. A UK number like `07400 123456` needs `defaultCountry` = `GB`, or write it as `+44 7400 123456`.
**Is there a carrier field?** Not in this version. Carrier data in the open numbering plans goes stale when numbers are ported, so we leave it out rather than return misleading values.
**Support:** open an issue on the actor's Issues tab and we'll respond.

# Actor input Schema

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

One phone number per entry, in any format: +1 650-253-0000, (415) 555-2671, +44 20 7031 3000, 030 901820... You can also paste a whole column; entries are split on new lines, commas and semicolons. Duplicates are removed and only charged once.

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

Two-letter ISO 3166-1 country code (US, GB, DE, FR, IN, BR...) used for numbers written without a +country code, such as (415) 555-2671 or 07400 123456. Numbers that start with + or an international dialing prefix are always detected automatically.

## `outputFormat` (type: `string`):

Format used for the extra 'formatted' column, handy for re-importing into a CRM or dialer. E.164, international and national formats are always included as well.

## `maxItems` (type: `integer`):

Cap on unique numbers processed per run, to control spend.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+1 650-253-0000",
    "(415) 555-2671",
    "+44 20 7031 3000",
    "+49 30 901820",
    "+33 6 12 34 56 78",
    "+91 98765 43210",
    "+1 800 555 0199",
    "12345",
    "not a phone"
  ],
  "defaultCountry": "US",
  "outputFormat": "E.164",
  "maxItems": 100000
}
```

# Actor output Schema

## `results` (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 = {
    "phoneNumbers": [
        "+1 650-253-0000",
        "(415) 555-2671",
        "+44 20 7031 3000",
        "+49 30 901820",
        "+33 6 12 34 56 78",
        "+91 98765 43210",
        "+1 800 555 0199",
        "12345",
        "not a phone"
    ],
    "defaultCountry": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kestrelwick/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",
        "(415) 555-2671",
        "+44 20 7031 3000",
        "+49 30 901820",
        "+33 6 12 34 56 78",
        "+91 98765 43210",
        "+1 800 555 0199",
        "12345",
        "not a phone",
    ],
    "defaultCountry": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("kestrelwick/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",
    "(415) 555-2671",
    "+44 20 7031 3000",
    "+49 30 901820",
    "+33 6 12 34 56 78",
    "+91 98765 43210",
    "+1 800 555 0199",
    "12345",
    "not a phone"
  ],
  "defaultCountry": "US"
}' |
apify call kestrelwick/phone-validator --silent --output-dataset

```

## MCP server setup

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