# Phone Number Validator and Formatter (`properscraper/phone-number-validator`) Actor

Validate and clean phone numbers in bulk for any country: whether each is a real, dialable number, its country, whether it is a mobile or a landline, and the number in international, national and E.164 formats ready for a CRM or SMS tool.

- **URL**: https://apify.com/properscraper/phone-number-validator.md
- **Developed by:** [jake mcclure](https://apify.com/properscraper) (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.20 / 1,000 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 and Formatter

Validate and clean phone numbers in bulk, for every country. For each number you learn whether it is a real, dialable number, which country it belongs to, whether it is a mobile or a landline, and you get it back in the standard formats: E.164 for CRMs and SMS tools, international and national for people.

Numbers can be written any way: with spaces, brackets, dashes, a leading `+`, `00`, or in national form. The check uses the official numbering plans of each country (the same data phones use), so it is instant and nothing is ever called or messaged.

Use it to:

- clean a contact list before an SMS or calling campaign, so you do not pay for dead numbers
- put every number in a CRM into one format (E.164) so duplicates can be found
- separate mobiles from landlines
- catch mistyped numbers in sign-up or lead forms
- find which country each number in a mixed list belongs to

### Input

| Field | What it does |
|---|---|
| **Phone numbers** | One per line, written any way. |
| **Default country** | The two-letter country to assume for numbers written without a `+` and country code, such as `US`, `GB` or `DE`. Leave empty if every number has its country code. |

```json
{
    "numbers": ["+44 20 7946 0958", "(415) 555-2671", "0044 20 7946 0958", "+33 6 12 34 56 78"],
    "defaultCountry": "US"
}
```

### Output

One record per number:

```json
{
    "input": "+33 6 12 34 56 78",
    "valid": true,
    "possible": true,
    "e164": "+33612345678",
    "international": "+33 6 12 34 56 78",
    "national": "06 12 34 56 78",
    "uri": "tel:+33612345678",
    "countryCode": "FR",
    "country": "France",
    "callingCode": "+33",
    "type": "mobile",
    "nationalNumber": "612345678",
    "extension": null,
    "problem": null,
    "scrapedAt": "2026-11-18T12:00:00.000Z"
}
```

- `valid` is `true` when the number fits a range its country has assigned. `possible` only means it has a plausible length.
- `e164`, `international`, `national` and `uri` are filled for valid numbers only, so an invalid number is never passed on by mistake.
- `type` is `mobile`, `landline`, `landline or mobile` (countries such as the US and Canada do not tell them apart), `toll-free`, `premium rate`, `shared cost`, `internet phone (VoIP)`, `personal number`, `pager`, `company number` or `voicemail`.
- `problem` says why a number is not valid: `Too short`, `Too long`, `Wrong length for its country`, `Not a number in use…`, `Not a phone number`, or that no country could be worked out.

A `SUMMARY` record in the run's key-value store counts the valid and invalid numbers.

### Pricing

Pay per result. You are charged once for each number checked, valid or not, at the per-result price shown on this page. The same number listed twice is checked and charged once. The run stops as soon as it reaches the maximum charge you set for it.

### Limits

- "Valid" means the number is in a range the country has issued. It does not prove the number is currently connected or who owns it; no service can know that without calling it.
- The carrier (network operator) is not given. Numbers move between carriers, and looking that up needs a paid telecom service.
- A number without a country code needs a default country to be checked.

### Is this allowed?

Nothing is fetched and nobody is contacted: each number is compared with public numbering-plan data. Phone numbers are personal data; you are responsible for having a lawful reason to hold the numbers you check and for following the rules on marketing calls and messages where you operate.

# Actor input Schema

## `numbers` (type: `array`):

One per line, written any way: +44 20 7946 0958, (415) 555-2671, 0044 20 7946 0958, 030 123456.

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

The two-letter country code to assume for numbers written without a + and country code, such as US, GB or DE. Leave empty if every number has its country code.

## Actor input object example

```json
{
  "numbers": [
    "+44 20 7946 0958",
    "(415) 555-2671",
    "+33 6 12 34 56 78"
  ],
  "defaultCountry": "US"
}
```

# Actor output Schema

## `numbers` (type: `string`):

One record per phone number checked.

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

Totals for the run and, for each batch of numbers, how many results were saved and any error.

# 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 = {
    "numbers": [
        "+44 20 7946 0958",
        "(415) 555-2671",
        "+33 6 12 34 56 78"
    ],
    "defaultCountry": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("properscraper/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 = {
    "numbers": [
        "+44 20 7946 0958",
        "(415) 555-2671",
        "+33 6 12 34 56 78",
    ],
    "defaultCountry": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("properscraper/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 '{
  "numbers": [
    "+44 20 7946 0958",
    "(415) 555-2671",
    "+33 6 12 34 56 78"
  ],
  "defaultCountry": "US"
}' |
apify call properscraper/phone-number-validator --silent --output-dataset

```

## MCP server setup

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