Phone Number Validator API

Validate and format phone numbers for 240+ countries: E.164, international and national formats, country, calling code and line type (mobile, fixed line…).

GETPOSThttps://apibox.io.vn/v1/phone
Network & Validation▶ Try it online

The Phone API parses a phone number written in any common way – with spaces, dashes, brackets, a leading 0 or a +country code – and tells you whether it is valid and possible for its country. It returns the detected country and name, the calling code, the national number and the number in four formats: E.164 (+84912345678), international, national and an RFC 3966 tel: URI.

It also detects the line type when the numbering plan allows it: MOBILE, FIXED_LINE, FIXED_LINE_OR_MOBILE, TOLL_FREE, PREMIUM_RATE, VOIP, SHARED_COST, PERSONAL_NUMBER, PAGER, UAN or VOICEMAIL. Validation uses the full metadata of Google’s libphonenumber (via libphonenumber-js), covering more than 240 countries and territories.

For numbers without a +country prefix, pass the ISO country code in country (e.g. VN, US); otherwise the caller’s country detected by Cloudflare is used, falling back to US. Unparseable input returns valid: false with a reason instead of an HTTP error.

Parameters

NameInTypeRequiredDefault
numberbody|querystringyesPhone number in any common format (max 64 characters).
countrybody|querystringnoISO 3166 country code for numbers without +prefix. Default: caller’s country, else US.

Example

curl -X POST "https://apibox.io.vn/v1/phone" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"number":"0912 345 678","country":"VN"}'

Response

{
  "input": "0912 345 678",
  "valid": true,
  "possible": true,
  "type": "MOBILE",
  "country_code": "VN",
  "country": "Vietnam",
  "calling_code": "+84",
  "national_number": "912345678",
  "formats": {
    "e164": "+84912345678",
    "international": "+84 912 345 678",
    "national": "0912 345 678",
    "rfc3966": "tel:+84912345678"
  }
}

Use cases

  • Normalise phone numbers to E.164 before storing them or sending SMS
  • Reject invalid or landline numbers in OTP sign-up flows
  • Clean up phone columns in CRM imports
  • Display numbers in the familiar national format for each country

FAQ

How do I validate a Vietnamese phone number?

POST {"number": "0912 345 678", "country": "VN"}. You get valid: true, type MOBILE and the E.164 form +84912345678. Numbers starting with +84 do not need the country parameter.

What is E.164 and why should I store numbers in it?

E.164 is the international format "+" + country code + number without spaces (e.g. +14155552671). It is unique, unambiguous and what SMS and voice providers like Twilio expect.

Does "valid" mean the number is in service?

No. It means the number matches the official numbering plan of its country. Whether it is currently assigned or reachable can only be confirmed by calling or sending an OTP.

Related APIs

Start with 1,000 free requests every month. Get free API key →