# Phone Number Validator & Formatter | Bulk E.164 (`bottyprojects/phone-number-checker`) Actor

Validate and format phone numbers in bulk, offline: valid or not, E.164, international and national formats, country, calling code and line type. Format and numbering-plan checks only — not a live line or owner lookup. $0.0008 per number ($0.80 per 1,000) plus a $0.005 start fee.

- **URL**: https://apify.com/bottyprojects/phone-number-checker.md
- **Developed by:** [BottyProjects Data Tools](https://apify.com/bottyprojects) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 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.

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 E.164

Validate and format phone numbers in bulk, offline. For each number you get whether it is valid and possible, E.164, international and national formats, country, calling code and line type (mobile, fixed line, VoIP, toll-free and others when the numbering plan exposes them).

This is a **format and numbering-plan check only**. It does not confirm that a number is in service, that it can receive calls or SMS, or who owns it. No numbers are sent to any third-party lookup, carrier, HLR or people-search service.

Start with the prefilled examples and click Start. **$0.0008 per number checked** ($0.80 per 1,000) plus a **$0.005 start fee** once per run. Empty or unparseable inputs are written as free error rows and are not charged.

- ✅ **Offline** — uses the open-source libphonenumber numbering-plan data that ships in the Actor. No API key, no proxies, no login
- ✅ **Bulk lists** — paste national or international numbers; set a default country for numbers that have no `+` country code
- ✅ **Standard formats** — E.164, international and national
- ✅ **Line type when known** — mobile, fixed line, VoIP, toll-free, premium rate and others. In the US and Canada, many numbers are `fixed_line_or_mobile` because the numbering plan does not tell them apart
- ✅ **Deduplicate** — on by default: later copies of the same number (same E.164) are skipped and not charged
- ✅ **Bad input is free** — empty lines and text that is not a phone number get an `errorReason` row and are not billed

This Actor is not affiliated with, endorsed by, or sponsored by Google or the libphonenumber project. It uses the open-source [libphonenumber-js](https://github.com/catamphetamine/libphonenumber-js) library (MIT license), which is based on Google's libphonenumber metadata (Apache License 2.0), for offline numbering-plan checks.

### For AI agents

Offline phone number validator and formatter. It checks format and numbering-plan validity only — it does not confirm that a line is active or who owns it.

Input:

```json
{
    "phoneNumbers": ["+1 202-555-0100", "(202) 555-0199", "+44 20 7946 0958", "not-a-number"],
    "defaultCountry": "US",
    "dedupe": true
}
```

Cost: $0.005 once per run (`run-start`) plus $0.0008 per number actually checked (`number-checked`, $0.80 per 1,000). Empty and unparseable inputs are free error rows. Duplicates skipped with `dedupe` are not charged.

Each dataset row includes `input`, `isValid`, `isPossible`, `e164`, `international`, `national`, `countryCode`, `callingCode`, `numberType` and `errorReason`. A `RUN_SUMMARY` record in the default key-value store has counts for the run.

### Input

| Field                              | What to enter                                                                                                                                    |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Phone numbers** (required)       | One number per line. A leading `+` and country code is the most reliable form. National numbers use **Default country**                          |
| **Default country**                | ISO 3166-1 alpha-2 code (default `US`) for numbers without a `+` country code                                                                    |
| **Skip duplicate numbers**         | On by default. Later copies of the same E.164 number (or the same trimmed input if it cannot be parsed) are skipped, not written and not charged |
| **Write error rows for bad input** | On by default. Empty or unparseable values are written as free error rows                                                                        |

### Output

Each checked number is one dataset row:

```json
{
    "recordType": "result",
    "index": 0,
    "input": "+1 202-555-0100",
    "isValid": true,
    "isPossible": true,
    "e164": "+12025550100",
    "international": "+1 202 555 0100",
    "national": "(202) 555-0100",
    "countryCode": "US",
    "callingCode": "+1",
    "numberType": "fixed_line_or_mobile",
    "errorReason": null
}
```

The examples above use reserved fictional ranges (for example North American 555 and the UK 020 7946 drama range), not live lines.

| Field                                 | Meaning                                                                                                                                                                    |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `isValid`                             | The number matches its country's numbering plan                                                                                                                            |
| `isPossible`                          | The number has a plausible length for that country, even if it is not a valid plan number                                                                                  |
| `e164` / `international` / `national` | Standard formats, or `null` when the input could not be parsed                                                                                                             |
| `countryCode`                         | ISO region, for example `US` or `GB`                                                                                                                                       |
| `callingCode`                         | Country calling code with a `+`, for example `+1`                                                                                                                          |
| `numberType`                          | `mobile`, `fixed_line`, `fixed_line_or_mobile`, `voip`, `toll_free`, `premium_rate`, `shared_cost`, `personal_number`, `pager`, `uan`, `voicemail`, or `null` when unknown |
| `errorReason`                         | `null` when valid; otherwise `empty`, `not_a_number`, `invalid_input`, `invalid_country`, `too_short`, `too_long`, `invalid_length` or `invalid_number`                    |
| `recordType`                          | `result` for a number that was checked, `error` for bad input (free)                                                                                                       |

The default key-value store also has `RUN_SUMMARY` with `inputCount`, `checked`, `valid`, `invalid`, `errors`, `duplicatesSkipped` and `skippedDueToCostLimit`.

### Pricing

- **`run-start`**: $0.005 once per run, so a run that checks nothing still covers compute
- **`number-checked`**: $0.0008 per number that was parsed and checked (valid or invalid). **$0.80 per 1,000**
- Empty lines, unparseable text and skipped duplicates are **free**
- Set a max cost per run in Apify if you want a hard cap; the Actor stops charging further numbers when that cap is reached

Examples: 1 number costs $0.0058. 1,000 unique numbers cost $0.805. The platform start fee may also appear on the invoice.

### Limits and accuracy

- Default memory is **256 MB**, enough for at least 10,000 numbers in one run (measured locally; see PRICING.md)
- There is no hard cap on list size. For very large lists (tens of thousands and up), raise memory to 512 MB if a run gets close to the limit
- Validity means “this number fits the published numbering plan,” not “this line is in service”
- Line type is only as specific as the numbering-plan data. US and Canadian numbers are often `fixed_line_or_mobile`
- This Actor does not look up carriers, owners, names, addresses, or messaging-app accounts, and it does not dial or message any number

### Privacy

Phone numbers can be personal data. The numbers you enter stay in your own Apify run, dataset and key-value store. This Actor doesn't send them to any other service, and its logs show only counts. You're responsible for having a lawful basis to process them (for example under GDPR or CCPA/CPRA) and for following calling and texting consent rules (for example the TCPA) before you contact anyone. A valid result is not consent to contact.

### Use cases

- Clean a CRM or lead list before import
- Normalise mixed national formats to E.164
- Filter out empty or impossible numbers before an outreach tool
- Give an AI agent a cheap, keyless way to validate numbers it already has — not to find new people

### Changelog

- **1.0** — First build (local only; not published yet)

# Actor input Schema

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

Numbers to check, one per line. International format with a + country code is most reliable. National numbers use Default country. Current fees: $0.005 per run plus $0.0008 per number checked ($0.80 per 1,000). Empty lines are reported as free error rows and are not charged.

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

ISO 3166-1 alpha-2 country code (for example US, GB, DE) used when a number has no + country code. Leave as US unless your list is from another country.

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

When on, later copies of the same number (same E.164 when it can be parsed, otherwise the same trimmed input) are skipped, not written and not charged. The run summary counts how many were skipped.

## `outputErrors` (type: `boolean`):

When on (default), empty or unparseable inputs are written to the dataset as free error rows with an errorReason. They are never charged. Turn off to keep only numbers that were actually checked.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+1 202-555-0100",
    "+44 20 7946 0958"
  ],
  "defaultCountry": "US",
  "dedupe": true,
  "outputErrors": true
}
```

# Actor output Schema

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

No description

## `errors` (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 = {
    "phoneNumbers": [
        "+1 202-555-0100",
        "(202) 555-0199",
        "+44 20 7946 0958",
        "not-a-number"
    ],
    "defaultCountry": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("bottyprojects/phone-number-checker").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 202-555-0100",
        "(202) 555-0199",
        "+44 20 7946 0958",
        "not-a-number",
    ],
    "defaultCountry": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("bottyprojects/phone-number-checker").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 202-555-0100",
    "(202) 555-0199",
    "+44 20 7946 0958",
    "not-a-number"
  ],
  "defaultCountry": "US"
}' |
apify call bottyprojects/phone-number-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bottyprojects/phone-number-checker"
        }
    }
}
```

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/2zrRPt5jnfXDb8y3m/builds/nlngCMmgGcpckABAO/openapi.json
