# Phone Number Validator (`accountable_eel/phone-number-validator`) Actor

Validate phone numbers offline with Google's libphonenumber. Get validity, number type (mobile, landline, VOIP, toll-free), country, and E.164/international/national formats. Never charged for an invalid number.

- **URL**: https://apify.com/accountable\_eel/phone-number-validator.md
- **Developed by:** [Adrian Voss](https://apify.com/accountable_eel) (community)
- **Categories:** Developer tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 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.
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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Phone Number Validator

You paste a list of phone numbers and get back, per number, whether it's a real, validly
formatted number — plus its type (mobile, landline, VOIP, toll-free...), country, and
E.164/international/national formats. Every answer comes from **Google's libphonenumber**,
computed entirely offline: no third-party API, no scraping, no network request of any kind.
That also means no rate limit, no blocking, and no per-call vendor cost — you're only ever
charged for a number libphonenumber actually confirms is real.

### Who it's for

Anyone who needs to clean a list of phone numbers before it hits a dialer, a CRM, an SMS
campaign, or a lead-gen pipeline: sales-ops teams deduping a contact export, form-validation
services checking a signup field server-side, or an AI agent that just scraped a list of
numbers off the web and needs to know which ones are even worth trying. If your list mixes
real numbers with typos, placeholders, and copy-paste garbage, this sorts them before you
spend money dialing or texting a dead number.

### Why offline

Most "phone validator" actors on Apify wrap a paid third-party API (Twitter's account-lookup
tricks, a paid HLR/carrier-lookup service, or phoneinfoga-style OSINT scraping) — that means
per-lookup vendor cost, rate limits, and a network round trip per number. This actor's
validation logic is the same open-source number-plan metadata Android and Google's own
products ship with: no vendor in the loop, no network call, no rate limit, and results in
milliseconds. The trade-off is honesty about scope — see **What you don't get** below.

### What you get

- **isValid** — confirmed against libphonenumber's real per-country number-plan rules (not
  just "the right number of digits").
- **isPossible** — true whenever the length is plausible for the country, even if `isValid`
  turns out false. Exposed separately so you can see *why* a number failed, not just that it did.
- **numberType** — MOBILE, FIXED\_LINE, FIXED\_LINE\_OR\_MOBILE, VOIP, TOLL\_FREE, PREMIUM\_RATE,
  PERSONAL\_NUMBER, PAGER, UAN, VOICEMAIL, or UNKNOWN, per libphonenumber's own classification.
- **regionCode**, **countryCallingCode** — the ISO country and dialing code the number resolves to.
- **e164Format**, **internationalFormat**, **nationalFormat** — libphonenumber's three standard
  renderings, ready to paste into a dialer or an SMS API.

#### What you don't get

**Carrier name.** Google's real carrier-name mapping (e.g. "this is a Verizon number") is a
separate, proprietary dataset that was never released for the open-source JS library this
actor uses — anyone claiming to give you a live carrier name from a client-side/offline
library is either calling a paid HLR lookup behind the scenes or guessing from the prefix
(which goes stale the moment a number is ported). This actor doesn't fabricate that field.

### How to use

1. **In the Apify Console.** Open the actor page and click **Start** — the `phoneNumbers` field is already pre-filled with a working example. Results land in the run's dataset as soon as each item is found.
2. **Via the API.** Call it directly with a POST request — no Console needed once you have an API token:
   ```bash
   curl "https://api.apify.com/v2/acts/accountable_eel~phone-number-validator/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
     -X POST \
     -H "Content-Type: application/json" \
     -d '{"phoneNumbers":["+14155552671","+442071838750"]}'
   ```
3. **On a schedule.** Save this actor as an Apify **Task** with the input you want, then add a **Schedule** (hourly, daily, weekly) so it runs on its own — no server of your own required.

### Input

```json
{
  "phoneNumbers": [
    "+14155552671",
    "+442071838750"
  ]
}
```

One phone number per line. International format with a leading + is always safe (e.g. +14155552671); a number in national format (e.g. 4155552671) needs the optional "Default country" field set below. Accepted formats: +14155552671, +44 20 7183 8750, (415) 555-2671 with Default country = US.

`phoneNumbers` is a list of phone numbers in any format — E.164 (with a leading `+`) is always
safe with no other input needed. A number in national format (no `+`, e.g. `4155552671` or
`(415) 555-2671`) needs the optional **Default country** field set to a 2-letter ISO code
(e.g. `"US"`), since libphonenumber needs a region hint to interpret a number with no country
code embedded in it. One dataset row is returned per item; rows with `"found": false` are
never charged.

### Output

One row per item, for example:

| query | found | status | isValid | isPossible | regionCode | numberType | countryCallingCode | e164Format | internationalFormat | nationalFormat | scrapedAt |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| +14155552671 | true | OK | true | true | US | FIXED\_LINE\_OR\_MOBILE | 1 | +14155552671 | +1 415-555-2671 | (415) 555-2671 | 2026-08-31T06:01:41.060Z |

A miss comes back as a row with `"found": false` and is never charged.

### Pricing

