SoonOne MCP server, all 49 APIs as agent tools. See how it works

Validate, normalize, and format any phone number on Earth

Phone Number Validation & Formatting API

The Phone Number Validation & Formatting API turns messy, user-entered phone numbers into clean, trustworthy data. Send a raw string like (415) 555-2671 or +44 20 7183 8750 and receive a fully parsed result with validity flags, canonical E.164 form, national and international display formats, the RFC3966 tel: URI, detected country, and the line type.

Powered by Google's libphonenumber metadata, its numbering-plan coverage matches what major platforms use in production. Built for forms, signups, CRM hygiene, fraud screening, and SMS/voice routing, it runs stateless on a global edge network for low latency everywhere.

Free tier included, no credit card required. One key works across all 49 APIs.

At a glance
Countries
240+
Parse Speed
<50ms
Uptime SLA
99.9%

Key features

  • Validate and format any phone number worldwide
  • Canonical E.164, national, international, and RFC3966 formats
  • Line-type detection (mobile vs fixed-line)
  • Country and calling-code detection from ISO2 hints
  • Independent valid and possible flags for flexible strictness
  • Both GET (query params) and POST (JSON body) supported
  • Powered by Google libphonenumber metadata

Built for

  • Form and signup phone number validation
  • CRM data hygiene and normalization
  • Fraud screening and suspicious signup flagging
  • SMS vs voice routing decisions
  • Mobile vs fixed-line detection
  • Standardizing numbers to E.164 for storage
  • International contact data cleanup
  • Click-to-call link generation via tel: URIs

Try it

Build the request for your data

Edit the parameters below and see the exact curl command and JSON response you will get. No key required to preview.

GET/phone/v1/validate
Open in Playground

Parameters

Request · HTTP
GET /phone/v1/validate?number=%28415%29+555-2671&country=US&apikey=YOUR_KEY HTTP/1.1
Host: api.apicodex.io
Response · JSON
200 OK
{
"input": "(415) 555-2671",
"valid": true,
"possible": true,
"e164": "+14155552671",
"national": "(415) 555-2671",
"international": "+1 415 555 2671",
"rfc3966": "tel:+14155552671",
"uri": "tel:+14155552671",
"country": "US",
"country_calling_code": "1",
"type": "FIXED_LINE_OR_MOBILE",
"is_mobile": false,
"is_fixed_line": false
}

Documentation

Phone Number Validation API Documentation

The Phone Number Validation & Formatting API parses, validates, and formats phone numbers worldwide using Google's libphonenumber metadata with line-type detection. Pass a number alone if it is already in international +E.164 form, or add a country hint (e.g. US, GB, TR) to parse local-format numbers. Both GET (query params) and POST (JSON body) requests are supported.

Base URL

url
https://api.apicodex.io

Authentication

Authenticate every request with your API key: pass it as a query parameter, or send it in an X-Api-Key header.

headers
?apikey=YOUR_KEY

# Or send it as a header:
{
"X-Api-Key": "YOUR_API_KEY"
}

Request and response

Illustrative values. Confirm current endpoint behavior, quotas, and data freshness in the API documentation before production use.

request · http
GET /phone/v1/validate?number=(415)%20555-2671&country=US&apikey=YOUR_KEY HTTP/1.1
response · json
{
"input": "(415) 555-2671",
"valid": true,
"possible": true,
"e164": "+14155552671",
"national": "(415) 555-2671",
"international": "+1 415 555 2671",
"rfc3966": "tel:+14155552671",
"uri": "tel:+14155552671",
"country": "US",
"country_calling_code": "1",
"type": "FIXED_LINE_OR_MOBILE",
"is_mobile": false,
"is_fixed_line": false
}

Code examples

cURL
curl --request GET \
  --url 'https://api.apicodex.io/phone/v1/validate?number=(415)%20555-2671&country=US&apikey=YOUR_KEY'

Endpoints

GET /phone/v1/validate

Validate and format a phone number using query parameters.

