Search for Purchasable Phone Numbers

This endpoint lets you search for phone numbers by area code (NPA), area code and exchange (NPA-NXX), state, or rate center.

Endpoint

GET /available-tns/tns/

Request Parameters

  • limit
    integer

    Limits the number of items to retrieve. A maximum of 200 items can be retrieved.

  • page
    integer

    Displays the page set by the number in this field. For example, if 2 were entered, page 2 would display in the response.

  • npa
    integer

    Restricts the results to the specified area code. For example, this might be 206.

  • nxx
    integer

    Restricts the results to phone numbers in the specified exchange.

  • ratecenter
    string

    Restricts the results to phone numbers in the specified rate center.

  • state
    string

    Restricts the results to phone numbers in the specified state. Optional unless a ratecenter is specified.

  • tn
    string

    Searches for phone numbers that match a specified string. This field must be an exact match of a phone number in E164 formatting. e.g., 12066408000.

Response Parameters

  • tns

    Object composed of a phone number and the details of that phone number.

  • phone number

    The retrieved phone number object, which is composed of:

    • initial_cost - The one-time fixed cost for that phone number. The default value is USD 1.00.

    • monthly_cost - The recurring monthly cost to maintain that phone number. The default value is USD 1.25.

    • state - The US state or Canadian province or territory in which the NPANXX is located.

    • ratecenter - The ratecenter associated with the NPANXX.

    • billing_methods - Displays the billing methods available for the phone number. This will always be METERED, which are unlimited concurrent calls, each billed per-minute used.

Example Request

This assumes that you have the Python API Wrapper installed and set up.

#Instantiate the Controller
pnc = PurchasablePhoneNumbersController()

#Search for Purchasable Phone Numbers
response = pnc.search(limit=1,npa=206,nxx=743,page=1,ratecenter='SEATTLE',state='WA',tn=None)

                        

Example Request

This assumes that you have the PHP API Wrapper installed and set up.

#Instantiate the Controller
$pnc = new PurchasablePhoneNumbersController();

#Search for Purchasable Phone Numbers
$response = $pnc->search(1,206,743,1,SEATTLE,WA,null);

                        

Example Request

This assumes that you have the Ruby API Wrapper installed and set up.

#Instantiate the Controller
pnc = FlowrouteNumbers::PurchasablePhoneNumbersController.new()

#Search
response = pnc.search(limit:1, npa:206, nxx:743, page:1, ratecenter:"SEATTLE", state:"WA", tn:nil)

                    

Example Request

This assumes that you have the Node.js API Wrapper installed and set up.

/*
1. Load the Numbers v1 SDK and Node.js util module
2. Declare flowroutenumberslib path relative to your JS file
*/
var flowroute = require('./flowroutenumberslib'); 
var util = require('util');

//Define your callback function
var cb =  function(err, response){
  if(err){
   console.log(err);
   }
       console.log(util.inspect(response, false, null));
};

//Search
flowroute.PurchasablePhoneNumbersController.search(1,206,743,1,"SEATTLE","WA",null,cb);

                        

Example Response

200 OK

#Note: The following response is formatted for clarity only.
{
  "data": [
    {
      "next": "/v1/available-tns/tns/?npa=206&nxx=743&state=WA&ratecenter=SEATTLE&limit=1&page=2"
    },
    {
      "12067439165": {
        "initial_cost": "1.00",
        "monthly_cost": "1.25",
        "state": "WA",
        "ratecenter": "SEATTLE",
        "billing_methods": [
          "VPRI",
          "METERED"
        ]
      }
    }
  ]
}