# Phone Number Validator & Formatter – Bulk, Carrier, Line Type (`gazidev/phone-validator`) Actor

Validate and format phone numbers in bulk for 240+ countries: valid/possible, E.164, international and national formats, mobile/fixed/VoIP/toll-free type, original carrier, location and time zones. Offline Google libphonenumber - fast and cheap, 100k numbers per run.

- **URL**: https://apify.com/gazidev/phone-validator.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 phone number validateds

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 & Formatter – Bulk, 240+ Countries, Carrier & Line Type

Validate, clean and format phone numbers in bulk. Paste a list, upload a CSV or point the Actor at another Actor's dataset. For each number you get:

- **valid / possible** plus a plain-English **reason** when a number is invalid (too short, too long, unknown country code, unallocated range, missing area code)
- **E.164** (`+14155550123`), **international**, **national** and **RFC 3966** (`tel:`) formats
- **country calling code**, **ISO country** (US, GB, DE…) and country name
- **line type**: mobile, fixed line, fixed\_line\_or\_mobile, VoIP, toll-free, premium rate, shared cost, UAN, pager, personal number or voicemail
- **original carrier** (for mobile ranges), **location** (city or region) and **time zones**
- the **extension**, if the input had one

It is built on **Google's libphonenumber**, the library Android, Google and most CRMs use, and covers 240+ countries and territories. All checks run **offline**, which makes the Actor very fast: 100,000 numbers in about a minute, at **$5 per 1,000 numbers**.

### What it does NOT do (please read)

- **No live network lookup (HLR / ping / SMS).** A number can be correctly formatted and in an allocated range and still be disconnected or unused. The Actor tells you whether a number *can* exist, not whether someone answers it.
- **The carrier is the carrier the number range was originally allocated to.** Numbers that were ported to another operator still show the original carrier. Many countries (the US and Canada among them) don't publish carrier data per range, so `carrier` is empty there.
- In the US and Canada most numbers are reported as `fixed_line_or_mobile`, because the numbering plan does not separate mobile and landline ranges.

### Use cases

- **CRM and lead-list cleanup:** normalise every phone to E.164 before you import into HubSpot, Salesforce, Pipedrive or Zoho, and drop the invalid ones.
- **SMS and WhatsApp campaigns:** keep only `mobile` numbers and skip landlines and toll-free numbers, so you don't pay for messages that can't be delivered.
- **Scraped data enrichment:** validate the `phone` field from Google Maps, Yelp or contact-scraper datasets in one run with `datasetId`.
- **Form and signup QA:** find fake numbers such as `555-0123`, too-short entries and unknown country codes.
- **Call scheduling:** use `timeZones` to call people during their business hours.
- **AI agents:** give an LLM a deterministic tool for "is this a real phone format, and what is it in E.164?"

### Input

You can combine the sources below. Numbers can be written in any format: spaces, dashes, dots, brackets, `(0)`, `00` or `011` prefixes, `tel:` links, `ext.` / `x` extensions, vanity letters (`1-800-FLOWERS`) and full-width digits all work.

| Field | What it does |
|---|---|
| `phoneNumbers` | List of numbers |
| `defaultCountry` | ISO code (`US`, `GB`, `DE`, `IN`, `BR`, `TR`…) used for numbers written without `+`/`00` |
| `bulkText` | Paste one number per line or a whole CSV/TSV with a header row |
| `sourceFileUrl` | URL of a CSV/TXT file, for example a Google Sheets "Publish to web" CSV |
| `datasetId` | An Apify dataset ID or name. The phone field is auto-detected, and list fields such as `phones: [...]` are expanded |
| `phoneColumn`, `countryColumn` | Set these when auto-detection picks the wrong column. The country column sets the country per row |
| `keepFields` | Columns to copy into each result (for example `id`, `email`) so you can join the results back to your data |
| `dedupe` | Removes duplicates, compared in E.164 (on by default; duplicates are not charged) |
| `outputFilter` | `all`, `valid` or `invalid`. Hidden rows are not charged |
| `includeCarrier`, `includeLocation`, `includeTimeZones`, `language` | Choose the enrichment fields and the language for names |
| `assumeInternational` | When no country is known, read a bare `4915123456789` as `+49…` (flagged as `parsedAs: "assumed_international"`) |
| `maxNumbers` | Cap for test runs |

