List Available Exchanges

This endpoint returns a list of all Numbering Plan Area (NPAs) NXXs, which are area codes and exchanges containing purchasable phone numbers. All request parameters are optional. If you don't specify a limit, results are limited to the first 10 items.

Endpoint

GET /available-tns/npanxxs/

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.

Example Request

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

#Instantiate the Controller
pnc = PurchasablePhoneNumbersController()

#List Available NPA NXXs
response = pnc.list_area_and_exchange(limit=2,npa=203,page=3)

                        

Example Request

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

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

#List Available NPA NXXs
$response = $pnc->listAreaAndExchange(2,203,3);

                        

Example Request

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

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

#List NPA and NXX
response = pnc.list_area_and_exchange(limit:2, npa:203, page:3)

                    

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));
};
//List Area and Exchange
flowroute.PurchasablePhoneNumbersController.listAreaAndExchange(2,203,3,cb);

                        

Example Response

200 OK

#Note: The following response is formatted for clarity only.
{
  "data": [
    {
      "203774": {
        "tns": "/v1/available-tns/tns/?npa=203&nxx=774"
      },
      "203916": {
        "tns": "/v1/available-tns/tns/?npa=203&nxx=916"
      }
    },
    {
      "prev": "/v1/available-tns/npanxxs/?npa=203&limit=2&page=2",
      "next": "/v1/available-tns/npanxxs/?npa=203&limit=2&page=4"
    }
  ]
}