# Phone Number Validator & List Cleaner: Line Type & Carrier (`pikoulas/phone-validator`) Actor

Validate and clean phone lists in bulk, offline: CSV, Excel, Google Sheets, Apify datasets, numbers or text. Valid or not and why, E.164, mobile or landline, country, area, original carrier, local time and business hours, duplicates removed, type and country filters, a free summary.

- **URL**: https://apify.com/pikoulas/phone-validator.md
- **Developed by:** [Spyridon Pikoulas](https://apify.com/pikoulas) (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.50 / 1,000 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 & List Cleaner: Line Type & Carrier

Give it a phone list, a CSV, Excel file or Google Sheet, an Apify dataset of leads, or just numbers or any text with
numbers in it, and get back for each number:

- **Valid or not,** and why not: too short, too long, a missing area code, a calling code no country has.
- **Formatted** as E.164 (`+16502530000`), international and national, ready for a CRM, an SMS tool or a dialler.
- **The line type:** mobile, landline, toll-free, premium-rate, VoIP, shared-cost and more.
- **Where it's from:** country, calling code, area or city, and time zone, for calling at the right hour.
- **The carrier** the number was first assigned to: for US numbers the block's original carrier, its OCN and rate
  centre from NANPA's daily assignment files; elsewhere where the numbering plan says.
- **The local time there, and whether it's business hours,** for calling when someone answers.

And a clean list: **duplicates removed** however they were written, **only the types you want** (mobile for SMS),
**only the countries you want**, invalid numbers left out if you like, each number with **the row it came from**, and a
free **summary** of the list: how many valid, invalid and duplicated, by country, type and carrier.

It costs **$0.50 per 1,000 numbers** on Apify's paid plans and $0.75 on the free plan, valid or not. Text that isn't
a phone number at all, duplicates and numbers the filters leave out cost nothing.

### What people use it for

- **Cleaning lead lists:** a scraper's dataset or a CRM export in, the same rows out with each number valid, in
  E.164 and deduplicated, before a campaign or an import.
- **SMS campaigns:** keep the mobile numbers, since landlines can't take texts.
- **Calling at the right time:** each number's local time and whether it's business hours there, so a team calls
  during the other side's working day.
- **Forms and sign-ups:** check numbers people typed before they reach your CRM.
- **Automation:** a validation step in a Make, Zapier or n8n workflow, through Apify's API.

### How to validate phone numbers

1. Click **Try for free**; Apify's free plan covers a first run.
2. Pick **Apify datasets**, add **Files by URL**, enter the **Phone numbers**, one a line, or paste any text under
   **Text with phone numbers**.
3. Set the **Default country** if your numbers are written without + and their country code, and any filters.
4. Click **Start**, then download the results as JSON, CSV or Excel.

An input with every option:

```json
{
  "phones": ["(415) 555-2671", "+44 20 7946 0018", "06 12 34 56 78"],
  "text": "Call us on 0161 496 0000 or +1 650-253-0000.",
  "datasetIds": ["YOUR_DATASET_ID"],
  "fileUrls": ["https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit"],
  "phoneFields": ["Phone", "contact.mobile"],
  "includeRecord": true,
  "defaultCountry": "GB",
  "removeDuplicates": true,
  "onlyValid": true,
  "types": ["mobile", "fixed_line_or_mobile"],
  "countries": ["GB", "US"]
}
```

### Output

A number from a dataset of FMCSA carriers, its row trimmed here:

```json
{
  "input": "5195677525",
  "valid": true,
  "reason": null,
  "e164": "+15195677525",
  "international": "+1 519-567-7525",
  "national": "(519) 567-7525",
  "extension": null,
  "callingCode": 1,
  "countryCode": "CA",
  "country": "Canada",
  "type": "fixed_line_or_mobile",
  "location": "Ontario",
  "carrier": null,
  "carrierOcn": null,
  "rateCenter": null,
  "timeZones": [
    "America/Toronto"
  ],
  "localTime": "2026-11-21T13:18:40-05:00",
  "businessHours": false,
  "error": null,
  "source": "70SY4eRW3g9XDVQUd",
  "checkedAt": "2026-11-21T18:18:40Z",
  "record": {
    "dotNumber": 4156436,
    "legalName": "EID BROS USA INC",
    "city": "AUSTIN",
    "state": "TX",
    "phone": "5195677525",
    "fax": null,
    "cellPhone": null
  }
}
```

An invalid number comes with `valid: false` and its `reason`, its formats and line details empty. Text that can't be
read as a number at all comes with `input` and `error` only. `localTime` is the time where the number is when it was
checked, and `businessHours` whether that was 9:00 to 17:00, Monday to Friday; both are empty for a number in zones
with different hours. `source` is the dataset or file it came from and `record` its row there.

A US number gets its block's original carrier, that carrier's Operating Company Number and the block's rate centre:
`+1 650-253-0000` gives `"carrier": "MCIMETRO ACCESS TRANSMISSION SERVICES LLC - CA"`, `"carrierOcn": "7240"` and
`"rateCenter": "MT VIEW"`. A Canadian one, like the number above, has none.

### Lists from files and datasets

Each row's phone columns are read: those named under **Phone columns** (dotted for a nested field), or else every
column whose name says phone, mobile, tel, cell, fax or WhatsApp. A cell with several numbers, such as
`+33 1 42 68 53 00 / +33 6 12 34 56 78`, gives each; a cell that holds none comes back as not a number, free. Files are
CSV, TSV, Excel, ODS, JSON or JSON Lines, up to 100 MB, or a Google Sheet shared with anyone with the link.

### Summary

Each run writes a free `SUMMARY` record, linked from the run's **Output** tab. From 3,000 trucking carriers' phone,
fax and cell columns:

```json
{
  "read": 4321,
  "given": 4042,
  "valid": 4029,
  "invalid": 12,
  "notNumbers": 1,
  "duplicates": 279,
  "filteredOut": 0,
  "inBusinessHoursNow": 0,
  "rowsWithoutPhone": 12,
  "byCountry": [{"countryCode": "US", "numbers": 4024}, {"countryCode": "CA", "numbers": 4}, {"countryCode": "PR", "numbers": 1}],
  "byType": [{"type": "fixed_line_or_mobile", "numbers": 3934}, {"type": "toll_free", "numbers": 95}],
  "byCarrier": [{"carrier": "SOUTHWESTERN BELL", "numbers": 996}, {"carrier": "NEW CINGULAR WIRELESS PCS, LLC - IL", "numbers": 535}, {"carrier": "CELLCO PARTNERSHIP DBA VERIZON WIRELESS - TX", "numbers": 295}, {"carrier": "T-MOBILE USA, INC.", "numbers": 289}],
  "invalidReasons": [{"reason": "Not a number in use in its country's numbering plan.", "numbers": 7}, {"reason": "Too long.", "numbers": 4}, {"reason": "Too short.", "numbers": 1}],
  "unreadSources": []
}
```

It was a Saturday, so none was in business hours. They took 17 seconds, NANPA's files included, and 3,924 of the
3,930 US numbers outside toll-free got a carrier (`byCarrier` lists 15; four are shown).

### Use it as an API

Apify's API starts a run and returns its dataset as JSON; its Python and JavaScript clients, and its Make, Zapier
and n8n integrations, work the same way.

```bash
curl -X POST "https://api.apify.com/v2/acts/pikoulas~phone-validator/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"phones": ["+44 20 7946 0018", "(415) 555-2671"], "defaultCountry": "US"}'
```

AI agents can call it as a tool through Apify's MCP server: `https://mcp.apify.com?tools=pikoulas/phone-validator`.

### How much does it cost?

Each number checked is $0.0005, valid or not, so 10,000 numbers cost $5. A number given twice is given and charged
once, unless **Remove duplicates** is off, and numbers the filters leave out are free. Set a spending limit on a run
and it stops there, with what it has checked so far. 100,000 numbers take about six minutes.

### Good to know

- **It checks numbers against each country's numbering plan, offline,** with Google's libphonenumber. A valid number
  is one that's possible and in a block in use; it doesn't call or message it, so it can't tell whether that line is
  connected today or who has it now.
- **US and Canada numbers** share area codes between mobiles and landlines, so their type is `fixed_line_or_mobile`.
  Elsewhere the type is usually exact.
- **The carrier** is the one the number's block was assigned to. **A ported number won't match:** one moved to another
  network keeps its block's original carrier here.
- **US carriers** come from NANPA, which assigns US numbers: its daily files of the prefixes and thousands-blocks it
  assigned, about 15 MB, read whole at the first US number in a few seconds. A block's assignee comes first, else its
  prefix's holder. Toll-free and Canadian numbers have none; a number in another country gets libphonenumber's.
- **Time zones** are left empty for a number that spans more than five, such as a US toll-free one.
- **The default country** is for numbers written the national way (`020 7946 0018` in GB). A number with + and its
  country code is read as that country's whatever the default. In text, without a default country, only numbers
  starting with + are found.
- **Files are fetched as a guest,** naming itself `PhoneValidatorActor`, following each host's `robots.txt`, and
  only from public addresses. The numbers themselves go nowhere, NANPA's files included: they're read whole.
- **Contact.** The Actor keeps nothing itself: the numbers and results sit in the storage of whoever ran it. Questions or requests go to spyridwn.pd@gmail.com.

### FAQ

#### Does it tell me whether a number is active?

No, nor who serves it after a port. That takes a live lookup with the networks, which this doesn't do: it sends the
numbers nowhere. It tells you whether a number can exist, what kind it is and who its block was assigned to, which
removes typos, fakes and numbers in unused ranges.

#### Can I check numbers from a spreadsheet?

Yes: give its link under **Files by URL** (a Google Sheet shared with anyone with the link works), or pick a dataset.
Each row comes back with its numbers checked. Set the **Default country** if the numbers have no + and country code.

#### Is it legal to validate phone numbers?

Checking the format of numbers you hold is fine; what you do with them is up to the law where you and the people
called are. Calls and texts for marketing need consent in many places (the TCPA in the US, PECR and the GDPR in the UK
and the EU), and this tool doesn't check do-not-call lists. If you're unsure, ask a lawyer.

#### Something missing or not working?

Open an issue on the **Issues** tab with the input you used, or ask there for a field you need.

If it does what you need, a review on the **Reviews** tab helps others find it.

# Actor input Schema

## `phones` (type: `array`):

One number a line, in any common format: +1 650-253-0000, (415) 555-2671, 020 7946 0018. Numbers without a + need the default country.

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

Paste a CSV column, a page's text or any text: every phone number in it is checked once. Without a default country, only numbers starting with + are found.

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

A two-letter country code such as US, GB or DE, for numbers written without + and their country code.

## `datasetIds` (type: `array`):

Datasets from your account, such as a scraper's leads: the numbers in each row's phone fields are checked.

## `fileUrls` (type: `array`):

Direct links to CSV, TSV, Excel (XLSX, XLS), ODS, JSON or JSON Lines files, up to 100 MB each, or Google Sheets shared with anyone who has the link.

## `phoneFields` (type: `array`):

The columns or fields holding numbers, such as Phone or contact.mobile for a nested one. Left empty, every column whose name says phone, mobile, tel, cell, fax or WhatsApp. A cell with several numbers gives each.

## `includeRecord` (type: `boolean`):

Each number comes with the row it was found in, so the cleaned list keeps its names and other columns.

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

A number given again, written any way (+44 20 7946 0018 or 020 7946 0018 from the UK), is counted in the summary, not given or charged again.

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

Leave out invalid numbers and text that isn't a number. Left out, they aren't charged.

## `types` (type: `array`):

Only numbers of these types, such as mobile for SMS. In the US and Canada, mobile and landline numbers share ranges and come as fixed line or mobile.

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

Only numbers of these countries, by two-letter code such as US, GB or DE.

## Actor input object example

```json
{
  "phones": [
    "+1 650-253-0000",
    "+44 20 7946 0018",
    "+33 6 12 34 56 78",
    "12345"
  ],
  "includeRecord": true,
  "removeDuplicates": true,
  "onlyValid": false
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "phones": [
        "+1 650-253-0000",
        "+44 20 7946 0018",
        "+33 6 12 34 56 78",
        "12345"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pikoulas/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 = { "phones": [
        "+1 650-253-0000",
        "+44 20 7946 0018",
        "+33 6 12 34 56 78",
        "12345",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("pikoulas/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 '{
  "phones": [
    "+1 650-253-0000",
    "+44 20 7946 0018",
    "+33 6 12 34 56 78",
    "12345"
  ]
}' |
apify call pikoulas/phone-validator --silent --output-dataset

```

## MCP server setup

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