Line Type Intelligence is in Public Beta. The information in this document could change. We might add or update features before the product becomes Generally Available. Beta products don't have a Service Level Agreement (SLA). Learn more about beta product support.
Use Line Type Intelligence to identify the carrier and phone line type, such as mobile, landline, fixed VoIP, non-fixed VoIP, toll free, and more. For example, you can filter out landline numbers from a list before sending SMS messages.
Line Type Intelligence is available for phone numbers worldwide.
Note: Canadian phone numbers require special approval. Learn how to request access to Canadian Number Portability Administration Center (NPAC) data. Querying a Canadian phone number without access will return a 60601 error.
Make a GET /v2/PhoneNumbers/{PhoneNumber}
request with the Fields=line_type_intelligence
query parameter.
1curl -X GET "https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}?Fields=line_type_intelligence" \ -u2$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
The response includes the line_type_intelligence
object, which includes the following properties:
Property | Description |
---|---|
mobile_country_code | The three-digit mobile country code of the carrier, used with the mobile_network_code to identify a mobile network operator. |
mobile_network_code | The two- or three-digit mobile network code of the carrier, used with the mobile country code to identify a mobile network operator. This is only returned for mobile numbers. |
carrier_name | The name of the carrier. |
type | The phone number type. |
error_code | The error code. If there's no error, this value will be null . |
Carrier data isn't available for phone number types: personal
, tollFree
, premium
, sharedCost
, uan
, voicemail
, pager
, or unknown
. In these cases mobile_country_code
, mobile_network_code
, and carrier_name
values will be null
.
The following are the possible values for the type
property.
Value | Description |
---|---|
landline | A landline number that generally can't receive SMS messages. |
mobile | A mobile number that generally can receive SMS messages. |
fixedVoip | A virtual phone number associated with a physical device. For example, Comcast or Vonage. |
nonFixedVoip | A virtual phone number obtained online without requiring a physical device. For example, Google Voice or Enflick. |
personal | A phone number designated for personal use. |
tollFree | A toll-free phone number where calls are free for the calling party. |
premium | A premium-rate phone number. These numbers typically charge higher-than-normal rates for special services. |
sharedCost | A shared cost phone number. The calling party and number subscriber share the charges. These numbers charge higher-than-normal rates. |
uan | A universal access number. This is a national number that can route incoming calls to different destinations. |
voicemail | A phone number associated with a voicemail service. |
pager | A phone number associated with a pager device. |
unknown | A valid phone number, but the line type is unknown. |
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchPhoneNumber() {11const phoneNumber = await client.lookups.v212.phoneNumbers("+14159929960")13.fetch({ fields: "line_type_intelligence" });1415console.log(phoneNumber.lineTypeIntelligence);16}1718fetchPhoneNumber();
1{2"calling_country_code": "1",3"country_code": "US",4"phone_number": "+14159929960",5"national_format": "(415) 992-9960",6"valid": true,7"validation_errors": null,8"caller_name": null,9"sim_swap": null,10"call_forwarding": null,11"line_status": null,12"line_type_intelligence": {13"error_code": null,14"mobile_country_code": "240",15"mobile_network_code": "38",16"carrier_name": "Twilio - SMS/MMS-SVR",17"type": "nonFixedVoip"18},19"identity_match": null,20"reassigned_number": null,21"sms_pumping_risk": null,22"phone_number_quality_score": null,23"pre_fill": null,24"url": "https://lookups.twilio.com/v2/PhoneNumbers/+14159929960"25}
The video below demonstrates how to check a phone number's line type with Lookup using Node.js and the Twilio Node Helper Library.