```json
{
  "phoneNumbers": ["+1 650-253-0000", "(201) 555-0123", "1-800-FLOWERS", "+44 20 7946 0958 ext. 12", "0049 30 2270", "+90 532 123 45 67"],
  "defaultCountry": "US",
  "dedupe": true
}
```

### Output

One dataset row per number. The **Overview** table shows the key columns, and **Why invalid** lists the rejected numbers with their reasons. The full output can be exported as JSON, CSV or Excel.

```json
{
  "input": "+90 532 123 45 67",
  "valid": true,
  "possible": true,
  "reason": null,
  "reasonCode": null,
  "e164": "+905321234567",
  "international": "+90 532 123 45 67",
  "national": "0532 123 45 67",
  "rfc3966": "tel:+90-532-123-45-67",
  "countryCallingCode": 90,
  "nationalNumber": "5321234567",
  "extension": null,
  "regionCode": "TR",
  "countryName": "Turkey",
  "numberType": "mobile",
  "carrier": "Turkcell",
  "location": "Turkey",
  "timeZones": ["Europe/Istanbul"],
  "defaultCountry": "US",
  "parsedAs": "international",
  "source": "phoneNumbers",
  "rowNumber": 12
}
```

An invalid number keeps whatever the Actor could still work out:

```json
{ "input": "+44 7700 900123", "valid": false, "possible": true, "reasonCode": "INVALID_RANGE",
  "reason": "Right length, but not in any allocated number range for GB", "e164": "+447700900123", "regionCode": "GB" }
```

`reasonCode` values: `NOT_A_NUMBER`, `INVALID_COUNTRY_CODE`, `TOO_SHORT`, `TOO_LONG`, `INVALID_LENGTH`, `LOCAL_ONLY` (the area code is missing), `INVALID_RANGE`.

### Pricing

Pay per event: **$0.005 per number validated** ($5 per 1,000), plus a tiny start fee ($0.0001). Blank cells, values without any digits, removed duplicates and rows hidden by the output filter are **not charged**. Set a *Maximum cost per run* and the Actor stops cleanly when it reaches it.

| Actor | Price per 1,000 numbers |
|---|---|
| khadinakbar/phone-number-lookup-api | $25 |
| checkthatphone/phone-validator (US carrier/TCPA lookup, a different service) | $15 |
| **This Actor** | **$5** |

*Competitor prices are from the Apify Store in September 2026 and may change.*

### FAQ

**Is a "valid" number guaranteed to be in service?** No. "Valid" means the number is in a range the country's numbering plan has allocated. Only a live HLR lookup, which this Actor does not do, can tell you whether a SIM is active.

**Why is `carrier` empty?** Carrier data only exists for mobile ranges in countries that publish it. The US, Canada and a few others don't. Ported numbers keep the original carrier name.

**What default country should I use?** The country most of your numbers come from. Numbers with `+` or `00` are always read as international. If your CSV has a country column, it overrides the default for each row.

**How big can a run be?** 100k+ numbers per run works well with the default 512 MB. Results are written in chunks of 1,000.

**Is my data sent anywhere?** No. Validation runs inside the Actor with no third-party calls. The only network requests are for the file URL or dataset you give it.

