phoneNumber

View as MarkdownOpen in Claude

Phone Number Lookup namespace.

Path parameters

e164_numberstringRequired
The phone number in E.164 format.

Query parameters

includestringOptional
Further number information to include in the response, some of which are billable. You can specify: carrier (Lookup full carrier information for the number), cnam (Lookup Caller ID information for the number). Separate multiple values with a comma: include=carrier,cnam.

Response

country_code_numberintegerOptional
The Country code associated with the number.
national_numberstringOptional
Number in the countries national format.
possible_numberbooleanOptional
Whether the number supplied is a possible number.
valid_numberbooleanOptional
Whether the number supplied is a valid number.
national_number_formattedstringOptional
The E164 number formatted in national format.
international_number_formattedstringOptional
The E164 number formatted in international format.
e164stringOptional
The number in E164 format.
locationstringOptional
The location of the number based on its area code and NPA.
country_codestringOptional
The ISO3166 alpha 2 country code associated with the number.
timezoneslist of stringsOptional
The time zones associated with the number.
number_typestringOptional
The type of number based on its area code and NPA.
carrierobjectOptional
Carrier information. Adding include=carrier to your request will do a live lookup to determine the current carrier information about this number.
cnamobjectOptional
Caller ID information. Adding include=cnam to your request will do a live lookup to determine the current caller ID information about this number.

Response Example

Response
{
"country_code_number": 1,
"national_number": "5551234567",
"possible_number": true,
"valid_number": true,
"national_number_formatted": "(555) 123-4567",
"international_number_formatted": "+1 555-123-4567",
"e164": "+15551234567",
"location": "Texas",
"country_code": "US",
"timezones": [
"string"
],
"number_type": "Fixed Line or Mobile",
"carrier": {
"ocn": "12345",
"lata": "99999",
"city": "Aberdeen",
"state": "WA",
"jurisdiction": "indeterminate",
"lec": "Verizon",
"linetype": "landline"
},
"cnam": {
"caller_id": "John Smith"
}
}

Example

import { RestClient } from "@signalwire/sdk";
const client = new RestClient();
const result = await client.lookup.phoneNumber("+15551234567");
console.log(result);