An example number for a country and type

Returns an example number for a country and line type — handy for input placeholders.

Request

GEThttps://phone-number-validator.p.apihiver.com/v1/example?country=IN
*
String. ISO country code, e.g. IN.
String. mobile, fixed_line, toll_free, premium_rate, voip… (default mobile).
Language
Client
1curl --request GET \
2  --url 'https://phone-number-validator.p.apihiver.com/v1/example?country=IN&type=%7Btype%7D' \
3  --header 'Accept: application/json' \
4  --header 'X-API-Key: YOUR_API_KEY'

An example number for a country and type: Phone Number Validation API reference

Returns an example number for a country and line type — handy for input placeholders. 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  "type": "mobile",
3  "input": "+918123456789",
4  "valid": true,
5  "carrier": "Tata Docomo",
6  "formats": {
7    "e164": "+918123456789",
8    "rfc3966": "tel:+91-81234-56789",
9    "national": "081234 56789",
10    "international": "+91 81234 56789"
11  },
12  "location": "India",
13  "possible": true,
14  "timezones": [
15    "Asia/Calcutta"
16  ],
17  "calling_code": "+91",
18  "country_code": "IN",
19  "national_number": "8123456789"
20}

Errors

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

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