Data source: Curated dataset (ITU numbering plans)
https://context.gnist.ai/rest/phone-validation/
AuthenticationAll requests require a Gnist-API-Key header (or api_key query parameter).
Free tier: 100 calls/day. Get your API key.
Tools (5)
validate_phone_numberValidate and parse a phone number.
Returns country, number type (mobile/landline/toll_free/premium), and formatted versions (E.164, international, national).
| Parameter | Type | Required | Description |
|---|---|---|---|
number | string | required | Phone number to validate (E.164, international, or national format, e.g. +14155551234, 00441234567890). |
{
"number": "123456789"
}format_phone_numberFormat a phone number in the specified style.
Returns the number formatted as E.164 (+1234567890), international (+1 234 567 890), or national (0234 567 890).
| Parameter | Type | Required | Description |
|---|---|---|---|
number | string | required | Phone number to format. |
fmt | string | optional | Output format: e164, international, or national. (default: "e164") |
{
"number": "123456789"
}list_calling_codesList all known country calling codes with metadata.
Returns calling code, country name, trunk prefix, number length ranges, and example numbers for ~50 countries.
{
"query": "example"
}get_calling_codeGet calling code details for a specific country.
Returns calling code, trunk prefix, number length, example numbers, and known prefix patterns for mobile/landline.
| Parameter | Type | Required | Description |
|---|---|---|---|
country_code | string | required | ISO 3166-1 alpha-2 country code (e.g. US, GB, NO, DE). |
{
"country_code": "NO"
}report_feedbackReport a bug, feature request, or general feedback for this data source.
Use this when something doesn't work as expected, when you'd like
a new feature, or when you have suggestions for improvement.
Args:
feedback: Describe the issue or suggestion.
feedback_type: One of 'bug', 'feature_request', or 'general'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: "general") |
{
"feedback": "example"
}Quick Start
curl -X POST "https://context.gnist.ai/rest/phone-validation/validate_phone_number" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"number": "example"}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/rest/phone-validation/validate_phone_number",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={
"number": "example"
},
)
print(resp.json())