Endpoint
Authentication
| Header | Required | Value |
|---|---|---|
X-API-Key | Yes | Your API key (bun_...) |
Content-Type | Yes | application/json |
Overview
Validate any phone number and retrieve structured metadata including country, calling code, and E.164 formatted output. The API normalizes the input number and identifies its country and national subscriber number, helping you reduce fraud, improve deliverability, and gate SMS flows on correctly formatted numbers.Use cases
- Validate phone numbers at sign-up to reduce fake accounts
- Normalize international numbers to E.164 format
- Identify the country and calling code for routing logic
- Gate SMS flows on properly formatted phone numbers
Details
Accepts numbers in E.164 format (e.g.+14155552671). The number must include a leading + and country calling code. Spaces, dashes, dots, and parentheses are stripped automatically before parsing.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
phone | string | Yes | Phone number to validate (E.164 format, e.g. +14155552671) |
Example
Response
200 OK
| Field | Type | Description |
|---|---|---|
phone | string | Original phone number as submitted |
valid | boolean | Whether the number is valid |
e164 | string | E.164 formatted number |
country_code | string | ISO 3166-1 alpha-2 country code (e.g. "US") |
calling_code | string | International calling code with leading + (e.g. "+1") |
national_number | string | Subscriber number without the calling code |