/phone/v1/validate?number=(415)%20555-2671&country=US&apikey=YOUR_KEY

POST /phone/v1/validate

Validate and format a phone number using a JSON request body.

{ "number": "+442071838750", "country": "GB" }

GET /phone/health

Health check endpoint that returns service status.

/phone/health?apikey=YOUR_KEY

Parameters

Required parameters

  • number The phone number to validate. May be E.164 (e.g. +14155552671) or a local format (e.g. (415) 555-2671) when a country is supplied.

Optional parameters

  • country Optional ISO 3166-1 alpha-2 region used as the default country when the number is not in +E.164 form (e.g. US, GB, TR).
  • apikey Your API key, passed as a query parameter for authentication when calling the Worker directly.

Pricing

Phone Number Validation API Pricing

One key, one subscription, all 49 APIs. Start free and upgrade when you grow. No minimums, no lock-in.

This API costs 5 credits per request. Credits are shared across every API on your plan.

Estimate your monthly cost

Drag the slider to match your expected request volume. We will recommend the cheapest plan that covers it.

10,000

Recommended plan

Starter

$29.99 /month

Credits used50,000
Credits included50,000
Cost per 1K requests$2.999
Choose Starter

Free

Free
1,000 credits · ~200 requests/mo · 2 rps
  • All 49 APIs included
  • No credit card required
  • Full documentation and examples
Start for free

Starter

Popular
$29.99/month
50,000 credits · ~10,000 requests/mo · 10 rps
  • All 49 APIs included
  • Email support
  • Usage dashboard and analytics
Start with Starter

Pro

$99.99/month
250,000 credits · ~50,000 requests/mo · 25 rps
  • All 49 APIs included
  • Priority support
  • Up to 5 API keys
Start with Pro

Need a different plan?

Tell us about your API, volume, or support requirements.

Contact us

Coming soon · MCP

Use the Phone Number Validation & Formatting API from your AI agent

The API Codex MCP server will expose this API, and the other 39, to Claude, Cursor and any MCP client as tools. Same key, same credits, one config entry.

About the MCP server

FAQ

Frequently asked questions

You can send numbers in international E.164 form (e.g. +14155552671), in which case the country is detected automatically, or in a local format (e.g. (415) 555-2671). For local formats, supply a country hint using the ISO 3166-1 alpha-2 code (US, GB, TR, etc.) so the parser knows which numbering plan to apply. Both GET requests with query parameters and POST requests with a JSON body are supported.

Genuinely unparseable input returns a clean negative result with HTTP 200: { "input": "not-a-number", "valid": false, "possible": false }. The API does not throw errors for bad numbers, so you can branch on the valid and possible flags directly. A 400 status is reserved strictly for a missing number parameter or a malformed JSON body.

The possible flag checks only that the number has a plausible length and shape for its region, while the valid flag confirms the number fully conforms to that region's numbering plan. These independent flags let you choose your strictness: accept possible numbers during fast onboarding to reduce friction, then enforce full validity before billing or messaging customers.

Yes. Every successful response includes a type field with the detected line type (such as MOBILE, FIXED_LINE, or FIXED_LINE_OR_MOBILE) plus convenience booleans is_mobile and is_fixed_line. This is ideal for deciding whether to send an SMS, place a voice call, or flag a suspicious signup. Note that for some numbering plans the type may be FIXED_LINE_OR_MOBILE when the plan does not distinguish between the two.

The API is powered by Google's libphonenumber metadata, so it covers over 240 countries and territories — the same numbering-plan data used in production by Android and many major platforms. Coverage includes full validation, formatting, and line-type detection for each supported region's numbering plan.

Pass your API key as a query parameter, ?apikey=YOUR_KEY, or send it in an X-Api-Key header. All plans share the same full feature set and global edge latency.

The API is stateless and runs on a global edge network, delivering typical parse-and-format response times under 50ms. Because validation is performed locally against bundled libphonenumber metadata rather than calling out to external carriers, there is no network round-trip to a third party, keeping latency consistently low for production form validation and high-volume batch processing alike.