Lookup's Line Type Intelligence package allows you to get the line type of a phone number including mobile, landline, fixed VoIP, non-fixed VoIP, toll-free, and more.
To make a Line Type Intelligence request, add line_type_intelligence
to the optional query parameter Fields
when making a standard Lookup request.
1curl -X GET "https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}?Fields=line_type_intelligence" \ -u2$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
Coverage and Limitations: Worldwide support. Canada requires special approval, please read this support article to learn more. Querying a Canada phone number without access will return a 60601 error.
Release Stage and Access: Public Beta, available via self-service.
The following additional properties are returned for a Line Type Intelligence request.
Name | Description |
---|---|
MobileCountryCode | The three digit mobile country code of the carrier, used with the mobile network code to identify a mobile network operator. |
MobileNetworkCode | The two-three digit mobile network code of the carrier, used with the mobile country code to identify a mobile network operator (only returned for mobile numbers). |
CarrierName | The name of the carrier; subject to change. |
Type | The phone number type. See Type property values for more information. |
ErrorCode | The error code, if any, associated with your request. |
Carrier data is not available for phone number types: personal
, tollFree
, premium
, sharedCost
, uan
, voicemail
, pager
, or unknown
. In these cases MobileCountryCode
, MobileNetworkCode
, and CarrierName
values will be null
.
The following are the possible values for the Type
property.
Type | Description |
---|---|
landline | The phone number is a landline number; generally not capable of receiving SMS messages. |
mobile | The phone number is a mobile number; generally capable of receiving SMS messages. |
fixedVoip | A virtual phone number associated with a physical device (e.g., Comcast or Vonage). |
nonFixedVoip | A virtual phone number that can be obtained on the internet without the need for a physical device (e.g., Google Voice or Enflick). |
personal | A phone number designated for personal use. |
tollFree | A toll-free phone number, which is one where calls are free for the calling party. |
premium | A premium rate phone number, which typically charges higher than normal rates for special services. |
sharedCost | A shared cost phone number, which is one where the charge is partially paid by the calling party and charges higher than normal rates. |
uan | A universal access number, which is a national number which 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 could not be determined. |
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 shows how to check a phone number's line type with Lookup using Node.js and the Twilio Node Helper Library.