Pandemic Darlings The pandemic economy, in original documents
Home Source documents Line Type Intelligence (Twilio)

Line Type Intelligence (Twilio)

Summary

This Twilio documentation page describes Line Type Intelligence, which identifies the carrier and phone line type of a number, such as mobile, landline, fixed VoIP, non-fixed VoIP and toll free; its example is filtering landline numbers out of a list before sending SMS messages. It says the feature covers phone numbers worldwide, with Canadian numbers requiring special approval, and is run with a GET request to /v2/PhoneNumbers/{PhoneNumber} using the Fields=line_type_intelligence query parameter. The response includes a line_type_intelligence object with the mobile country code, mobile network code, carrier name, type and error code, and the page notes that carrier data is not available for types including personal, tollFree, premium and unknown numbers.

Summary drafted by a model from the document's text below and checked by script against that text before publication. It is a navigation aid, not a reading of what the document proves. Where AI is used

Full text

Page tools

Useful for sharing or LLM

Accelerate development with AI

On this page

Looking for more inspiration? Visit the

Line Type Intelligence

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.

Coverage

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 .

Run line type intelligence

Make a GET /v2/PhoneNumbers/{PhoneNumber} request with the Fields=line_type_intelligence query parameter.

Check a phone number's line type

1curl -X GET "https://lookups.twilio.com/v2/PhoneNumbers/%2B15017122661?Fields=line_type_intelligence" \
2-u $TWILIO_API_KEY:$TWILIO_API_SECRET

Response properties

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 .

type property values

(warning)

Warning

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.

Code examples and responses

Line Type Intelligence Lookup

1// Download the helper library from https://www.twilio.com/docs/node/install
2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4// Find your Account SID at twilio.com/console
5// Provision API Keys at twilio.com/console/runtime/api-keys
6// and set the environment variables. See http://twil.io/secure
7// For local testing, you can use your Account SID and Auth token
8const accountSid = process.env.TWILIO_ACCOUNT_SID;
9const apiKey = process.env.TWILIO_API_KEY;
10const apiSecret = process.env.TWILIO_API_SECRET;
11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });
12
13async function fetchPhoneNumber() {
14  const phoneNumber = await client.lookups.v2
15    .phoneNumbers("+14159929960")
16    .fetch({ fields: "line_type_intelligence" });
17
18  console.log(phoneNumber.lineTypeIntelligence);
19}
20
21fetchPhoneNumber();

Response

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}

Video example

The video below demonstrates how to check a phone number's line type with Lookup using Node.js and the Twilio Node SDK .

File and source

File
e09-r65.html
Size
329,827 bytes
SHA-256
fedc1b590d6033830d9ca3496cade7d2c4032c2686613f13e06d79b083f8346b
Our copy
e09-r65.html
Original
www.twilio.com
Back to top