# Bulk Phone Number Validator: Carrier, Line Type and E.164 (`agents001/phone-number-validator`) Actor

Bulk phone number validator that returns validity, E.164, national and international format, country, line type (mobile, fixed, VoIP, toll-free), original carrier and timezone. Offline phone number validation with libphonenumber: fast and cheap. Batch runs or a live API.

- **URL**: https://apify.com/agents001/phone-number-validator.md
- **Developed by:** [Mike Ross](https://apify.com/agents001) (community)
- **Categories:** Developer tools, Lead generation
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 phone number checkeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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: Carrier, Line Type and E.164

Bulk phone number validator that returns, for every phone number you give it: whether it is **valid**, the **E.164**, international and national formats, the **country**, the **line type** (mobile, fixed line, VoIP, toll-free, premium rate and more), the **original carrier** where known, the **location** of the number range and its **timezones**.

All checks run offline with libphonenumber, the open-source numbering-plan library Google maintains, so results come back in milliseconds and nothing is sent to any third party. Use it two ways:

- **Batch run**: paste a list (up to 100,000 numbers), get a clean dataset you can export to CSV, Excel or JSON.
- **Live API (Standby)**: call a URL from your app, CRM or form and get the answer in the response, typically in well under 100 ms once the API is warm.

Use it to:

- Clean CRM and lead lists before a calling or SMS campaign.
- Convert numbers to E.164 for Twilio, WhatsApp or other messaging APIs.
- Separate mobile from landline numbers where the national numbering plan allows it.
- Reject typos and fake numbers at a form or checkout through the live API.

### What you get

| Field | Example |
|---|---|
| `input` | `020 7946 0321` |
| `isValid` | `true` |
| `e164` | `+442079460321` |
| `international`, `national` | `+44 20 7946 0321`, `020 7946 0321` |
| `rfc3966` | `tel:+44-20-7946-0321` |
| `countryCode`, `countryCallingCode` | `GB`, `44` |
| `numberType` | `mobile`, `fixed-line`, `fixed-line-or-mobile`, `toll-free`, `premium-rate`, `shared-cost`, `voip`, `personal-number`, `pager`, `uan`, `voicemail` or `unknown` |
| `carrier` | `Telstra` (the operator the number range was allocated to) |
| `location` | `London` |
| `timezones` | `["Europe/London"]` |
| `isPossible`, `possibility` | Length check: `possible`, `too-short`, `too-long` and so on |
| `extension` | `33` when the input has an extension |
| `error` | Why a number failed: `not-a-number`, `missing-country`, `invalid-country-code`, `too-short`, `too-long`, `invalid-length` or `invalid-for-region` |

The Output tab has two views: **Overview** and **Problems**.

Good to know:

- `fixed-line-or-mobile` is normal for the US and Canada, where the numbering plan does not separate mobile from landline numbers.
- `carrier` is the original allocation. A number that has been ported to another network keeps the original name. It is mostly filled for mobile numbers.
- A valid number is one that fits a real range in the national numbering plan. It does not prove that the line is connected or who owns it.

### Who it is for

- **Sales and marketing teams** cleaning CRM and lead lists before a calling or SMS campaign.
- **Developers** who need E.164 numbers for Twilio, WhatsApp or other messaging APIs.
- **Form and checkout builders** who want to reject typos and fake numbers at the point of entry.
- **Data teams** standardising phone fields across systems.

### Quick start (batch)

1. Click **Start** with the example input. It checks a short list of fictional test numbers.
2. Replace the list with your own numbers, one per line, in any common format.
3. Set **Default country** for numbers written without a country code (for example `US` for `(202) 555-0143`).
4. Export the dataset, or connect it to Google Sheets, a webhook or your CRM with an Apify integration.

#### Input

| Field | What it does | Default |
|---|---|---|
| `phoneNumbers` | Numbers to check, one per line. Empty runs the example list | example list |
| `defaultCountry` | Two-letter country code for numbers without a country code | none (`GB` for the example list) |
| `onlyValid` | Save only valid numbers | `false` |
| `language` | Language for location and carrier names | `en` |
| `maxItems` | Stop after this many records. `0` means no limit | `0` |

```json
{
  "phoneNumbers": ["+44 20 7946 0958", "(202) 555-0143", "0491 570 156"],
  "defaultCountry": "US"
}
```

### Live API (Standby mode)

The Actor also runs as an always-ready HTTP API. Copy the API URL from the **Endpoints** tab (it looks like `https://<username>--phone-number-validator.apify.actor`) and authenticate with your Apify API token in the `Authorization: Bearer <token>` header.

**GET**, one or more numbers (repeat `number` or separate with commas):

```bash
curl -H "Authorization: Bearer $APIFY_TOKEN" \
  "https://<your-standby-url>/validate?number=%2B442079460958&defaultCountry=GB"
```

**POST**, same fields as the batch input:

```bash
curl -X POST -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"phoneNumbers": ["+44 20 7946 0958", "(202) 555-0143"], "defaultCountry": "US"}' \
  "https://<your-standby-url>/validate"
```

Response:

```json
{
  "count": 1,
  "chargedRecords": 1,
  "results": [
    {"input": "+44 20 7946 0958", "isValid": true, "e164": "+442079460958", "numberType": "fixed-line", "countryCode": "GB", "location": "London", "timezones": ["Europe/London"], "error": null}
  ]
}
```

| Endpoint | What it does |
|---|---|
| `GET /` | Free usage help |
| `GET /validate`, `POST /validate` | Check up to 100 numbers per request |

Query parameters: `number` (also `numbers`, `phone`, `phoneNumbers`), `defaultCountry`, `onlyValid`, `language`. Bad requests return HTTP 400 and are not charged. Use a batch run for lists longer than 100.

### Pricing

Pay per event:

- **$0.40 per 1,000 numbers checked** (`phone-number-checked` event, $0.0004 each), in batch runs and API calls alike.

Batch runs include platform usage. For the live API, Apify bills the platform usage of the Standby run to you on top of the event price, as it does for every Standby Actor. The API runs in 256 MB, so this is small, but it accrues while the API is idle until its idle timeout. Records skipped by `onlyValid` or `maxItems` are not charged. Set a maximum cost per run and the Actor stops cleanly when it is reached.

### Data and privacy

The numbers you send are processed in memory and returned to you. In batch runs they are saved only to your own run's dataset. In API calls nothing is written to storage and request URLs are not logged. No third-party service is called.

### Data source and licence

Numbering-plan data and the formatting logic come from [phonenumbers](https://github.com/daviddrysdale/python-phonenumbers), the Python port of Google's [libphonenumber](https://github.com/google/libphonenumber), both under the Apache License 2.0. The version used is reported in each run's `RUN_SUMMARY`. This Actor is not affiliated with Google.

### FAQ

**Does it tell me if a number is active or who owns it?** No. It checks the number against national numbering plans. It does not call, text or look up subscribers.

**Why is my number "missing-country"?** It has no `+` or international prefix and no default country was set. Add `defaultCountry`.

**How fresh is the data?** libphonenumber is updated every few weeks as countries change their plans. We update the pinned version regularly.

**How much does a typical run cost?** $0.40 per 1,000 numbers checked ($0.0004 each). A list of 100,000 numbers costs $40.

**Does it need a login or API key?** No login and no third-party key. Live API calls use your own Apify API token.

**What formats can I export?** The dataset downloads as JSON, CSV, Excel and the other formats Apify offers, or you can read it through the Apify API and integrations.

**Where does the data come from?** The open-source libphonenumber numbering-plan data (Apache License 2.0). Phone number validation runs offline: no number is sent to any third party.

# Actor input Schema

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

One number per line, in any common format: +44 20 7946 0958, (202) 555-0143, 020 7946 0321. Numbers without a leading + or international prefix are read with the default country below. Up to 100,000 per run. Leave empty to run the example list.

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

Two-letter country code (ISO 3166-1 alpha-2) used for numbers written without a country code, for example US, GB, ZA or AU. Leave empty if every number starts with + and a country code.

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

Skip numbers that are not valid. You pay only for records saved, so this also lowers the cost.

## `language` (type: `string`):

Language of the location and carrier names, where libphonenumber has a translation. English otherwise.

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

Stop after saving this many records. Leave empty or 0 for no limit. You pay per record saved.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+44 20 7946 0958",
    "020 7946 0321",
    "+61 491 570 156",
    "+1 202-555-0143",
    "+1 800-555-0199",
    "+33 1 99 00 12 34",
    "12345"
  ],
  "defaultCountry": "GB",
  "onlyValid": false,
  "language": "en"
}
```

# Actor output Schema

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

No description

## `runSummary` (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": [
        "+44 20 7946 0958",
        "020 7946 0321",
        "+61 491 570 156",
        "+1 202-555-0143",
        "+1 800-555-0199",
        "+33 1 99 00 12 34",
        "12345"
    ],
    "defaultCountry": "GB"
};

// Run the Actor and wait for it to finish
const run = await client.actor("agents001/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": [
        "+44 20 7946 0958",
        "020 7946 0321",
        "+61 491 570 156",
        "+1 202-555-0143",
        "+1 800-555-0199",
        "+33 1 99 00 12 34",
        "12345",
    ],
    "defaultCountry": "GB",
}

# Run the Actor and wait for it to finish
run = client.actor("agents001/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": [
    "+44 20 7946 0958",
    "020 7946 0321",
    "+61 491 570 156",
    "+1 202-555-0143",
    "+1 800-555-0199",
    "+33 1 99 00 12 34",
    "12345"
  ],
  "defaultCountry": "GB"
}' |
apify call agents001/phone-number-validator --silent --output-dataset

```

## MCP server setup

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