# Phone Number Validator: Bulk Offline Check, E.164, Line Type (`thoob/phone-number-validator`) Actor

Phone number validator: input phone numbers, get validity, E.164, national and international format, country, calling code, line type and a failure reason for each. Checks run offline using libphonenumber rules. Billed per number checked.

- **URL**: https://apify.com/thoob/phone-number-validator.md
- **Developed by:** [Pono Data](https://apify.com/thoob) (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 $1.00 / 1,000 checked phone numbers

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: Bulk Format, Type, Country

Checks phone numbers in bulk, entirely offline, using Google's libphonenumber rules through the `libphonenumber-js` package (full "max" metadata). No network calls are made and no API key is needed.

### What goes in

- **phoneNumbers** (required): a list of phone numbers, one per line. A number with a `+` prefix carries its own country. Blank lines are skipped. Exact duplicates (after trimming) are checked once, in first-seen order.
- **defaultCountry**: ISO 3166-1 alpha-2 code, default `US`. Used for numbers with no `+` prefix. An unknown code fails the run immediately, before anything is charged.
- **maxNumbers**: cap on delivered rows. `0` (the default) means no cap.

### What comes out

One row per distinct input, valid or not:

`input`, `valid`, `possible`, `e164`, `national`, `international`, `countryCode`, `callingCode`, `numberType`, `reason`, `metadataVersion`, `retrievedAt`, `confidence`.

`reason` is null when the number is valid, otherwise one of `INVALID_COUNTRY`, `NOT_A_NUMBER`, `TOO_SHORT`, `TOO_LONG`, `INVALID_LENGTH`, `INVALID_FOR_REGION`. `numberType` is one of MOBILE, FIXED_LINE, FIXED_LINE_OR_MOBILE, TOLL_FREE, VOIP, PREMIUM_RATE and others, or null. `metadataVersion` is the libphonenumber-js version that produced the verdict. `confidence` is `high` when the number is valid and `low` otherwise.

### Sample row

```json
{
  "input": "+1 650-253-0000",
  "valid": true,
  "possible": true,
  "e164": "+16502530000",
  "national": "(650) 253-0000",
  "international": "+1 650 253 0000",
  "countryCode": "US",
  "callingCode": "1",
  "numberType": "FIXED_LINE_OR_MOBILE",
  "reason": null,
  "metadataVersion": "1.12.9",
  "retrievedAt": "2026-06-13T20:00:00Z",
  "confidence": "high"
}
```

### What is charged

One `phone-checked` event per row delivered, whether the number is valid or not, because the verdict is the product; blank and duplicate inputs produce no row and no charge.

### Pricing

- `phone-checked`: $1.00 per 1,000 numbers. Charged once for each number checked and delivered. Blank inputs are skipped and not billed.
- `apify-actor-start`: $0.05 per 1,000 events. Charged when a run starts, one event per GB of memory, with a minimum of one.

### Limits

- Up to 100,000 input lines per run.
- Verdicts reflect the numbering plan data bundled in the metadata version shown on each row. They say a number is well formed and plausible for its region, not that it is currently assigned or reachable.
- The run stops cleanly when your spend limit or `maxNumbers` is reached. If the platform reports an error mid-run, rows already delivered are kept and a warning is logged.
- The last log line is always `delivered=N charged=N`.

### Who uses it

- CRM admins who clean `phoneNumbers` before an import and store `e164` as the standard format.
- Marketing operations teams who split lists by `numberType` before a text message campaign.
- Sign-up form owners who audit collected numbers and read `reason` to see why each one failed.
- Data teams who route contact records by `countryCode` and `callingCode`.

### FAQ

#### What format should `phoneNumbers` use?

Use a list of numbers as text. Numbers written without a country code are read using `defaultCountry`.

#### Does it call or message the numbers?

No. It checks numbers offline against libphonenumber rules. `valid` means the number fits the numbering plan. It does not confirm that the line is in service.

#### What does an empty result mean?

Blank entries are skipped, so a list of only blanks returns no rows. A number that fails the check still returns a row with `valid` set to false and a `reason`.

#### Can it run on a schedule or through the Apify API?

Yes. Start runs from the Apify API with `phoneNumbers` in the input, or set up an Apify Schedule for recurring checks.

# Actor input Schema

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

Phone numbers to check, one per line. Numbers with a + prefix carry their own country. Others use the default country below. Blank lines are skipped and exact duplicates are checked once.

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

ISO 3166-1 alpha-2 country code (US, GB, DE, ...) used for numbers that have no + prefix. An unknown code fails the run before anything is charged.

## `maxNumbers` (type: `integer`):

Cap on delivered, billed rows. 0 means no cap. The platform spend cap is honored regardless.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+1 650-253-0000",
    "020 7946 0018",
    "+49 30 901820",
    "not a phone"
  ],
  "defaultCountry": "US",
  "maxNumbers": 0
}
```

# Actor output Schema

## `checks` (type: `string`):

One row per phone number checked.

# 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",
        "020 7946 0018",
        "+49 30 901820",
        "not a phone"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thoob/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",
        "020 7946 0018",
        "+49 30 901820",
        "not a phone",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("thoob/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",
    "020 7946 0018",
    "+49 30 901820",
    "not a phone"
  ]
}' |
apify call thoob/phone-number-validator --silent --output-dataset

```

## MCP server setup

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