Skip to contentSkip to navigationSkip to topbar
On this page

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.

(information)

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.


Local Properties

local-properties page anchor
Property nameTypeRequiredDescriptionChild properties
friendly_namestring<phone-number>Optional
Not PII

A formatted version of the phone number.


phone_numberstring<phone-number>Optional

The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.


latastringOptional

The LATA(link takes you to an external page) of this phone number. Available for only phone numbers from the US and Canada.


localitystringOptional

The locality or city of this phone number's location.


rate_centerstringOptional

The rate center(link takes you to an external page) of this phone number. Available for only phone numbers from the US and Canada.


latitudenumberOptional

The latitude of this phone number's location. Available for only phone numbers from the US and Canada.


longitudenumberOptional

The longitude of this phone number's location. Available for only phone numbers from the US and Canada.


regionstringOptional

The two-letter state or province abbreviation of this phone number's location. Available for only phone numbers from the US and Canada.


postal_codestringOptional

The postal or ZIP code of this phone number's location. Available for only phone numbers from the US and Canada.


iso_countrystring<iso-country-code>Optional

address_requirementsstringOptional

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.


betabooleanOptional

Whether the phone number is new to the Twilio platform. Can be: true or false.


capabilitiesobject<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.


Read multiple AvailablePhoneNumberLocal resources

read-multiple-availablephonenumberlocal-resources page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/Local.json

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account requesting the AvailablePhoneNumber resources.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

CountryCodestring<iso-country-code>required

The ISO-3166-1(link takes you to an external page) country code of the country from which to read phone numbers.

Property nameTypeRequiredPIIDescription
AreaCodeintegerOptional

The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.


ContainsstringOptional

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.


SmsEnabledbooleanOptional

Whether the phone numbers can receive text messages. Can be: true or false.


MmsEnabledbooleanOptional

Whether the phone numbers can receive MMS messages. Can be: true or false.


VoiceEnabledbooleanOptional

Whether the phone numbers can receive calls. Can be: true or false.


ExcludeAllAddressRequiredbooleanOptional

Whether to exclude phone numbers that require an Address. Can be: true or false and the default is false.


ExcludeLocalAddressRequiredbooleanOptional

Whether to exclude phone numbers that require a local Address. Can be: true or false and the default is false.


ExcludeForeignAddressRequiredbooleanOptional

Whether to exclude phone numbers that require a foreign Address. Can be: true or false and the default is false.


BetabooleanOptional

Whether to read phone numbers that are new to the Twilio platform. Can be: true or false and the default is true.


NearNumberstring<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.


NearLatLongstringOptional

Given a latitude/longitude pair lat,long find geographically close numbers within distance miles. Applies to only phone numbers in the US and Canada.


DistanceintegerOptional

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.


InPostalCodestringOptional

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.


InRegionstringOptional

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.


InRateCenterstringOptional

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.


InLatastringOptional

Limit results to a specific local access and transport area (LATA(link takes you to an external page)). Given a phone number, search within the same LATA(link takes you to an external page) as that number. Applies to only phone numbers in the US and Canada.


InLocalitystringOptional

Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.


FaxEnabledbooleanOptional

Whether the phone numbers can receive faxes. Can be: true or false.


PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

Find available local phone numbers by area codeLink to code sample: Find available local phone numbers by area code
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listAvailablePhoneNumberLocal() {
11
const locals = await client.availablePhoneNumbers("US").local.list({
12
areaCode: 510,
13
limit: 20,
14
});
15
16
locals.forEach((l) => console.log(l.friendlyName));
17
}
18
19
listAvailablePhoneNumberLocal();

Output

1
{
2
"available_phone_numbers": [
3
{
4
"address_requirements": "none",
5
"beta": false,
6
"capabilities": {
7
"mms": true,
8
"sms": false,
9
"voice": true
10
},
11
"friendly_name": "(808) 925-1571",
12
"iso_country": "US",
13
"lata": "834",
14
"latitude": "19.720000",
15
"locality": "Hilo",
16
"longitude": "-155.090000",
17
"phone_number": "+18089251571",
18
"postal_code": "96720",
19
"rate_center": "HILO",
20
"region": "HI"
21
}
22
],
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
24
}
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listAvailablePhoneNumberLocal() {
11
const locals = await client.availablePhoneNumbers("US").local.list({
12
contains: "510555****",
13
limit: 20,
14
});
15
16
locals.forEach((l) => console.log(l.friendlyName));
17
}
18
19
listAvailablePhoneNumberLocal();

Output

1
{
2
"available_phone_numbers": [
3
{
4
"address_requirements": "none",
5
"beta": false,
6
"capabilities": {
7
"mms": true,
8
"sms": false,
9
"voice": true
10
},
11
"friendly_name": "(808) 925-1571",
12
"iso_country": "US",
13
"lata": "834",
14
"latitude": "19.720000",
15
"locality": "Hilo",
16
"longitude": "-155.090000",
17
"phone_number": "+18089251571",
18
"postal_code": "96720",
19
"rate_center": "HILO",
20
"region": "HI"
21
}
22
],
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
24
}
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listAvailablePhoneNumberLocal() {
11
const locals = await client.availablePhoneNumbers("US").local.list({
12
contains: "STORM",
13
limit: 20,
14
});
15
16
locals.forEach((l) => console.log(l.friendlyName));
17
}
18
19
listAvailablePhoneNumberLocal();

Output

