Skip to main content

Quickstart - Advanced Number Search

| cURL | Python | Node | Ruby |


cURL

This quickstart will cover what you need to know about performing advanced number searches for US/CA numbers, or any number that begins with the country code +1. See here to check if that includes the country/territory you desire. For details on how to search any other international numbers follow our International Number Search & Order guide.

To show all available filters, see the full documentation here

Request Sample

Note

Check out the Development Environment Setup guide to acquire your API Key and set up a Telnyx SDK if applicable.

curl -X GET \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--globoff "https://api.telnyx.com/v2/available_phone_numbers?filter[country_code][]=US&filter[locality][]=Chicago&filter[administrative_area][]=IL&filter[features][]=sms&filter[limit][]=2"
Note

Sample results can vary depending on the available numbers at a given moment.

{
"data": [
{
"best_effort": false,
"cost_information": {
"currency": "USD",
"monthly_cost": "1.00000",
"upfront_cost": "1.00000"
},
"features": [
{
"name": "fax"
},
{
"name": "voice"
},
{
"name": "sms"
}
],
"phone_number": "+18728880024",
"record_type": "available_phone_number",
"region_information": [
{
"region_name": "US",
"region_type": "country_code"
},
{
"region_name": "IL",
"region_type": "state"
},
{
"region_name": "CHICAGO ZONE 02",
"region_type": "rate_center"
}
],
"reservable": false,
"vanity_format": null
},
{
"best_effort": false,
"cost_information": {
"currency": "USD",
"monthly_cost": "1.00000",
"upfront_cost": "1.00000"
},
"features": [
{
"name": "fax"
},
{
"name": "voice"
},
{
"name": "sms"
}
],
"phone_number": "+18728880026",
"record_type": "available_phone_number",
"region_information": [
{
"region_name": "US",
"region_type": "country_code"
},
{
"region_name": "IL",
"region_type": "state"
},
{
"region_name": "CHICAGO ZONE 02",
"region_type": "rate_center"
}
],
"reservable": false,
"vanity_format": null
}
],
"metadata": {
"best_effort_results": 0,
"total_results": 2
},
"url": "/v2/available_phone_numbers"
}

Python

This quickstart will cover what you need to know about performing advanced number searches.

To show all available filters, see the full documentation here

Check out the Development Environment Setup guide to set up the Telnyx Python SDK and your development environment for this guide.

import telnyx

telnyx.api_key = "YOUR_API_KEY"

response = telnyx.AvailablePhoneNumber.list(
filter={"coutry_code": "US", "locality": "Chicago", "administrative_area": "IL", "features": ["sms"], "limit": 2}
)

print(response)
Note

Sample result can vary depending on the available numbers at a given moment.

{
"data": [
{
"best_effort": false,
"cost_information": {
"currency": "USD",
"monthly_cost": "1.00000",
"upfront_cost": "1.00000"
},
"features": [
{
"name": "fax"
},
{
"name": "voice"
},
{
"name": "sms"
}
],
"phone_number": "+18728880024",
"record_type": "available_phone_number",
"region_information": [
{
"region_name": "US",
"region_type": "country_code"
},
{
"region_name": "IL",
"region_type": "state"
},
{
"region_name": "CHICAGO ZONE 02",
"region_type": "rate_center"
}
],
"reservable": false,
"vanity_format": null
},
{
"best_effort": false,
"cost_information": {
"currency": "USD",
"monthly_cost": "1.00000",
"upfront_cost": "1.00000"
},
"features": [
{
"name": "fax"
},
{
"name": "voice"
},
{
"name": "sms"
}
],
"phone_number": "+18728880026",
"record_type": "available_phone_number",
"region_information": [
{
"region_name": "US",
"region_type": "country_code"
},
{
"region_name": "IL",
"region_type": "state"
},
{
"region_name": "CHICAGO ZONE 02",
"region_type": "rate_center"
}
],
"reservable": false,
"vanity_format": null
}
],
"metadata": {
"best_effort_results": 0,
"total_results": 2
},
"url": "/v2/available_phone_numbers"
}

