AvailablePhoneNumber Local resource
The AvailablePhoneNumberLocal
resource lets you search for local phone numbers that are available for you to purchase. You can search for phone numbers that match a pattern, are in a certain country, are in certain area code (NPA) or exchange (NXX) and a variety of other geographic parameters, detailed below.
Info Once you've found an available number you want to purchase, make an HTTP POST
request to the IncomingPhoneNumbers list resource passing the number as the 'PhoneNumber' parameter.
We work hard to keep a wide variety of numbers in stock at all times. See our pricing pages(link takes you to an external page) for country availability.
Property name Type Required Description Child properties
friendly_name string<phone-number> Optional A formatted version of the phone number.
phone_number string<phone-number> Optional The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.
The locality or city of this phone number's location.
rate_center string Optional The latitude of this phone number's location. Available for only phone numbers from the US and Canada.
The longitude of this phone number's location. Available for only phone numbers from the US and Canada.
The two-letter state or province abbreviation of this phone number's location. Available for only phone numbers from the US and Canada.
postal_code string Optional The postal or ZIP code of this phone number's location. Available for only phone numbers from the US and Canada.
iso_country string<iso-country-code> Optional address_requirements string Optional The type of Address resource the phone number requires. Can be: none
, any
, local
, or foreign
. none
means no address is required. any
means an address is required, but it can be anywhere in the world. local
means an address in the phone number's country is required. foreign
means an address outside of the phone number's country is required.
Whether the phone number is new to the Twilio platform. Can be: true
or false
.
capabilities object<phone-number-capabilities> Optional The set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are: Voice
, SMS
, and MMS
and each capability can be: true
or false
.
Show child properties
for capabilities Property name Type Required Description Child properties
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/Local.json
Property name Type Required PII Description
AccountSid SID<AC> required The SID of the Account requesting the AvailablePhoneNumber resources.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
CountryCode string<iso-country-code> required
Property name Type Required PII Description
The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
The pattern on which to match phone numbers. Valid characters are *
, 0-9
, a-z
, and A-Z
. The *
character matches any single digit. For examples, see Example 2 and Example 3 . If specified, this value must have at least two characters.
SmsEnabled boolean Optional Whether the phone numbers can receive text messages. Can be: true
or false
.
MmsEnabled boolean Optional Whether the phone numbers can receive MMS messages. Can be: true
or false
.
VoiceEnabled boolean Optional Whether the phone numbers can receive calls. Can be: true
or false
.
ExcludeAllAddressRequired boolean Optional Whether to exclude phone numbers that require an Address . Can be: true
or false
and the default is false
.
ExcludeLocalAddressRequired boolean Optional Whether to exclude phone numbers that require a local Address . Can be: true
or false
and the default is false
.
ExcludeForeignAddressRequired boolean Optional Whether to exclude phone numbers that require a foreign Address . Can be: true
or false
and the default is false
.
Whether to read phone numbers that are new to the Twilio platform. Can be: true
or false
and the default is true
.
NearNumber string<phone-number> Optional Given a phone number, find a geographically close number within distance
miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.
NearLatLong string Optional Given a latitude/longitude pair lat,long
find geographically close numbers within distance
miles. Applies to only phone numbers in the US and Canada.
The search radius, in miles, for a near_
query. Can be up to 500
and the default is 25
. Applies to only phone numbers in the US and Canada.
InPostalCode string Optional Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.
Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.
InRateCenter string Optional Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires in_lata
to be set as well. Applies to only phone numbers in the US and Canada.
Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.
FaxEnabled boolean Optional Whether the phone numbers can receive faxes. Can be: true
or false
.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
Find available local phone numbers in the United States in the 510 area code
_19 // Download the helper library from https://www.twilio.com/docs/node/install
_19 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19 // Find your Account SID and Auth Token at twilio.com/console
_19 // and set the environment variables. See http://twil.io/secure
_19 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19 const authToken = process.env.TWILIO_AUTH_TOKEN;
_19 const client = twilio(accountSid, authToken);
_19 async function listAvailablePhoneNumberLocal() {
_19 const locals = await client.availablePhoneNumbers("US").local.list({
_19 locals.forEach((l) => console.log(l.friendlyName));
_19 listAvailablePhoneNumberLocal();
_24 "available_phone_numbers": [
_24 "address_requirements": "none",
_24 "friendly_name": "(808) 925-1571",
_24 "latitude": "19.720000",
_24 "longitude": "-155.090000",
_24 "phone_number": "+18089251571",
_24 "postal_code": "96720",
_24 "rate_center": "HILO",
_24 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
Find local phone numbers in the United States starting with 510555
_19 // Download the helper library from https://www.twilio.com/docs/node/install
_19 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19 // Find your Account SID and Auth Token at twilio.com/console
_19 // and set the environment variables. See http://twil.io/secure
_19 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19 const authToken = process.env.TWILIO_AUTH_TOKEN;
_19 const client = twilio(accountSid, authToken);
_19 async function listAvailablePhoneNumberLocal() {
_19 const locals = await client.availablePhoneNumbers("US").local.list({
_19 contains: "510555****",
_19 locals.forEach((l) => console.log(l.friendlyName));
_19 listAvailablePhoneNumberLocal();
_24 "available_phone_numbers": [
_24 "address_requirements": "none",
_24 "friendly_name": "(808) 925-1571",
_24 "latitude": "19.720000",
_24 "longitude": "-155.090000",
_24 "phone_number": "+18089251571",
_24 "postal_code": "96720",
_24 "rate_center": "HILO",
_24 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
Find local phone numbers that match the pattern 'STORM'
_19 // Download the helper library from https://www.twilio.com/docs/node/install
_19 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19 // Find your Account SID and Auth Token at twilio.com/console
_19 // and set the environment variables. See http://twil.io/secure
_19 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19 const authToken = process.env.TWILIO_AUTH_TOKEN;
_19 const client = twilio(accountSid, authToken);
_19 async function listAvailablePhoneNumberLocal() {
_19 const locals = await client.availablePhoneNumbers("US").local.list({
_19 locals.forEach((l) => console.log(l.friendlyName));
_19 listAvailablePhoneNumberLocal();
_24 "available_phone_numbers": [
_24 "address_requirements": "none",
_24 "friendly_name": "(808) 925-1571",
_24 "latitude": "19.720000",
_24 "longitude": "-155.090000",
_24 "phone_number": "+18089251571",
_24 "postal_code": "96720",
_24 "rate_center": "HILO",
_24 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
Find available phone numbers in Arkansas
_19 // Download the helper library from https://www.twilio.com/docs/node/install
_19 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19 // Find your Account SID and Auth Token at twilio.com/console
_19 // and set the environment variables. See http://twil.io/secure
_19 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19 const authToken = process.env.TWILIO_AUTH_TOKEN;
_19 const client = twilio(accountSid, authToken);
_19 async function listAvailablePhoneNumberLocal() {
_19 const locals = await client.availablePhoneNumbers("US").local.list({
_19 locals.forEach((l) => console.log(l.friendlyName));
_19 listAvailablePhoneNumberLocal();
_24 "available_phone_numbers": [
_24 "address_requirements": "none",
_24 "friendly_name": "(808) 925-1571",
_24 "latitude": "19.720000",
_24 "longitude": "-155.090000",
_24 "phone_number": "+18089251571",
_24 "postal_code": "96720",
_24 "rate_center": "HILO",
_24 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
Find a phone number in the London prefix (+4420)
_19 // Download the helper library from https://www.twilio.com/docs/node/install
_19 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19 // Find your Account SID and Auth Token at twilio.com/console
_19 // and set the environment variables. See http://twil.io/secure
_19 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19 const authToken = process.env.TWILIO_AUTH_TOKEN;
_19 const client = twilio(accountSid, authToken);
_19 async function listAvailablePhoneNumberLocal() {
_19 const locals = await client.availablePhoneNumbers("GB").local.list({
_19 locals.forEach((l) => console.log(l.friendlyName));
_19 listAvailablePhoneNumberLocal();
_24 "available_phone_numbers": [
_24 "address_requirements": "none",
_24 "friendly_name": "(808) 925-1571",
_24 "latitude": "19.720000",
_24 "longitude": "-155.090000",
_24 "phone_number": "+18089251571",
_24 "postal_code": "96720",
_24 "rate_center": "HILO",
_24 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
Find a phone number in the UK which is Voice- and SMS-enabled
_20 // Download the helper library from https://www.twilio.com/docs/node/install
_20 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20 // Find your Account SID and Auth Token at twilio.com/console
_20 // and set the environment variables. See http://twil.io/secure
_20 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20 const authToken = process.env.TWILIO_AUTH_TOKEN;
_20 const client = twilio(accountSid, authToken);
_20 async function listAvailablePhoneNumberLocal() {
_20 const locals = await client.availablePhoneNumbers("GB").local.list({
_20 locals.forEach((l) => console.log(l.friendlyName));
_20 listAvailablePhoneNumberLocal();
_24 "available_phone_numbers": [
_24 "address_requirements": "none",
_24 "friendly_name": "(808) 925-1571",
_24 "latitude": "19.720000",
_24 "longitude": "-155.090000",
_24 "phone_number": "+18089251571",
_24 "postal_code": "96720",
_24 "rate_center": "HILO",
_24 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
Find available local phone numbers that have no address requirements
_19 // Download the helper library from https://www.twilio.com/docs/node/install
_19 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19 // Find your Account SID and Auth Token at twilio.com/console
_19 // and set the environment variables. See http://twil.io/secure
_19 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19 const authToken = process.env.TWILIO_AUTH_TOKEN;
_19 const client = twilio(accountSid, authToken);
_19 async function listAvailablePhoneNumberLocal() {
_19 const locals = await client.availablePhoneNumbers("US").local.list({
_19 excludeAllAddressRequired: true,
_19 locals.forEach((l) => console.log(l.friendlyName));
_19 listAvailablePhoneNumberLocal();
_24 "available_phone_numbers": [
_24 "address_requirements": "none",
_24 "friendly_name": "(808) 925-1571",
_24 "latitude": "19.720000",
_24 "longitude": "-155.090000",
_24 "phone_number": "+18089251571",
_24 "postal_code": "96720",
_24 "rate_center": "HILO",
_24 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
These features are limited to US and Canadian phone numbers. Find local phone numbers within 50 miles of San Francisco, CA (37.840699,-122.461853) that contain the digits '555'.
_22 // Download the helper library from https://www.twilio.com/docs/node/install
_22 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_22 // Find your Account SID and Auth Token at twilio.com/console
_22 // and set the environment variables. See http://twil.io/secure
_22 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_22 const authToken = process.env.TWILIO_AUTH_TOKEN;
_22 const client = twilio(accountSid, authToken);
_22 async function listAvailablePhoneNumberLocal() {
_22 const locals = await client.availablePhoneNumbers("US").local.list({
_22 nearLatLong: "37.840699,-122.461853",
_22 locals.forEach((l) => console.log(l.friendlyName));
_22 listAvailablePhoneNumberLocal();
_24 "available_phone_numbers": [
_24 "address_requirements": "none",
_24 "friendly_name": "(808) 925-1571",
_24 "latitude": "19.720000",
_24 "longitude": "-155.090000",
_24 "phone_number": "+18089251571",
_24 "postal_code": "96720",
_24 "rate_center": "HILO",
_24 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"