import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const numberLookup = await client.numberLookup.retrieve('+18665552368');
console.log(numberLookup.data);{
"data": {
"record_type": "number_lookup",
"country_code": "US",
"national_format": "(0312) 945-7420",
"phone_number": "+13129457420",
"fraud": null,
"carrier": {
"mobile_country_code": "US",
"mobile_network_code": "0866",
"name": "Telnyx/4",
"type": "voip",
"error_code": null,
"normalized_carrier": "AT&T"
},
"caller_name": {
"caller_name": "TELNYX LLC",
"error_code": "10001"
},
"portability": {
"lrn": "2245701999",
"ported_status": "Y",
"ported_date": "2017-10-20",
"ocn": "073H",
"line_type": "voip",
"spid": "073H",
"spid_carrier_name": "Telnyx/4",
"spid_carrier_type": "3",
"altspid": "073H",
"altspid_carrier_name": "Telnyx/4",
"altspid_carrier_type": "3",
"city": "WAUKEGAN",
"state": "Illinois"
}
}
}Returns information about the provided phone number.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const numberLookup = await client.numberLookup.retrieve('+18665552368');
console.log(numberLookup.data);{
"data": {
"record_type": "number_lookup",
"country_code": "US",
"national_format": "(0312) 945-7420",
"phone_number": "+13129457420",
"fraud": null,
"carrier": {
"mobile_country_code": "US",
"mobile_network_code": "0866",
"name": "Telnyx/4",
"type": "voip",
"error_code": null,
"normalized_carrier": "AT&T"
},
"caller_name": {
"caller_name": "TELNYX LLC",
"error_code": "10001"
},
"portability": {
"lrn": "2245701999",
"ported_status": "Y",
"ported_date": "2017-10-20",
"ocn": "073H",
"line_type": "voip",
"spid": "073H",
"spid_carrier_name": "Telnyx/4",
"spid_carrier_type": "3",
"altspid": "073H",
"altspid_carrier_name": "Telnyx/4",
"altspid_carrier_type": "3",
"city": "WAUKEGAN",
"state": "Illinois"
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The phone number to be looked up
"+18665552368"
Specifies the type of number lookup to be performed
carrier, caller-name Successful response
Show child attributes
Identifies the type of record
"number_lookup"
Region code that matches the specific country calling code
"US"
Hyphen-separated national number, preceded by the national destination code (NDC), with a 0 prefix, if an NDC is found
"(0312) 945-7420"
E164-formatted phone number
"+13129457420"
Unused
null
Show child attributes
Region code that matches the specific country calling code if the requested phone number type is mobile
"US"
National destination code (NDC), with a 0 prefix, if an NDC is found and the requested phone number type is mobile
"0866"
SPID (Service Provider ID) name, if the requested phone number has been ported; otherwise, the name of carrier who owns the phone number block
"Telnyx/4"
A phone number type that identifies the type of service associated with the requested phone number
fixed line, mobile, voip, fixed line or mobile, toll free, premium rate, shared cost, personal number, pager, uan, voicemail, unknown "voip"
Unused
null
If known to Telnyx and applicable, the primary network carrier.
"AT&T"
Show child attributes
Local Routing Number, if assigned to the requested phone number
"2245701999"
Indicates whether or not the requested phone number has been ported
Y, N, "Y"
ISO-formatted date when the requested phone number has been ported
"2017-10-20"
Operating Company Name (OCN) as per the Local Exchange Routing Guide (LERG) database
"073H"
Type of number
"voip"
SPID (Service Provider ID)
"073H"
Service provider name
"Telnyx/4"
Service provider type
"3"
Alternative SPID (Service Provider ID). Often used when a carrier is using a number from another carrier
"073H"
Alternative service provider name
"Telnyx/4"
Alternative service provider type
"3"
City name extracted from the locality in the Local Exchange Routing Guide (LERG) database
"WAUKEGAN"
"Illinois"
Was this page helpful?