Order Local Phone Number

Searches and order available local numbers by location criteria.

For more information about Bandwidth’s local phone numbers, see the FAQ

Request URL


Supported Parameters

Parameter Description Mandatory
city A city name. No
state A two-letter US state abbreviation ("CA" for California). **
zip A 5-digit US ZIP code. **
areaCode A 3-digit telephone area code. **
localNumber It is defined as the first digits of a telephone number inside an area code for filtering the results. It must have at least 3 digits and the areaCode field must be filled. ***
inLocalCallingArea Boolean value to indicate that the search for available numbers must consider overlayed areas. Only applied for localNumber searching. ***
quantity The maximum number of numbers to return (default 10, maximum 5000). No
pattern A number pattern that may include letters, digits, and the following wildcard characters:
? : matches any single digit
* : matches zero or more digits
Don't forget to encode wildcard characters in the requested URL.

Example 1 of 1: Search and allocate for city/state

To search and order two available local numbers in the city of Cary, North Carolina, make the following request

curl -v -X POST  https://api.catapult.inetwork.com/v1/availableNumbers/local?city=Cary&state=NC&quantity=2 \
  -u {token}:{secret}
// Search 2 available local phone numbers with area code 910 and order them

// Promise
client.AvailableNumber.searchAndOrder("local", { areaCode : "910", quantity : 2 }).then(function (numbers) {});

// Callback
client.AvailableNumber.serchAndOrder("local", { areaCode : "910", quantity : 2 }, function (err, numbers) {});
var results = await client.AvailableNumber.SearchAndOrderLocalAsync(
  new LocalNumberQueryForOrder{ AreaCode = "910", Quantity = 2});
var firstResult = results.First();
var number = firstResult.Number;
var numberId = firstResult.Id;
Console.WriteLine($"{numberId} - {number}");
// n-123456 - +1234567890
results = AvailableNumber.search_and_order_local(client, {area_code: '910', quantity: 2})
first_result = results.next
number = first_result[:number]
number_id = first_result[:id]

The above command returns a 201 response JSON structured like this:

        "number": "{number1}",
        "nationalNumber": "{national_number1}",
        "price": "0.60",
        "location": "https://.../v1/users/.../phoneNumbers/{numberId1}"
        "number": "{number2}",
        "nationalNumber": "{national_number2}",
        "price": "0.60",
        "location": "https://.../v1/users/.../phoneNumbers/{numberId2}"

results matching ""

    No results matching ""