POST /v1/phone/validate · 1 credit (offline) or 5 credits (HLR=true)
Request
{
"phone": "+905321234567",
"country_hint": "TR",
"hlr": false
}
| Field | Type | Required | Description |
|---|---|---|---|
phone |
string | ✓ | Phone number (E.164 or local format) |
country_hint |
string | — | ISO 3166-1 alpha-2 hint for parsing local numbers |
hlr |
boolean | — | true = live HLR lookup (5 credits); default false |
Response
{
"input": "+905321234567",
"valid": true,
"e164": "+905321234567",
"country": "TR",
"line_type": "mobile",
"carrier": "Turkcell",
"hlr": null,
"score": 85,
"credits_used": 1
}
With HLR enabled:
{
"input": "+905321234567",
"valid": true,
"e164": "+905321234567",
"country": "TR",
"line_type": "mobile",
"carrier": "Turkcell",
"hlr": {
"status": "active",
"ported": false,
"roaming": false
},
"score": 95,
"credits_used": 5
}
| Field | Type | Description |
|---|---|---|
input |
string | Original input |
valid |
boolean | Number is valid and parseable |
e164 |
string | null | Normalized E.164 format |
country |
string | null | ISO 3166-1 alpha-2 country code |
line_type |
enum | mobile landline voip premium unknown |
carrier |
string | null | Carrier name |
hlr |
object | null | Live HLR result (null when hlr=false) |
hlr.status |
enum | active inactive unavailable |
hlr.ported |
boolean | null | Number has been ported |
hlr.roaming |
boolean | null | Subscriber is roaming |
score |
integer | 0–100 quality score |
credits_used |
integer | 1 (offline) or 5 (HLR) |
Example
curl -X POST https://api.checkharbor.com/v1/phone/validate \
-H "X-Api-Key: chk_live_..." \
-H "Content-Type: application/json" \
-d '{"phone": "+905321234567", "country_hint": "TR"}'
```
const result = await checkharbor.validatePhone("+905321234567", {
countryHint: "TR",
hlr: true,
});
console.log(result.hlr?.status); // "active"
```
result = client.validate_phone("+905321234567", country_hint="TR", hlr=True)
print(result["hlr"]["status"]) # "active"
```