Get started →
API reference

AvailablePhoneNumbers API

Search the inventory of phone numbers available to provision, filtered by country, type, and area code.

GET/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/{Type}

Return numbers available in a country. {CountryCode} is an ISO 3166-1 alpha-2 code (e.g. NG). {Type} is local, mobile, or toll_free.

ParameterTypeDescription
AreaCode optionalstringFilter by area code / prefix.
Contains optionalstringFilter by digits contained in the number.
Page optionalinteger0-indexed page.
PageSize optionalintegerRecords per page (max 1000).

Response

{
  "available_phone_numbers": [
    {
      "friendly_name": "(201) 555-0123",
      "phone_number": "+23412000000",
      "locality": "Lagos",
      "region": "LA",
      "iso_country": "NG",
      "capabilities": { "voice": true, "sms": true },
      "price": "5000.00",
      "price_unit": "NGN"
    }
  ],
  "uri": "/2010-04-01/Accounts/AC…/AvailablePhoneNumbers/NG/Local"
}

With the SDK

const numbers = await client.availablePhoneNumbers.list({
  countryCode: "NG",
  type: "local",
  areaCode: "1",
});

for (const n of numbers.available_phone_numbers) {
  console.log(n.phone_number, n.locality, n.price);
}

Once you find a number, provision it with IncomingPhoneNumbers.