**Which data source is used?** [libphonenumber](https://github.com/google/libphonenumber) by Google (Apache 2.0), through the Python port [`phonenumbers`](https://github.com/daviddrysdale/python-phonenumbers). Updates to the metadata ship with new Actor builds.

### Use with AI agents / Apify MCP

The Actor is deterministic, fast and cheap, which makes it a good tool for AI agents. Add it to Claude, Cursor or any MCP client through the [Apify MCP server](https://mcp.apify.com) (`https://mcp.apify.com?actors=gazidev/phone-validator`) and ask, for example, *"Normalise these 50 phone numbers to E.164 and tell me which ones are mobile"*. You can also call it over the API:

```bash
curl -X POST "https://api.apify.com/v2/acts/gazidev~phone-validator/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"phoneNumbers":["+1 650-253-0000","030 2270"],"defaultCountry":"DE"}'
```

### Other Actors by gazidev

Scraped contact data? Pair this Actor with our website contact and tech-stack tools to build clean, enriched lead lists.

# Actor input Schema

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

Phone numbers in any format: `+44 20 7946 0958`, `(201) 555-0123`, `0049 30 2270`, `1-800-FLOWERS`, `+1 650 253 0000 ext. 12`. Numbers without `+`/`00` use the default country below.

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

Two-letter ISO country code (US, GB, DE, IN, BR, TR...) used for numbers written without `+` or `00`, e.g. `(201) 555-0123`. Leave empty if all numbers are international. A country column in your CSV/dataset overrides it per row.

## `bulkText` (type: `string`):

Paste one number per line, or a whole CSV/TSV export with a header row (the phone column is detected automatically, or set it below).

## `sourceFileUrl` (type: `string`):

Public URL of a .csv or .txt file, e.g. a Google Sheets 'Publish to web' CSV link or an Apify key-value store record URL.

## `datasetId` (type: `string`):

Validate phone numbers from another Actor's dataset (e.g. Google Maps or contact scrapers). The phone field is auto-detected; fields holding a list of phones are expanded.

## `phoneColumn` (type: `string`):

Column (CSV) or field (dataset) that holds the phone number. Empty = auto-detect (phone, tel, mobile, number...).

## `countryColumn` (type: `string`):

Column with a per-row ISO country code (or calling code like 49). Empty = auto-detect a column named country / countryCode / iso.

## `keepFields` (type: `array`):

CSV columns or dataset fields to copy into each result under `record` (e.g. `id`, `name`, `email`) so you can join results back to your CRM.

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

Keep only the first occurrence of each number (compared in E.164, so `+1 650-253-0000` and `(650) 253 0000` are the same). Duplicates are not charged.

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

Save all numbers, only valid ones or only invalid ones. Hidden numbers are not charged.

## `includeCarrier` (type: `boolean`):

Carrier the number range was allocated to (mobile numbers). Ported numbers may show the original carrier, not the current one.

## `includeLocation` (type: `boolean`):

Geographic description of the number range, e.g. `Mountain View, CA` or `London`.

## `includeTimeZones` (type: `boolean`):

IANA time zones for the number, handy for call scheduling.

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

Language code for location/carrier names where available (en, de, fr, es, zh, ja, ...). Falls back to English.

## `assumeInternational` (type: `boolean`):

When no default/row country is known, try `4915123456789` as `+49 1512 3456789`. The result shows `parsedAs: assumed_international`.

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

Stop after this many input numbers (0 = no limit). Useful to test a big file cheaply.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+1 650-253-0000",
    "(201) 555-0123",
    "1-800-FLOWERS",
    "+44 20 7946 0958 ext. 12",
    "+44 7700 900123",
    "0049 30 2270",
    "+33 1 23 45 67 89",
    "+61 491 570 156",
    "+81 3-1234-5678",
    "+91 98765 43210",
    "+55 11 91234-5678",
    "+90 532 123 45 67",
    "call me maybe"
  ],
  "defaultCountry": "US",
  "dedupe": true,
  "outputFilter": "all",
  "includeCarrier": true,
  "includeLocation": true,
  "includeTimeZones": true,
  "language": "en",
  "assumeInternational": true,
  "maxNumbers": 0
}
```

# Actor output Schema

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

No description

## `invalid` (type: `string`):

No description

## `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",
        "(201) 555-0123",
        "1-800-FLOWERS",
        "+44 20 7946 0958 ext. 12",
        "+44 7700 900123",
        "0049 30 2270",
        "+33 1 23 45 67 89",
        "+61 491 570 156",
        "+81 3-1234-5678",
        "+91 98765 43210",
        "+55 11 91234-5678",
        "+90 532 123 45 67",
        "call me maybe"
    ],
    "defaultCountry": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/phone-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",
        "(201) 555-0123",
        "1-800-FLOWERS",
        "+44 20 7946 0958 ext. 12",
        "+44 7700 900123",
        "0049 30 2270",
        "+33 1 23 45 67 89",
        "+61 491 570 156",
        "+81 3-1234-5678",
        "+91 98765 43210",
        "+55 11 91234-5678",
        "+90 532 123 45 67",
        "call me maybe",
    ],
    "defaultCountry": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("gazidev/phone-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",
    "(201) 555-0123",
    "1-800-FLOWERS",
    "+44 20 7946 0958 ext. 12",
    "+44 7700 900123",
    "0049 30 2270",
    "+33 1 23 45 67 89",
    "+61 491 570 156",
    "+81 3-1234-5678",
    "+91 98765 43210",
    "+55 11 91234-5678",
    "+90 532 123 45 67",
    "call me maybe"
  ],
  "defaultCountry": "US"
}' |
apify call gazidev/phone-validator --silent --output-dataset

```

## MCP server setup

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