# Phone Number Validator - E.164, Carrier, Line Type (`staymeter-labs/phone-number-validator`) Actor

Validate and clean phone numbers in bulk, offline. Any format to E.164, validity by country, line type (mobile/landline/VoIP/toll-free), carrier, location, time zone and duplicate removal. No login, no API key, no proxies.

- **URL**: https://apify.com/staymeter-labs/phone-number-validator.md
- **Developed by:** [Staymeter Labs](https://apify.com/staymeter-labs) (community)
- **Categories:** Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 E.164 formatter with carrier, line type and location

**Validate and clean phone numbers in bulk**: any format to E.164, validity per country, line type (mobile, landline, VoIP, toll-free), carrier, city/region, time zone and duplicate removal. Runs offline on Google's libphonenumber data — no login, no API key, no proxies, results in seconds. Export as JSON, CSV or Excel.

### How to use in 3 steps

1. **Paste your numbers** — one per line, any format (`(415) 555-2671`, `+44 20 7946 0958`, `tel:+81-3-1234-5678`, `0033 1 42 68 53 00`, `... ext. 12`).
2. **Set a default country** (e.g. `US`, `GB`, `JP`) for numbers written without a `+` prefix.
3. **Run and export** — every number gets a `status` (`valid`, `risky`, `invalid`), a plain-English `reason` and clean formats.

### What you get

- **Format normalisation** to E.164 (`+442079460958`), international, national and RFC 3966 (`tel:`) forms. Labels like `Tel:` and a leading `00` are handled.
- **Validity per country** from libphonenumber's numbering plans (not just a length check). `risky` means the length fits but the number is not in an allocated range — usually a typo.
- **Line type**: `mobile`, `fixed_line`, `fixed_line_or_mobile`, `toll_free`, `premium_rate`, `voip`, `shared_cost` and more — split mobile numbers for SMS from landlines.
- **Location and carrier** (original carrier of the number range; names in your chosen language) and **time zones**.
- **Smart de-duplication** — `(650) 253-0000` and `+1 650 253 0000` count as the same number.
- **Fast** — nothing is fetched over the network, 100,000 numbers take seconds.

### Output

| Field | Example |
|---|---|
| `input` | `090-1234-5678` |
| `status` | `valid` / `risky` / `invalid` |
| `reason` | `Valid number for its region` |
| `isValid`, `isPossible` | `true`, `true` |
| `e164`, `international`, `national`, `rfc3966` | `+819012345678`, `+81 90 1234 5678`, `090-1234-5678`, `tel:+81-90-1234-5678` |
| `countryCode`, `regionCode`, `country` | `81`, `JP`, `Japan` |
| `location`, `carrier` | `Tokyo`, `KDDI Japan` (`null` when unknown) |
| `lineType` | `mobile` |
| `timezones` | `["Asia/Tokyo"]` |
| `extension` | `12` or `null` |

```json
{
  "input": "090-1234-5678",
  "status": "valid",
  "reason": "Valid number for its region",
  "isValid": true,
  "isPossible": true,
  "e164": "+819012345678",
  "international": "+81 90 1234 5678",
  "national": "090-1234-5678",
  "rfc3966": "tel:+81-90-1234-5678",
  "countryCode": 81,
  "regionCode": "JP",
  "country": "Japan",
  "location": null,
  "carrier": "KDDI Japan",
  "lineType": "mobile",
  "timezones": ["Asia/Tokyo"],
  "extension": null
}
```

`e164` and the other formats are `null` for numbers that cannot be formatted (`invalid`). `lineType`, `carrier`, `location` and `timezones` are filled only for `valid` numbers. Carrier data is the range's original allocation: it does **not** reflect number porting, and the Actor does not check whether a line is currently active or reachable.

### Input examples

Check a US list:

```json
{ "phoneNumbers": ["(415) 555-2671", "+1 650 253 0000", "12345"], "defaultCountry": "US" }
```

Get only the clean mobile-ready numbers, with Japanese place names:

```json
{ "phoneNumbers": ["090-1234-5678", "03-3581-4111"], "defaultCountry": "JP", "outputFilter": "valid", "language": "ja" }
```

Get only the numbers to clean out:

```json
{ "phoneNumbers": ["+44 20 7946 0958", "+44 20 7946", "abc"], "outputFilter": "problems" }
```

### Use cases

- Clean a CRM or lead export before an SMS or call campaign.
- Convert mixed local formats to E.164 for Twilio, WhatsApp or dialer imports.
- Split mobile from landline and toll-free numbers.
- Pair with an email check: see **Email List Validator** from the same publisher.

### FAQ

**Does it call the number or check if it is active?** No. It validates against numbering plans offline; it cannot tell whether a line is connected.

**Why is the carrier empty?** Carrier names exist only for some countries (e.g. Japan, UK, India), and show the original carrier, not the current one after porting.

**What does a number without `+` need?** Set *Default country*. Numbers starting with `+` or `00` ignore it.

**Where does the data come from?** The open-source [libphonenumber](https://github.com/google/libphonenumber) metadata (Apache License 2.0) via the Python port `phonenumbers`, updated with each Actor build.

### Limits

Up to 200,000 numbers per run. Results depend on the libphonenumber release in the build; new number ranges can lag by weeks.

### Pricing

Free to use — you only pay Apify's standard platform usage.

# Actor input Schema

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

Numbers to check, one per line, any format ('+44 20 7946 0958', '(415) 555-2671', 'tel:+81-3-1234-5678', '090-1234-5678 ext. 12'). Up to 200,000 per run.

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

Two-letter country code used for numbers written without a + prefix, e.g. US, GB, DE, JP. Numbers that start with + or 00 ignore this.

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

Skip repeated numbers. '(650) 253-0000' and '+1 650 253 0000' count as the same number.

## `outputFilter` (type: `string`):

Return every number, only the valid ones, or only the ones to clean out (invalid + risky).

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

Two-letter language code for country, location and carrier names (en, ja, de, fr, es, ...). Falls back to English when unavailable.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+1 650-253-0000",
    "+44 20 7946 0958",
    "090-1234-5678",
    "+81 3-3581-4111",
    "12345"
  ],
  "defaultCountry": "JP",
  "removeDuplicates": true,
  "outputFilter": "all",
  "language": "en"
}
```

# Actor output Schema

## `results` (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 7946 0958",
        "090-1234-5678",
        "+81 3-3581-4111",
        "12345"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("staymeter-labs/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 7946 0958",
        "090-1234-5678",
        "+81 3-3581-4111",
        "12345",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("staymeter-labs/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 7946 0958",
    "090-1234-5678",
    "+81 3-3581-4111",
    "12345"
  ]
}' |
apify call staymeter-labs/phone-number-validator --silent --output-dataset

```

## MCP server setup

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