Node

This quickstart will cover what you need to know about performing advanced number searches.

To show all available filters, see the full documentation here

Check out the Development Environment Setup guide to set up the Telnyx node SDK and your development environment for this guide.

import Telnyx from 'telnyx';

const telnyx = new Telnyx("YOUR_API_KEY");

const { data : availablePhoneNumbers } = await telnyx.availablePhoneNumbers.list({
filter: {
"country_code": "US",
"locality": "Chicago",
"administrative_area": "IL",
"features": ["sms"],
"limit": 2
}
});

Note

Sample result can vary depending on the available numbers at a given moment.

{
"data": [
{
"best_effort": false,
"cost_information": {
"currency": "USD",
"monthly_cost": "1.00000",
"upfront_cost": "1.00000"
},
"features": [
{
"name": "fax"
},
{
"name": "voice"
},
{
"name": "sms"
}
],
"phone_number": "+18728880024",
"record_type": "available_phone_number",
"region_information": [
{
"region_name": "US",
"region_type": "country_code"
},
{
"region_name": "IL",
"region_type": "state"
},
{
"region_name": "CHICAGO ZONE 02",
"region_type": "rate_center"
}
],
"reservable": false,
"vanity_format": null
},
{
"best_effort": false,
"cost_information": {
"currency": "USD",
"monthly_cost": "1.00000",
"upfront_cost": "1.00000"
},
"features": [
{
"name": "fax"
},
{
"name": "voice"
},
{
"name": "sms"
}
],
"phone_number": "+18728880026",
"record_type": "available_phone_number",
"region_information": [
{
"region_name": "US",
"region_type": "country_code"
},
{
"region_name": "IL",
"region_type": "state"
},
{
"region_name": "CHICAGO ZONE 02",
"region_type": "rate_center"
}
],
"reservable": false,
"vanity_format": null
}
],
"metadata": {
"best_effort_results": 0,
"total_results": 2
},
"url": "/v2/available_phone_numbers"
}

Ruby

This quickstart will cover what you need to know about performing advanced number searches.

To show all available filters, see the full documentation here

Check out the Development Environment Setup guide to set up the Telnyx ruby SDK and your development environment for this guide.

require "telnyx"

Telnyx.api_key = "YOUR_API_KEY"

response = Telnyx::AvailablePhoneNumber.list(
filter: {
coutry_code: "US",
locality: "Chicago",
administrative_area: "IL",
features:["sms"], limit: 2
}
)

puts response
Note

Sample result can vary depending on the available numbers at a given moment.

{
"data": [
{
"best_effort": false,
"cost_information": {
"currency": "USD",
"monthly_cost": "1.00000",
"upfront_cost": "1.00000"
},
"features": [
{
"name": "fax"
},
{
"name": "voice"
},
{
"name": "sms"
}
],
"phone_number": "+18728880024",
"record_type": "available_phone_number",
"region_information": [
{
"region_name": "US",
"region_type": "country_code"
},
{
"region_name": "IL",
"region_type": "state"
},
{
"region_name": "CHICAGO ZONE 02",
"region_type": "rate_center"
}
],
"reservable": false,
"vanity_format": null
},
{
"best_effort": false,
"cost_information": {
"currency": "USD",
"monthly_cost": "1.00000",
"upfront_cost": "1.00000"
},
"features": [
{
"name": "fax"
},
{
"name": "voice"
},
{
"name": "sms"
}
],
"phone_number": "+18728880026",
"record_type": "available_phone_number",
"region_information": [
{
"region_name": "US",
"region_type": "country_code"
},
{
"region_name": "IL",
"region_type": "state"
},
{
"region_name": "CHICAGO ZONE 02",
"region_type": "rate_center"
}
],
"reservable": false,
"vanity_format": null
}
],
"metadata": {
"best_effort_results": 0,
"total_results": 2
},
"url": "/v2/available_phone_numbers"
}