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 · no credit card · billed on RapidAPI
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
Perfect 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
Phone Number Validation API Documentation
Everything you need to integrate — base URL, auth, and copy-paste examples.
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
https://edge-apis.e9736.workers.devAuthentication
Authenticate by passing your API key as a query parameter on every request. When calling via RapidAPI, use the standard RapidAPI headers instead.
?apikey=YOUR_KEY
# Via RapidAPI:
{
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
"X-RapidAPI-Host": "phone-validation-api.p.rapidapi.com"
}Request & response
GET /phone/v1/validate?number=(415)%20555-2671&country=US&apikey=YOUR_KEY HTTP/1.1{
"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 --request GET \
--url 'https://edge-apis.e9736.workers.dev/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_KEYPOST /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_KEYParameters
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.
Phone Number Validation API Pricing
Choose the right plan for your phone validation needs with flexible pricing options and no hidden fees
Basic
- Full validation & formatting
- Line-type detection
- Structured JSON responses
Pro
- Full validation & formatting
- Line-type detection
- Production forms & CRM cleanup
Ultra
- Full validation & formatting
- Line-type detection
- High-volume signup & fraud screening
Need higher volume or a custom SLA?
Talk to us about enterprise rates, dedicated support, and compliance docs.
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.
When calling the Worker directly, pass your API key as a query parameter: ?apikey=YOUR_KEY. When subscribing through RapidAPI, use the standard RapidAPI headers (X-RapidAPI-Key and X-RapidAPI-Host) and the gateway handles authentication for you. All tiers 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.
Related APIs & tools
Other services that pair well — all on the same key.
Email Intelligence API
Validate email addresses with disposable detection, risk assessment, and SMTP analysis for fraud screening.
Learn more→Email Deliverability API
Analyze SPF, DKIM, and DMARC records to optimize email domain configurations and improve deliverability.
Learn more→DNS Lookup API
Query DNS records with support for all record types and reverse lookups for network diagnostics and validation.
Learn more→Every week you build in-house is a week you don't ship product
2,500+ teams already made the switch. Start with a free tier today, or talk to us about your enterprise needs.
For developers
Free tier, no credit card. Integrate your first API in under 30 minutes.
Get API keys freeRead the docsFor teams and enterprise
Custom volumes, SLA guarantees, dedicated support, and compliance documentation.
Talk to salesor email sales@apicodex.io