Lookup phone number data
GET/number_lookup/:phone_number
Returns information about the provided phone number.
Request
Path Parameters
The phone number to be looked up
Query Parameters
Possible values: [carrier
, caller-name
]
Specifies the type of number lookup to be performed
Responses
200: Successful response
- application/json
- Schema
- Example (from schema)
Schema
data
object
Identifies the type of record
Region code that matches the specific country calling code
Hyphen-separated national number, preceded by the national destination code (NDC), with a 0 prefix, if an NDC is found
E164-formatted phone number
Unused
carrier
object
Region code that matches the specific country calling code if the requested phone number type is mobile
National destination code (NDC), with a 0 prefix, if an NDC is found and the requested phone number type is mobile
SPID (Service Provider ID) name, if the requested phone number has been ported; otherwise, the name of carrier who owns the phone number block
Possible values: [fixed line
, mobile
, voip
, fixed line or mobile
, toll free
, premium rate
, shared cost
, personal number
, pager
, uan
, voicemail
, unknown
]
A phone number type that identifies the type of service associated with the requested phone number
Unused
If known to Telnyx and applicable, the primary network carrier.
caller_name
object
The name of the requested phone number's owner as per the CNAM database
A caller-name lookup specific error code, expressed as a stringified 5-digit integer
portability
object
Local Routing Number, if assigned to the requested phone number
Possible values: [Y
, N
, ``]
Indicates whether or not the requested phone number has been ported
ISO-formatted date when the requested phone number has been ported
Operating Company Name (OCN) as per the Local Exchange Routing Guide (LERG) database
Type of number
SPID (Service Provider ID)
Service provider name
Service provider type
Alternative SPID (Service Provider ID). Often used when a carrier is using a number from another carrier
Alternative service provider name
Alternative service provider type
City name extracted from the locality in the Local Exchange Routing Guide (LERG) database
{
"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"
}
}
}
422: Unprocessable entity. Check the 'detail' field in response for details.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
Error[]
source
object
JSON pointer (RFC6901) to the offending entity.
Indicates which query parameter caused the error.
{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}
default: Unexpected error
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
Error[]
source
object
JSON pointer (RFC6901) to the offending entity.
Indicates which query parameter caused the error.
{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}