# Phone Number Validator: E.164, Country & Line Type (`hydrocore/phone-number-validator`) Actor

Validate and format phone numbers in bulk, offline, with Google libphonenumber data: valid or not, E.164, national and international format, country, line type (mobile, landline, VoIP, toll-free) and the reason when a number is invalid. Finds numbers in pasted text too.

- **URL**: https://apify.com/hydrocore/phone-number-validator.md
- **Developed by:** [Hydrocore Data](https://apify.com/hydrocore) (community)
- **Categories:** Lead generation, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.78 / 1,000 phone 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.
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

## Phone Number Validator: Bulk E.164 Formatting, Country & Line Type Check

Validate **phone numbers in bulk** and get one clean row per number: **valid or not**, the **E.164** form for CRMs and SMS tools, **country**, **line type** (mobile, fixed line, toll-free, VoIP, premium rate and more), national and international format, extension, a `tel:` link and the reason when a number fails. Paste a list or any free text (email signatures, web pages, CSV columns) and every number in it is found. Runs offline on Google's libphonenumber metadata (via libphonenumber-js), so it is fast, private and cheap. No API keys, no carrier lookups.

### ✅ What you get

- Valid / possible flags and a plain validation issue
- E.164, national and international format, tel: link
- Country code, country name and calling code
- Line type: mobile, fixed line, fixed line or mobile, toll-free, premium rate, VoIP, pager, personal, shared cost, UAN, voicemail
- Extensions (ext. 12, x12)
- Numbers found in free text, with the matched source text
- Filters by validity, line type and country; sort before the limit

### 🏆 Why this Actor

- **Offline and private:** numbers never leave the run; nothing is sent to a third-party lookup service.
- **Finds numbers in text:** paste a signature, a page or a CSV column and every number in it is extracted and checked.
- **Clear failure reasons:** too short, too long, invalid country code or not a valid number for its country, in plain words.
- **Smart dedupe:** +16502530000 and (650) 253-0000 are the same number and are checked (and charged) once.
- **Fair billing:** one charge per unique saved number; duplicates, filtered numbers and junk inputs are free.

### 💡 Use cases

- CRM and lead list cleanup: normalize every number to E.164 before importing into HubSpot, Salesforce or a dialer
- SMS campaigns: keep only mobile numbers and drop landlines and toll-free numbers before sending
- Form and signup checks: catch fake or mistyped numbers in a nightly batch
- Data enrichment: add country and line type to scraped contact lists
- AI agents: answer "is this a valid mobile number, and how do I write it in E.164?" with one call

### 🚀 How to use

1. Paste **phone numbers** (one per line) or **free text**, and set the **default country** for numbers without +.
2. Optional: keep only valid numbers, certain line types or countries, and pick a sort order.
3. Run, then open **Overview**, **CRM import** or **Issues**, or export / call the API.

### ⚙️ Input

| Field | What it does |
|---|---|
| `phoneNumbers` | Numbers in any format, one per line. The prefilled example list is used when the input is empty and ignored when you paste text. |
| `text` | Optional free text; every phone number in it is checked. |
| `defaultCountry` | ISO country for numbers without + (default US). Empty = international numbers only. |
| `onlyValid` | Save only valid numbers (default false). |
| `lineTypes` | Keep only these line types, e.g. mobile (empty = all). |
| `countries` | Keep only these ISO countries, e.g. US, CA (empty = all). |
| `dedupe` | Check each number once, however it is written (default true). |
| `sortBy` | input (default), country, lineType, invalidFirst. |
| `maxResults` | Most numbers to save, default 1,000. |

Example input:

```json
{
  "phoneNumbers": [
    "+1 650-253-0000",
    "(212) 555-0123",
    "07911 123456"
  ],
  "defaultCountry": "GB",
  "onlyValid": true,
  "lineTypes": [
    "mobile"
  ]
}
```

### ⬆️ Output

One row per unique phone number. Inputs with fewer than 3 digits get a free row with `recordType` = `status` and the reason in `summaryText`. Every row has the same 20 keys in the same order; missing values are `null`. The example is a real row from a test run of the current build.

Overview fields:

| Field | Type | Example | Description |
|---|---|---|---|
| `inputValue` | string | "+1 650-253-0000" | The number exactly as you entered it (or as found in the text). |
| `isValid` | boolean | true | True when the number has the right length and falls in an assigned numbering range for its country (Google libphonenumber metadata). It does not prove the line is connected. |
| `e164` | string | "+16502530000" | Normalized international number (+ country code + national number), the format CRMs, SMS and calling APIs expect. Null when the number cannot be a number of that length. |
| `countryCode` | string | "US" | ISO 3166-1 alpha-2 country or territory of the number range (US, GB, DE...). Shared calling codes (+1, +44, +7) are resolved to the exact territory. |
| `countryName` | string | "United States" | English name of the country or territory. |
| `lineType` | string | "fixedLineOrMobile" | mobile, fixedLine, fixedLineOrMobile (countries such as the US and Canada do not separate them), voip, tollFree, premiumRate, sharedCost, personalNumber, pager, uan, voicemail or unknown. Null when invalid. |
| `isMobile` | boolean | null | True for mobile ranges, false for landline, VoIP, toll-free and other non-mobile ranges, null when the range does not tell (fixedLineOrMobile) or the number is invalid. |
| `nationalFormat` | string | "(650) 253-0000" | How the number is written inside its country. Null when invalid. |
| `validationIssue` | string | null | Why the number is invalid: too short, too long, wrong length for this country, no country, not a phone number, or not in any known numbering range. Null when valid. |

All 20 fields (in order): `recordType`, `inputValue`, `isValid`, `e164`, `countryCode`, `countryName`, `lineType`, `isMobile`, `nationalFormat`, `internationalFormat`, `callingCode`, `nationalNumber`, `extension`, `telUrl`, `isPossible`, `validationIssue`, `parsedWithDefaultCountry`, `sourceText`, `summaryText`, `scrapedAt`.

Real row from a test run of the current build:

```json
{
  "recordType": "phone",
  "inputValue": "+1 650-253-0000",
  "isValid": true,
  "e164": "+16502530000",
  "countryCode": "US",
  "countryName": "United States",
  "lineType": "fixedLineOrMobile",
  "isMobile": null,
  "nationalFormat": "(650) 253-0000",
  "internationalFormat": "+1 650 253 0000",
  "callingCode": "+1",
  "nationalNumber": "6502530000",
  "extension": null,
  "telUrl": "tel:+16502530000",
  "isPossible": true,
  "validationIssue": null,
  "parsedWithDefaultCountry": false,
  "sourceText": null,
  "summaryText": "+16502530000 is a valid landline or mobile number in United States; national format (650) 253-0000.",
  "scrapedAt": "2026-11-15T21:06:26.687Z"
}
```

Views: **Overview**, **CRM import**, **Issues**, **Detailed (all fields)**. Export as JSON, CSV, Excel, XML or HTML from the Storage tab or the API (`/datasets/{id}/items?format=csv&view=overview`). The run summary (`OUTPUT` record in the key-value store) counts inputs, numbers found in text, junk inputs, duplicates, valid and invalid numbers, filtered, over the cap and saved, plus the default country and sort.

### 💰 Pricing

Competitive pricing, pay per result: **$0.00098 per phone number** on the Free plan, less on higher plans, plus the $0.0005 Actor start. The default run (6 example numbers) costs about $0.0064; 10,000 numbers cost about $9.80 on the Free plan. Duplicates, filtered numbers and status rows are never charged.

| Event | What it is | Free | Bronze | Silver | Gold+ |
|---|---|---|---|---|---|
| Phone number checked | One unique phone number checked and saved (valid or invalid, with E.164, country, line type and formats). Duplicates, filtered numbers and inputs with fewer than 3 digits are free. | $0.00098 | $0.0009 | $0.00083 | $0.00078 |
| Actor start | Once per run (Apify standard start event, per GB of memory; the default 256 MB = one fee) | $0.0005 | $0.0005 | $0.0005 | $0.0005 |

### 🔁 Integrations

Works with the Apify API, MCP (AI agents), Make, n8n, Zapier, Google Sheets and webhooks. Field names are stable camelCase, so mappings do not break between runs.

### ❓ FAQ

**Does it check if the number is in service?**

No. It checks that the number is valid for its country's numbering plan and what type of line the number range belongs to. It does not call or ping the network, so it cannot tell if a valid number is switched off.

**How accurate is the line type?**

It comes from Google's libphonenumber metadata, the same data Android uses. Some countries (for example the US and Canada) share number ranges between mobile and landlines, so those numbers get fixedLineOrMobile. Ported numbers keep the type of their original range.

**What does the default country do?**

Numbers written without a + country code, like (212) 555-0123, are read as numbers of that country. Numbers with + or 00 are always read with their own country code. Leave it empty to accept only international numbers.

**What is E.164?**

The international standard format: a + sign, the country code and the number with no spaces, like +16502530000. Most CRMs, SMS gateways and dialers expect it.

**Can I paste a whole document?**

Yes. Put it in the text field and every phone number found in it gets its own row, with sourceText showing where it came from. Up to 200,000 characters per run.

**What is the difference between possible and valid?**

isPossible means the number has a length that fits its country. isValid is stricter: the number also falls in a range the numbering plan actually assigns. A possible but invalid number is usually mistyped or made up.

**Are invalid numbers charged?**

Yes when they are saved, because the validation result is the answer you asked for. Turn on Only valid to drop them for free. Inputs with fewer than 3 digits and duplicates are never charged.

**Is my data stored or shared?**

Numbers are checked inside the run with offline metadata and saved only to your own dataset. Nothing is sent to an outside lookup service.

**Can it handle extensions?**

Yes. Extensions written as ext., x or # are parsed into the extension field and kept out of the E.164 number.

**Is it good for AI agents and automations?**

Yes. Inputs are small, rows are flat, and each row has a summaryText sentence, so an agent, Zapier, Make or n8n flow can validate a number in one call.

### Ready-made examples

- [Validate US and international business numbers](https://apify.com/hydrocore/phone-number-validator/examples/validate-us-uk-france-business-numbers-invalid-first)

### 🛟 Support

Found a problem or need a field? Open an issue on the Issues tab; we read every issue.

### Changelog

- 1.0 (2026-11-15): first release.

# Actor input Schema

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

Phone numbers in any format, one per line: +1 650-253-0000, (212) 555-0123, 0049 30 901820, 07911 123456. Numbers without a + country code are read with the default country below. The prefilled example list is used when the input is empty; it is ignored when you paste text.

## `text` (type: `string`):

Optional. Free text (an email signature, a web page, a CSV column). Every phone number found in it is checked as if you had added it above. Up to 200,000 characters.

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

Two-letter ISO country code used for numbers written without a + country code (for example US, GB, DE, IN). Default US. Leave empty to accept only international (+) numbers.

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

Save only valid numbers. Invalid numbers are then dropped and not charged. Default false.

## `lineTypes` (type: `array`):

Keep only these line types (empty = all). Invalid numbers have no line type, so they are dropped when this filter is set. Dropped numbers are not charged.

## `countries` (type: `array`):

Keep only numbers from these ISO country codes, for example US, CA (empty = all). Dropped numbers are not charged.

## `dedupe` (type: `boolean`):

Check each number once even when it is written in different ways (+16502530000 and (650) 253-0000). Duplicates are not charged. Default true.

## `sortBy` (type: `string`):

Order of the saved rows. Sorting happens before the limit. Default input order.

## `maxResults` (type: `integer`):

Most numbers to save (and charge) in one run. Default 1,000.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+1 650-253-0000",
    "(212) 555-0123",
    "+44 20 7946 0958",
    "+33 6 12 34 56 78",
    "+1 800 555 0199 ext. 12",
    "12345"
  ],
  "defaultCountry": "US",
  "onlyValid": false,
  "dedupe": true,
  "sortBy": "input",
  "maxResults": 1000
}
```

# Actor output Schema

## `overview` (type: `string`):

Valid or not, E.164, country, line type and formats.

## `crm` (type: `string`):

Clean fields for a CRM or dialer import.

## `issues` (type: `string`):

Why numbers failed and how they were read.

## `results` (type: `string`):

Every field for each row.

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

Run summary: inputs, numbers found in text, not-a-number and duplicate inputs skipped, valid, invalid, filtered out, over the cap, saved and status rows.

# 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",
        "(212) 555-0123",
        "+44 20 7946 0958",
        "+33 6 12 34 56 78",
        "+1 800 555 0199 ext. 12",
        "12345"
    ],
    "defaultCountry": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("hydrocore/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",
        "(212) 555-0123",
        "+44 20 7946 0958",
        "+33 6 12 34 56 78",
        "+1 800 555 0199 ext. 12",
        "12345",
    ],
    "defaultCountry": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("hydrocore/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",
    "(212) 555-0123",
    "+44 20 7946 0958",
    "+33 6 12 34 56 78",
    "+1 800 555 0199 ext. 12",
    "12345"
  ],
  "defaultCountry": "US"
}' |
apify call hydrocore/phone-number-validator --silent --output-dataset

```

## MCP server setup

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