Skip to main content
GET
Phone Validation API
It’s very simple to use: submit your API key and a phone number. The API returns whether the number is structurally valid and, when valid, normalized E.164 formats plus optional details such as line type, location hints, carrier data, timezones, and dialability where available.
valid: true means the number matches regional format rules (length, prefix, syntax). It does not confirm the line is active, assigned to a subscriber, or reachable. For live line status you need carrier lookup, which is outside this API.

Getting started

REST

The Phone Number Validation API, like all Cleariflow APIs, is organized around REST. It is designed to use predictable, resource-oriented URLs and HTTP status codes to indicate errors.

HTTPS

The Phone Number Validation API requires all communications to be secured with TLS 1.2 or greater.

API Versions

All Cleariflow APIs are versioned. The Phone Number Validation API is currently on Version 1.

Your API Key

Your API key is your unique authentication key for the Cleariflow Phone Number Validation API. Note that each Cleariflow API has a unique API key, so you will need different keys to access the Phone Number Validation and Email Validation APIs, for example. To authenticate your requests, append your API key to the base URL.

Base URL

What valid means

Fictional US 555 numbers and other structurally valid but unassigned ranges may still return valid: true. carrier and location are populated mainly for US/CA numbers and are often empty elsewhere.

Validation endpoint

The API requires your unique API key and the phone number to check:
Valid response (phone=14155552671, country=US):
Invalid response (phone=123, country=US):

Request parameters

String
required
Your unique API key. Note that each user has unique API keys for each of Cleariflow APIs, so your Phone Validation API key will not work for your IP Geolocation API, for example.
String
required
The phone number to validate.
String
Optional ISO 3166-1 alpha-2 hint for national-format numbers without a leading +. For example, country=US helps parse 4155552671. Numbers with an international prefix are parsed from their country code; the detected country.code in the response may differ from this hint (e.g. GG for some +44 mobile ranges).

Response parameters

The API response is returned in a universal and lightweight JSON format.
String
Normalized E.164 digits (without +) when valid is true. When valid is false, digits from your input only.
Boolean
true when the number is structurally valid. This is not line-status or subscriber verification.
Boolean
Lenient length check. true when the digits and length could belong to a real number, even if valid is false.
String
Present when valid is false. One of: not_a_number, possible, possible_local_only, invalid_country_code, too_short, invalid_length, too_long, unknown. Omitted when valid is true.
Object
international and local formats. Empty strings when valid is false.
String
E.164 format with a leading +. Empty when valid is false.
String
National format for the detected region. Empty when valid is false.
Object
Detected country/territory. Empty fields when valid is false.
String
Two-letter ISO 3166-1 alpha-2 code for the detected region.
String
English display name for country.code.
String
International calling code prefix (e.g. +1).
String
Location hint (region, state/province, or city). Often empty outside US/CA. Empty when valid is false.
String
Line type when valid is true: Landline, Mobile, Landline_or_Mobile, Toll_Free, Premium, Paging, Special, or Unknown. Always Unknown when valid is false.
String
Carrier name when available (most often US/CA). Empty string otherwise, including when valid is false.
String
Safe carrier name for end-user display (when valid and the region does not use mobile number portability). Empty when valid is false or the carrier cannot be shown safely.
Array
Timezone identifiers for the number (e.g. America/New_York). Empty array when valid is true but no mapping exists; null when valid is false.
Boolean
Whether the number is associated with a geographic region. Always false when valid is false.
Boolean
Whether the number can be dialed from outside its home region. Always false when valid is false.

Bulk upload (CSV)

Here are some best practices when bulk uploading a CSV file:
  • Ensure the first column contains the phone numbers to be analyzed.
  • Remove any empty rows from the file.
  • Include only one phone number per row.
  • The maximum file size permitted is 50,000 rows.

Response and error codes

Whenever you make a request that fails for some reason, an error is returned also in the JSON format. The errors include an error code and description, which you can find in detail below.

Other notes

A note on metered billing: Each individual phone number you submit counts as a credit used. Credits are also counted per request, not per successful response. So if you submit a request for the (invalid) phone number “kasj8929hs”, that still counts as 1 credit.