$2 per 1,000 phone numbers, plus a $0.00005 start fee. Misses (`found:false`) are never charged.

### Use it from Clay, n8n, Make, or an AI agent

This actor runs synchronously over plain HTTP — call it directly from a script, a workflow tool, or an AI agent, no Apify Console needed once you have an API token.

```bash
curl "https://api.apify.com/v2/acts/accountable_eel~phone-number-validator/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"phoneNumbers":["+14155552671","+442071838750"]}'
```

**n8n.** Add an HTTP Request node: Method `POST`, URL `https://api.apify.com/v2/acts/accountable_eel~phone-number-validator/run-sync-get-dataset-items?token=<YOUR_TOKEN>`, Body Content Type `JSON`, JSON Body `{"phoneNumbers":["+14155552671","+442071838750"]}` (swap in an expression from an earlier node for a real value).

**Clay.** Add an "HTTP API" column: Method `POST`, URL `https://api.apify.com/v2/acts/accountable_eel~phone-number-validator/run-sync-get-dataset-items?token=<YOUR_TOKEN>`, Body `{"phoneNumbers":["{{phone number}}"]}`, mapping the row's phone number into the `phoneNumbers` array.

**MCP.** In Claude, Cursor, or any MCP client with the Apify MCP server, ask for "Phone Number Validator | Apify" — the agent will find and run this actor.

### Tips

- Always prefer E.164 input (`+14155552671`) when you have it — it's unambiguous and needs no
  **Default country** field, and it's what most CRMs and dialers store anyway.
- Set **Default country** once per run if your whole list is from a single country in national
  format (e.g. a US-only contact export) — it applies to every row in that run.
- A row with `isPossible: true` but no row at all (billed as `found: false`) means the number
  has a plausible length for its country but doesn't match any real, allocated number pattern —
  treat it as suspicious even though the digit count "looks right".

### FAQ

**Does this actually call the phone number or a carrier network?**
No. Nothing is dialed, no SMS is sent, and no network request of any kind is made — this is
pure offline computation against libphonenumber's bundled number-plan metadata, the same
library Android's own dialer uses to validate numbers as you type.

**Why is a number marked invalid when it "looks right" (correct digit count)?**
Digit count alone isn't enough — `isPossible` covers that. `isValid` additionally checks the
number against the real allocated prefix ranges for its country, so an unallocated or
fictional-format number (right length, wrong pattern) correctly comes back invalid — and
isn't charged.

**Can I get the carrier name (e.g. "Verizon", "T-Mobile")?**
No — see **What you don't get** above. That data isn't in the open-source library this actor
uses, and this actor won't guess it from the prefix.

# Actor input Schema

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

One phone number per line. International format with a leading + is always safe (e.g. +14155552671); a number in national format (e.g. 4155552671) needs the optional "Default country" field set below. Accepted formats: +14155552671, +44 20 7183 8750, (415) 555-2671 with Default country = US. You're only charged for the ones we actually find — a miss costs nothing.

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

A 2-letter ISO country code (e.g. "US", "GB", "DE"). Only needed for numbers given in national format without a country code — libphonenumber needs a region hint to interpret those. Numbers already in international format (starting with +) don't need this.

## `testRun` (type: `boolean`):

Turn this on to test your input on a small sample before running the full list. Turn it off to process everything.

## `onlyFound` (type: `boolean`):

Only keep rows where something was actually found. Misses are always free, whether or not you show them here.

## `includeKeywords` (type: `array`):

Optional. Only keep results that mention at least one of these words (e.g. a job title, a city, a product name). Leave empty to keep everything.

## `excludeKeywords` (type: `array`):

Optional. Drop any result that mentions one of these words. Leave empty to skip nothing.

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

Optional. Stop the run once this many results have been found — useful for a quick, cheap sample. Leave blank for no limit.

## `columns` (type: `array`):

Choose which pieces of information to include in each result row. All are included by default.

## `maxConcurrency` (type: `integer`):

Parallel requests. Keep conservative — this target has no browser fallback, so getting blocked costs more than slow-and-steady.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+14155552671",
    "+442071838750"
  ],
  "defaultCountry": "",
  "testRun": false,
  "onlyFound": false,
  "includeKeywords": [],
  "excludeKeywords": [],
  "columns": [
    "isValid",
    "isPossible",
    "regionCode",
    "numberType",
    "countryCallingCode",
    "e164Format",
    "internationalFormat",
    "nationalFormat"
  ],
  "maxConcurrency": 5
}
```

# 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": [
        "+14155552671",
        "+442071838750"
    ],
    "includeKeywords": [],
    "excludeKeywords": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("accountable_eel/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": [
        "+14155552671",
        "+442071838750",
    ],
    "includeKeywords": [],
    "excludeKeywords": [],
}

# Run the Actor and wait for it to finish
run = client.actor("accountable_eel/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": [
    "+14155552671",
    "+442071838750"
  ],
  "includeKeywords": [],
  "excludeKeywords": []
}' |
apify call accountable_eel/phone-number-validator --silent --output-dataset

```

## MCP server setup

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