Skip to main content

Lookup phone number data

GET 
/number_lookup/:phone_number

Returns information about the provided phone number.

Request

Path Parameters

    phone_number stringrequired

    The phone number to be looked up

Query Parameters

    type string

    Possible values: [carrier, caller-name]

    Specifies the type of number lookup to be performed

Responses

200: Successful response

422: Unprocessable entity. Check the 'detail' field in response for details.

default: Unexpected error

Request samples


curl -L 'https://api.telnyx.com/v2/number_lookup/:phone_number' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'

Response samples


{
"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"
}
}
}