AvailablePhoneNumbers
Query the local, mobile, and toll-free phone numbers available in Twilio.
View-Specific Information
You can use this view to search for local, toll-free, and mobile phone numbers that are available for you to purchase. You can search for phone numbers by specifying a pattern, country, area code (NPA) or exchange (NXX), or geography.
SELECT
The add-in uses the Twilio API to process WHERE clause conditions built with the following columns and operators. The rest of the filter is executed client-side within the add-in.
Note: IsoCountry and Category are required in the WHERE clause.
| Column | Supported Operators |
| IsoCountry | = |
| Category | = |
| PhoneNumber | =, CONTAINS |
| AreaCode | = |
| CapabilitiesVoice | = |
| CapabilitiesSms | = |
| CapabilitiesMms | = |
| Beta | = |
| Lata | = |
| RateCenter | = |
| PostalCode | = |
| Region | = |
| Distance | = |
| NearNumber | = |
| NearLatLong | = |
| FaxEnabled | = |
For example, the following queries are processed server-side:
SELECT * FROM AvailablePhoneNumbers WHERE IsoCountry = 'US' AND Category = 'Local'
You can also use the PhoneNumber column to search for phone numbers that match a specific pattern using the CONTAINS function. Note that the CONTAINS function requires the input value to be more than one character.
SELECT * FROM AvailablePhoneNumbers WHERE IsoCountry = 'US' AND Category = 'Local' AND CONTAINS(PhoneNumber, '1626')
Columns
| Name | Type | References | Description |
| PhoneNumber [KEY] | String | The phone number available to purchase. It may be used as a pattern to match phone numbers on. Valid characters are '*' and [0-9a-zA-Z]. The '*' character will match any single digit. | |
| Name | String | The friendly name of the available phone number. | |
| Lata | String | The LATA of the available phone number. | |
| RateCenter | String | The rate center of the available phone number. | |
| Latitude | Double | The latitude of the available phone number. | |
| Longitude | Double | The longitude of the available phone number. | |
| Region | String | The region of the available phone number. | |
| PostalCode | String | The postal code of the available phone number. | |
| IsoCountry | String | The ISO country code in ISO 3166-1 alpha-2 format ('US' for United States, 'CA' for Canada, 'GB' for United Kingdom). | |
| AddressRequirements | String | The address requirements of the available phone number. Eligible values are: none, any, local, or foreign.
The allowed values are none, any, local, foreign. | |
| Beta | Boolean | Whether the phone number is a beta number new to the Twilio platform. | |
| CapabilitiesVoice | Boolean | Whether the phone number has voice capabilities. | |
| CapabilitiesSms | Boolean | Whether the phone number has SMS capabilities. | |
| CapabilitiesMms | Boolean | Whether the phone number has MMS capabilities. | |
| Locality | String | The locality/city of this phone number. | |
| CapabilitiesFax | Boolean | Whether the available phone number supports fax. |
Pseudocolumns
Pseudocolumn fields can be used in SELECT, INSERT, and UPDATE statements to provide additional control over data retrieval and modification in the data source.
| Name | Type | Description | |
| ExcludeAllAddressRequired | Boolean | Indicates whether the response includes phone numbers which require any Address. Possible values are true or false. If not specified, the default is false, and results could include phone numbers with an Address required. | |
| ExcludeLocalAddressRequired | Boolean | Indicates whether the response includes phone numbers which require a local Address. Possible values are true or false. If not specified, the default is false, and results could include phone numbers with a local Address required. | |
| ExcludeForeignAddressRequired | Boolean | Indicates whether the response includes phone numbers which require a foreign Address. Possible values are true or false. If not specified, the default is false, and results could include phone numbers with a foreign Address required. | |
| AreaCode | Integer | The area code of the available phone number. | |
| Category | String | The category of the available phone number. Possible values are: Local,Mobile,Tollfree.
The allowed values are Local, Mobile, Tollfree. | |
| NearNumber | String | Given a phone number, find a geographically close number within Distance miles. Distance defaults to 25 miles. | |
| NearLatLong | String | Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. | |
| Distance | Integer | The search radius for available phone numbers. Default is 25 miles. Max is 500 miles. | |
| FaxEnabled | Boolean | Whether the phone numbers can receive faxes. Can be: true or false. |