# Phone Number Validator: E.164 Format, Country & Line Type (`publicrecords/phone-number-validator`) Actor

Validate and format phone numbers in bulk: valid or possible, E.164, national format, country, calling code and line type from the numbering plan. Not a live carrier or WhatsApp lookup.

- **URL**: https://apify.com/publicrecords/phone-number-validator.md
- **Developed by:** [Public Records](https://apify.com/publicrecords) (community)
- **Categories:** Developer tools, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 phone number parseds

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/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: E.164 Format, Country & Line Type

Validate and format phone numbers in bulk: valid or possible, E.164 and national forms, country, calling code and line type from the numbering plan. Phone checks are syntax and numbering-plan only — this is not a live carrier, TCPA or WhatsApp registration lookup. No outside AI API.

Who it is for: teams that need to parse and validate phone numbers on a lead list without a live carrier or messaging-network check.

The Actor can also generate an invoice or receipt PDF, or render a 1D/2D barcode as SVG. Those modes are documented in the sections below.

### Phone validator: format, country and E.164

In `phone_validate` mode, paste a number or a list in `phones` and an optional default country. Each row tells you whether the number is valid and possible, its E.164 and national forms, country, calling code and line type. `phone_extract` finds numbers in a block of text. This does not query a carrier or a messaging network.

### Invoice PDF and receipt PDF

In `invoice_pdf` or `receipt_pdf` mode, send seller, buyer and line items and get a PDF (as base64) plus totals. You can add an optional crypto payment block (EVM, Bitcoin or Solana address) that prints a payment URI and QR on the PDF. An invoice example is included below.

After you generate an invoice or receipt PDF, you can convert it to Markdown with [PDF to Text & Markdown Extractor](https://apify.com/publicrecords/pdf-docx-to-markdown).

### Barcode generator

In `barcode_svg` mode, render Code 128, EAN-13 and other common symbologies as SVG. Barcode text can also be sent as `data` and the type as `bcid`; send `parse: true` to read `^NNN` character escapes (GS1 types read `^FNC1` by default; send `parse: false` to turn that off). In `pay_uri` mode, or in the invoice crypto block, a `uri` sent with the `address` is used as-is instead of building one. For QR codes with scan-back, see QR Code Generator and Scanner on the same account once it is listed.

### Default input

```json
{
  "mode": "phone_validate",
  "phones": [
    "+1 650-253-0000",
    "+44 20 7946 0958",
    "+61 2 5550 1234",
    "not-a-number"
  ]
}
```

### Sample output

A real Apify run of the prefilled phones list on 2026-11-25 returned four rows. The first three were valid US, GB and AU numbers; the fourth is the invalid example and is still charged. The first row was:

```json
{
  "input": "+1 650-253-0000",
  "valid": true,
  "possible": true,
  "e164": "+16502530000",
  "country": "US",
  "calling_code": "+1",
  "national_number": "6502530000",
  "type": "fixed_line_or_mobile",
  "international": "+1 650 253 0000",
  "national": "(650) 253-0000",
  "rfc3966": "tel:+16502530000",
  "extension": null,
  "non_geographic": false
}
```

The other valid rows were e164 +442079460958 (GB, fixed_line) and +61255501234 (AU, fixed_line). The invalid row was:

```json
{
  "input": "not-a-number",
  "valid": false,
  "possible": false,
  "error": "not a phone number (send country, e.g. \"US\", for national-format numbers)"
}
```

This sample is from Apify run bmqaUYWbitwcfHGZN (build 0.1.6, 2026-11-25, America/Toronto).

### Invoice example

```json
{
  "mode": "invoice_pdf",
  "number": "INV-1042",
  "date": "2026-11-24",
  "due_date": "2026-12-08",
  "currency": "USD",
  "seller": {
    "name": "Acme Labs",
    "email": "billing@acme.example"
  },
  "buyer": {
    "name": "Client Co"
  },
  "items": [
    {
      "description": "Design review",
      "quantity": 1,
      "unit_price": 250
    },
    {
      "description": "Revisions",
      "quantity": 3,
      "unit_price": 40
    }
  ],
  "tax_rate": 13
}
```

A real Apify run of this invoice input on 2026-11-25 returned one row:

```json
{
  "filename": "invoice-INV-1042.pdf",
  "pages": 1,
  "totals": {
    "subtotal": 370,
    "discount": 0,
    "tax": 48.1,
    "shipping": 0,
    "total": 418.1,
    "amount_paid": 0,
    "balance_due": 418.1,
    "currency": "USD"
  },
  "pay_uri": null,
  "bytes": 1915,
  "pdf_base64": "(PDF bytes, 2,552 characters of base64)"
}
```

This invoice sample is from Apify run 59int9Nqql0nLM0hJ (build 0.1.6, 2026-11-25, America/Toronto).

### Pricing

Pay per event: one start fee per run, then a charge only for successful rows written to your dataset.

| Event | Price |
|---|---|
| Actor start (per GB of memory; default 256 MB = 1 start event, $0.001) | $0.001 |
| Invoice or receipt PDF | $0.01 |
| Phone number parsed (one dataset row) | $0.001 |
| Barcode SVG | $0.002 |
| Payment URI | $0.001 |

Examples: the prefilled phones list costs $0.005 ($0.001 start + $0.001 for each of the four numbers, including the invalid one). The invoice example costs $0.011 ($0.001 start + $0.01 for the PDF). A missing phone (run vZgws9bVRDWTwkuTs) returned 0 rows and was charged the start fee only.

Skipped inputs add no charge; the start fee still applies once per run. A run that returns 0 rows (for example an invoice with no line items, or a missing phone) is not charged per document, number or barcode. An invalid number still returns a row with valid: false and is charged $0.001.

### Limits

- Phone checks are numbering-plan validation only. They do not tell you if a number is in service, ported, or registered on WhatsApp.
- Invoice and receipt PDFs are generated on the Actor. There is no network source, so there is no source-outage event.
- Barcode types are those supported by bwip-js (for example code128, ean13). Invalid or empty payloads are skipped with a reason.
- Up to 200 line items per invoice; barcode text up to 2,000 characters; one number per phone in `phones`.
- Skipped inputs add no charge; the start fee still applies.

### What each field means

- Phone rows: `input`, `valid`, `possible`, `e164`, `country`, `calling_code`, `national_number`, `type`, `international`, `national`, `rfc3966`, `extension`, `non_geographic` (and `error` when the number cannot be parsed)
- Invoice or receipt rows: `filename`, `pages`, `totals`, `pay_uri`, `bytes`, `pdf_base64`
- Barcode rows: `format`, `symbology`, `text`, `svg`

### FAQ

**Is this a live phone validator like a carrier or WhatsApp check?**

No. It parses format, country and E.164 from the numbering plan. It does not query a carrier, a DNC list, or a messaging network.

**What if I leave the line items empty?**

The run succeeds with 0 rows and a reason. You are not charged for a document. The start fee still applies.

**Can I only validate phones, without making a PDF?**

Yes. Set mode to phone_validate or phone_extract.

**What if I send a field name this Actor does not use?** If none of the fields you send is one listed under Input, the run ends as SUCCEEDED with 0 rows and the status message names the unknown field; only the start fee is charged. An empty input runs the example input shown under Input. Common alternative names are read as the documented field, for example `numbers` as `phones` and `item` as `items`.

**Can I call it from code or an AI agent?** Yes. Call it through the Apify API with your Apify token, or add it to an agent through Apify's MCP server (mcp.apify.com), and read the dataset rows.

### Licences

libphonenumber-js (MIT), pdf-lib (MIT), bwip-js (MIT), qrcode-generator (MIT), Apify SDK (Apache-2.0).

# Actor input Schema

## `mode` (type: `string`):

Phone validator (format and region), extract numbers from text, invoice or receipt PDF, barcode SVG, or a payment URI.

## `phone` (type: `string`):

For phone_validate. International or national format.

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

For phone_validate. One dataset row and $0.001 per number, up to 200. An invalid number still returns a row with valid: false and is charged.

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

For phone_extract (find numbers in text) or barcode payload.

## `country` (type: `string`):

ISO country for national-format phone numbers, for example US.

## `number` (type: `string`):

Invoice or receipt number.

## `date` (type: `string`):

Invoice or receipt date, YYYY-MM-DD.

## `due_date` (type: `string`):

Payment due date, YYYY-MM-DD.

## `currency` (type: `string`):

ISO currency code, for example USD.

## `seller` (type: `object`):

Seller block, for example name, address, email, phone, tax_id.

## `buyer` (type: `object`):

Buyer block, for example name, address, email, tax_id.

## `items` (type: `array`):

Array of description, quantity, unit_price, and optional tax_rate.

## `tax_rate` (type: `number`):

Percent, applied to items without their own tax_rate.

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

For barcode_svg, for example code128 or ean13.

## `crypto` (type: `object`):

Optional network, token, address and amount for a payment URI or QR on the PDF.

## Actor input object example

```json
{
  "mode": "phone_validate",
  "phones": [
    "+1 650-253-0000",
    "+44 20 7946 0958",
    "+61 2 5550 1234",
    "not-a-number"
  ],
  "country": "US"
}
```

# Actor output Schema

## `rows` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `phones` (type: `string`):

No description

## `documents` (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 = {
    "mode": "phone_validate",
    "phones": [
        "+1 650-253-0000",
        "+44 20 7946 0958",
        "+61 2 5550 1234",
        "not-a-number"
    ],
    "country": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicrecords/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 = {
    "mode": "phone_validate",
    "phones": [
        "+1 650-253-0000",
        "+44 20 7946 0958",
        "+61 2 5550 1234",
        "not-a-number",
    ],
    "country": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("publicrecords/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 '{
  "mode": "phone_validate",
  "phones": [
    "+1 650-253-0000",
    "+44 20 7946 0958",
    "+61 2 5550 1234",
    "not-a-number"
  ],
  "country": "US"
}' |
apify call publicrecords/phone-number-validator --silent --output-dataset

```

## MCP server setup

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