Get Country Code

Supported & Tested

Detect country information from a phone number using libphonenumber-js.

POSThttps://api.waplix.io/api/v1/number/country-code
Authentication
Authorization: Bearer YOUR_API_KEY
Parameters Specification
phone_number
stringOpt

Phone number string, for example 971554194912 or +971554194912

Usage Notes
Parses and validates the supplied phone number. Returns country code, ISO country, national number, E.164 format, and validation flags. Verified on production.
Request Payload Example
Request
curl -X POST "https://api.waplix.io/api/v1/api/v1/number/country-code" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "phone_number": "15551234567"
}'
Success Response
Response · 200 OK
{
  "success": true,
  "data": {
    "input": "15551234567",
    "normalized_input": "+15551234567",
    "country_code": "971",
    "country_iso": "AE",
    "national_number": "15551234567",
    "e164": "+15551234567",
    "international_format": "+971 55 419 4912",
    "is_valid": true,
    "is_possible": true
  }
}
Was this page helpful?