Sample - Twilio API
GET/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/Local.json

List available local phone numbers

Lists available local phone numbers in a specified country. Use capability filters, geographic criteria, address requirements, and Contains to narrow the search, then use the pagination parameters to retrieve additional results.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

23 parameters
AccountSidstringrequired
The 34-character SID of the account requesting available phone numbers. Must match the `AC` account SID format.
CountryCodestringrequired
The ISO 3166-1 country code from which to retrieve local phone numbers.
AreaCodeintegeroptional
The area code to filter by; applies only to phone numbers in the United States and Canada.
Containsstringoptional
A 2-to-16-character matching pattern for phone numbers using digits, non-diacritic Latin letters, and the allowed meta-characters `*`, `%`, `+`, and `$`.
SmsEnabledbooleanoptional
Whether returned phone numbers can receive SMS messages: `true` or `false`.
MmsEnabledbooleanoptional
Whether returned phone numbers can receive MMS messages: `true` or `false`.
VoiceEnabledbooleanoptional
Whether returned phone numbers can receive calls: `true` or `false`.
ExcludeAllAddressRequiredbooleanoptional
Whether to exclude phone numbers requiring an address: `true` or `false`. Defaults to `false` when omitted.
ExcludeLocalAddressRequiredbooleanoptional
Whether to exclude phone numbers requiring a local address: `true` or `false`. Defaults to `false` when omitted.
ExcludeForeignAddressRequiredbooleanoptional
Whether to exclude phone numbers requiring a foreign address: `true` or `false`. Defaults to `false` when omitted.
Betabooleanoptional
Whether to include phone numbers new to the platform: `true` or `false`. Defaults to `true` when omitted.
NearNumberstringoptional
A phone number used to find geographically close numbers within the search distance. Must use phone-number format and applies only in the United States and Canada.
NearLatLongstringoptional
A `lat,long` coordinate pair used to find geographically close numbers; applies only in the United States and Canada.
Distanceintegeroptional
Search radius in miles for a near-number query. Can be up to 500 and defaults to 25 when omitted; applies only in the United States and Canada.
InPostalCodestringoptional
Postal code used to limit results; applies only in the United States and Canada.
InRegionstringoptional
Region, state, or province used to limit results; applies only in the United States and Canada.
InRateCenterstringoptional
Rate center used to limit results; requires `InLata` and applies only in the United States and Canada.
InLatastringoptional
Local access and transport area used to limit results; applies only in the United States and Canada.
InLocalitystringoptional
Locality or city used to limit results.
FaxEnabledbooleanoptional
Whether returned phone numbers can receive faxes: `true` or `false`.
PageSizeintegeroptional
Number of phone numbers to return per page. Must be between 1 and 1000, and defaults to 50 when omitted.
Pageintegeroptional
Page index used for client state. Must be zero or greater when supplied.
PageTokenstringoptional
API-provided token used to retrieve a subsequent page of phone numbers.

1 status code
200Returns a paginated collection of available local phone numbers, including phone number details, geographic information, address requirements, beta status, capabilities, and page metadata.
endintegeroptional
first_page_uristringoptional
next_page_uristringoptional
pageintegeroptional
page_sizeintegeroptional
previous_page_uristringoptional
startintegeroptional
uristringoptional
available_phone_numbersarray<object>optional

Error handling

AccountSid must be a 34-character SID matching the AC account pattern, and CountryCode must use the ISO 3166-1 country-code format. Contains must follow the documented 2-to-16-character pattern rules, PageSize must be between 1 and 1000, and Page must be zero or greater when supplied.