Format a number for display (E.164, international, national, or as dialled from another country)

Formats a number in every standard way, and optionally how to dial it from another country.

Request

GEThttps://phone-number-validator.p.apihiver.com/v1/format?number=%2B919876543210
*
String. The phone number, e.g. +919876543210 or 9876543210 with country.
String. ISO country code, e.g. IN. Needed when the number has no + prefix.
String. Show how to dial it from this country, e.g. US.
Language
Client
1curl --request GET \
2  --url 'https://phone-number-validator.p.apihiver.com/v1/format?number=%2B919876543210&country=%7Bcountry%7D&dial_from=%7Bdial_from%7D' \
3  --header 'Accept: application/json' \
4  --header 'X-API-Key: YOUR_API_KEY'

Format a number for display (E.164, international, national, or as dialled from another country): Phone Number Validation API reference

Formats a number in every standard way, and optionally how to dial it from another country. This endpoint is part of the Phone Number Validation API: Validate and format phone numbers for 240+ countries: valid or not, mobile or landline, carrier, region, and E.164 format.

Example response (200, application/json)

Success.

1{
2  "e164": "+919876543210",
3  "national": "098765 43210",
4  "international": "+91 98765 43210"
5}

Errors

  • 400 — A required parameter is missing or a value has the wrong format.
    1{
    2  "error": {
    3    "code": "INVALID_INPUT",
    4    "message": "number: Field required"
    5  }
    6}

Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.