Format

Format and validate phone numbers with international support

GET/v1/telco/format/{tn}

Parses, validates, and formats a phone number. Returns multiple format variations and carrier/location data for North American numbers.

Requires:telco:read

Path Parameters

tnstringrequired
Phone number to format and validate. Supports US and international numbers.
Format a US number
curl "https://api.do.dev/v1/telco/format/2125551234" \
-H "Authorization: Bearer YOUR_API_KEY"
Response200
{
"valid": true,
"possible": true,
"input": "+12125551234",
"countryCode": "1",
"countryCallingCode": "+1",
"country": "US",
"nationalNumber": "2125551234",
"isNonGeographic": false,
"type": "FIXED_LINE",
"formats": {
  "e164": "+12125551234",
  "international": "+1 212-555-1234",
  "national": "(212) 555-1234",
  "rfc3966": "tel:+1-212-555-1234"
},
"npa": "212",
"nxx": "555",
"nxxx": "1234",
"location": {
  "rateCenter": "NEW YORK",
  "state": "NY",
  "country": "US"
},
"carrier": {
  "ocn": "VZXX",
  "name": "Verizon Communications",
  "type": "ILEC"
}
}

International numbers are also supported but won't include NPA/NXX/carrier data:

Format an international number
curl "https://api.do.dev/v1/telco/format/+447911123456" \
-H "Authorization: Bearer YOUR_API_KEY"
Response200
{
"valid": true,
"possible": true,
"input": "+447911123456",
"countryCode": "44",
"country": "GB",
"type": "MOBILE",
"formats": {
  "e164": "+447911123456",
  "international": "+44 7911 123456",
  "national": "07911 123456"
}
}