apyhub
Back
▣ DATA VALIDATION · DEVELOPER TOOLS

Phone Number Formatter API

What it does

Phone Number Formatter parses a phone number and returns it in common formats you can store, display, or validate against. Send a number and optionally a country code, and get back the parsed result with e164, international, national, valid, region, country_code, and the original input.

Use it when you need to normalise user-entered numbers before saving them to a database, comparing them across systems, or preparing them for SMS and calling workflows. The country parameter defaults to US, which helps when the input is missing an explicit international prefix and you still need a consistent parse.

The response is straightforward: valid tells you whether the number can be interpreted, while the format fields give you the canonical versions for downstream systems. e164 is useful for transport and storage, national is better for local presentation, and international gives you a human-readable cross-border format.

Phone Number Formatter fits into signup forms, contact import tools, CRM pipelines, and any workflow where phone numbers arrive in different shapes and need to be standardised before use.

GET
Parse and format a phone number into E.164, international, and national formats
https://api.eu.apyhub.com/dosvak/phone-number-format

QUICKSTART

GUIDE

Quickstart

Look up the formatting details for a phone number by sending the required number query parameter.

curl -X GET "https://api.eu.apyhub.com/dosvak/phone-number-format?number=+12025550123" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with these top-level fields: e164 (string), input (string), valid (boolean), region (string), national (string), country_code (integer), and international (string).

{
  "e164": "+12025550123",
  "input": "202-555-0123",
  "valid": true,
  "region": "Washington, D.C.",
  "national": "(202) 555-0123",
  "country_code": 1,
  "international": "+1 202-555-0123"
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Parses a phone number and returns its formatted representations, including E.164, international, and national formats. It also indicates whether the number is valid and may include region and country code details.

Query Parameter(s)

AttributeTypeDescription
numberStringThe phone number to parse.
countryStringDefault: US. The country to use for parsing.

Response

Returns a JSON object with e164, input, valid, region, national, country_code, and international fields. The response includes formatted phone number strings, a boolean validity flag, and optional region and country code information.

AttributeTypeDescription
e164StringThe phone number in E.164 format.
inputStringThe input phone number as parsed by the service.
validBooleanWhether the phone number is valid.
regionStringThe detected region for the phone number.
nationalStringThe phone number in national format.
country_codeIntegerThe country calling code.
internationalStringThe phone number in international format.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.