1
{
2
"available_phone_numbers": [
3
{
4
"address_requirements": "none",
5
"beta": false,
6
"capabilities": {
7
"mms": true,
8
"sms": false,
9
"voice": true
10
},
11
"friendly_name": "(808) 925-1571",
12
"iso_country": "US",
13
"lata": "834",
14
"latitude": "19.720000",
15
"locality": "Hilo",
16
"longitude": "-155.090000",
17
"phone_number": "+18089251571",
18
"postal_code": "96720",
19
"rate_center": "HILO",
20
"region": "HI"
21
}
22
],
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
24
}
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listAvailablePhoneNumberLocal() {
11
const locals = await client.availablePhoneNumbers("US").local.list({
12
inRegion: "AR",
13
limit: 20,
14
});
15
16
locals.forEach((l) => console.log(l.friendlyName));
17
}
18
19
listAvailablePhoneNumberLocal();

Output

1
{
2
"available_phone_numbers": [
3
{
4
"address_requirements": "none",
5
"beta": false,
6
"capabilities": {
7
"mms": true,
8
"sms": false,
9
"voice": true
10
},
11
"friendly_name": "(808) 925-1571",
12
"iso_country": "US",
13
"lata": "834",
14
"latitude": "19.720000",
15
"locality": "Hilo",
16
"longitude": "-155.090000",
17
"phone_number": "+18089251571",
18
"postal_code": "96720",
19
"rate_center": "HILO",
20
"region": "HI"
21
}
22
],
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
24
}
Find available local phone numbers by prefixLink to code sample: Find available local phone numbers by prefix
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listAvailablePhoneNumberLocal() {
11
const locals = await client.availablePhoneNumbers("GB").local.list({
12
contains: "+4420",
13
limit: 20,
14
});
15
16
locals.forEach((l) => console.log(l.friendlyName));
17
}
18
19
listAvailablePhoneNumberLocal();

Output

1
{
2
"available_phone_numbers": [
3
{
4
"address_requirements": "none",
5
"beta": false,
6
"capabilities": {
7
"mms": true,
8
"sms": false,
9
"voice": true
10
},
11
"friendly_name": "(808) 925-1571",
12
"iso_country": "US",
13
"lata": "834",
14
"latitude": "19.720000",
15
"locality": "Hilo",
16
"longitude": "-155.090000",
17
"phone_number": "+18089251571",
18
"postal_code": "96720",
19
"rate_center": "HILO",
20
"region": "HI"
21
}
22
],
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
24
}
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listAvailablePhoneNumberLocal() {
11
const locals = await client.availablePhoneNumbers("GB").local.list({
12
smsEnabled: true,
13
voiceEnabled: true,
14
limit: 20,
15
});
16
17
locals.forEach((l) => console.log(l.friendlyName));
18
}
19
20
listAvailablePhoneNumberLocal();

Output

1
{
2
"available_phone_numbers": [
3
{
4
"address_requirements": "none",
5
"beta": false,
6
"capabilities": {
7
"mms": true,
8
"sms": false,
9
"voice": true
10
},
11
"friendly_name": "(808) 925-1571",
12
"iso_country": "US",
13
"lata": "834",
14
"latitude": "19.720000",
15
"locality": "Hilo",
16
"longitude": "-155.090000",
17
"phone_number": "+18089251571",
18
"postal_code": "96720",
19
"rate_center": "HILO",
20
"region": "HI"
21
}
22
],
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
24
}
Find phone numbers without address requirementsLink to code sample: Find phone numbers without address requirements
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listAvailablePhoneNumberLocal() {
11
const locals = await client.availablePhoneNumbers("US").local.list({
12
excludeAllAddressRequired: true,
13
limit: 20,
14
});
15
16
locals.forEach((l) => console.log(l.friendlyName));
17
}
18
19
listAvailablePhoneNumberLocal();

Output

1
{
2
"available_phone_numbers": [
3
{
4
"address_requirements": "none",
5
"beta": false,
6
"capabilities": {
7
"mms": true,
8
"sms": false,
9
"voice": true
10
},
11
"friendly_name": "(808) 925-1571",
12
"iso_country": "US",
13
"lata": "834",
14
"latitude": "19.720000",
15
"locality": "Hilo",
16
"longitude": "-155.090000",
17
"phone_number": "+18089251571",
18
"postal_code": "96720",
19
"rate_center": "HILO",
20
"region": "HI"
21
}
22
],
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
24
}
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listAvailablePhoneNumberLocal() {
11
const locals = await client.availablePhoneNumbers("US").local.list({
12
contains: "555",
13
distance: 50,
14
inRegion: "CA",
15
nearLatLong: "37.840699,-122.461853",
16
limit: 20,
17
});
18
19
locals.forEach((l) => console.log(l.friendlyName));
20
}
21
22
listAvailablePhoneNumberLocal();

Output

1
{
2
"available_phone_numbers": [
3
{
4
"address_requirements": "none",
5
"beta": false,
6
"capabilities": {
7
"mms": true,
8
"sms": false,
9
"voice": true
10
},
11
"friendly_name": "(808) 925-1571",
12
"iso_country": "US",
13
"lata": "834",
14
"latitude": "19.720000",
15
"locality": "Hilo",
16
"longitude": "-155.090000",
17
"phone_number": "+18089251571",
18
"postal_code": "96720",
19
"rate_center": "HILO",
20
"region": "HI"
21
}
22
],
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json"
24
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.