# Phone Number Validator & Formatter (`nordic-data/phone-number-validator`) Actor

Validate and format phone numbers in bulk for 240+ countries: E.164, international and national format, mobile or landline, country, region, time zone and original carrier. Offline, fast, private. $0.0009 per number.

- **URL**: https://apify.com/nordic-data/phone-number-validator.md
- **Developed by:** [Niklas Bergström](https://apify.com/nordic-data) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.90 / 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.

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

Clean up phone number lists in bulk. Paste numbers in **any format from any country** and get back whether each one is valid (and why not), the **E.164**, international, national and `tel:` formats, the country, **mobile vs landline** (toll-free, VoIP, premium …), the region or city, time zones and the original carrier.

Validation runs **offline** on Google's open-source libphonenumber metadata: no numbers are sent to third parties, nothing is dialled or texted, and a million numbers take minutes.

**$0.0009 per number validated.** Text that is not a phone number at all, duplicates and (with *Only output valid numbers*) invalid numbers are free.

### What you get

| Field | Meaning |
|---|---|
| `isValid`, `isPossible`, `reason` | `valid`, `too-short`, `too-long`, `invalid-length`, `invalid-country-code`, `invalid-for-region`, `not-a-number` |
| `e164`, `international`, `national`, `rfc3966` | Ready-to-store formats, e.g. `+46701234567`, `+46 70 123 45 67`, `070-123 45 67`, `tel:+46-70-123-45-67` |
| `countryCode`, `country`, `nationalNumber`, `extension` | Parsed parts |
| `type` | `mobile`, `fixed-line`, `fixed-line-or-mobile`, `toll-free`, `premium-rate`, `voip`, `shared-cost`, `personal`, `uan` … |
| `location`, `timeZones` | Region or city and IANA time zones |
| `carrier` | Original carrier for mobile ranges (numbers may have been ported since) |
| `waMeLink` | wa.me click-to-chat link for mobile numbers (does not check whether the number uses WhatsApp) |

### Use cases

- **CRM and lead-list hygiene:** normalise numbers to E.164 before importing into HubSpot, Salesforce or a dialer.
- **SMS campaigns:** keep only valid mobile numbers and drop landlines and premium-rate numbers.
- **Call-time planning:** use time zones to call leads in their business hours.
- **Form and signup validation** in batch jobs or automations.

### Input example

```json
{
  "phoneNumbers": ["+46 70 123 45 67", "08-123 456 78", "+1 650-253-0000", "0044 20 7946 0958"],
  "defaultCountry": "SE",
  "language": "en",
  "onlyValid": false
}
```

`defaultCountry` is used for numbers written without a `+` country code.

### Output example

```json
{
  "recordType": "number",
  "input": "08-123 456 78",
  "isValid": true,
  "reason": "valid",
  "e164": "+46812345678",
  "international": "+46 8 123 456 78",
  "national": "08-123 456 78",
  "country": "SE",
  "type": "fixed-line",
  "location": "Stockholm",
  "timeZones": ["Europe/Stockholm"],
  "carrier": null
}
```

### Notes

Validity means the number matches the numbering plan of its country (length, prefix, ranges). It does not prove the line is currently connected. Carrier names come from the original number-range allocation.

### Related Actors

- [Website Contact Details Extractor](https://apify.com/nordic-data/website-contact-details-extractor): collect phones and emails from company websites, then validate them here.
- [Nordic Company Registry](https://apify.com/nordic-data/nordic-company-registry)

# Changelog

This Actor's version history is a separate document: https://apify.com/nordic-data/phone-number-validator/changelog.md

# Actor input Schema

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

Numbers in any format: +46 70 123 45 67, 070-123 45 67, (650) 253-0000, 0044 20 7946 0958 … Up to 1,000,000 per run. Duplicates are skipped and never charged.

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

Two-letter country used for numbers written without a + country code, e.g. SE, NO, DK, FI, DE, GB, US.

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

e.g. en, sv, de, fr.

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

Hide invalid numbers. Hidden numbers are not charged.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+46 70 123 45 67",
    "08-123 456 78",
    "+1 650-253-0000",
    "+44 20 7946 0958"
  ],
  "defaultCountry": "SE",
  "language": "en",
  "onlyValid": false
}
```

# Actor output Schema

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

Main results (view: Overview).

## `runStats` (type: `string`):

Counts of delivered, hidden, invalid, duplicate and failed inputs.

# 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": [
        "+46 70 123 45 67",
        "08-123 456 78",
        "+1 650-253-0000",
        "+44 20 7946 0958"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nordic-data/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": [
        "+46 70 123 45 67",
        "08-123 456 78",
        "+1 650-253-0000",
        "+44 20 7946 0958",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("nordic-data/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": [
    "+46 70 123 45 67",
    "08-123 456 78",
    "+1 650-253-0000",
    "+44 20 7946 0958"
  ]
}' |
apify call nordic-data/phone-number-validator --silent --output-dataset

```

## MCP server setup

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