Overview
Telecom Lookup Tools

List Local Numbers

This function will allow you to list all phone numbers in a specific ratecenter and state.

Post/ Get Information

URL:

https://apiv1.teleapi.net/dids/list?token=XXXXXXX

Argument

Required

Type

state

yes

string

ratecenter

yes

string

search

no

int

--

--

--

npa

no

int

Simply send us a GET/POST to the above URL to get an API response with the list of numbers, just pass state=[abbreviated_state] and ratecenter=[ratecenter]. Response codes are in the menu to the left. You can also search by area code (npa) instead of ratecenter and state.

shell
PHP+CURL
PHP+PLAIN
RESPONSE
shell

Shell/CURL

curl -v -X GET "https://apiv1.teleapi.net/dids/list?token=XXXX&state=CA&ratecenter=LSAN%20DA01"
PHP+CURL

Using PHP+CURL

<?php
$data = array("state" => "CA",
"ratecenter" => "LSAN DA01"
);
$data = http_build_query($data);
$baseurl = "https://apiv1.teleapi.net/dids/states?token=XXXX&state=CA";
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$retval = curl_exec($ch);
curl_close($ch);
$object = json_decode($retval);
print_r($object);
PHP+PLAIN

PHP - file_get_contents

<?php
$data = array("state" => "CA",
"ratecenter" => "LSAN DA01"
);
$data = http_build_query($data);
$url = "https://apiv1.teleapi.net/dids/states?token=XXXX&".$data;
$x = file_get_contents($url);
$object = json_decode($x);
print_r($object);
RESPONSE

Possible System Responses from List Numbers

Successful Number Listing

{
"code": 200,
"status": "success",
"data": {
"dids": [
{
"id": 222,
"npa": 555,
"nxx": 555,
"xxxx": 5555,
"number": 5555555555,
"ratecenter": "BLARG",
"state": "CO",
"setup_rate":"0.000000",
"monthly_rate":"0.790000",
"per_minute_rate":"0.006000"
},
{
"id": 333,
"npa": 555,
"nxx": 555,
"xxxx": 5554,
"number": 5555555554,
"ratecenter": "BLARG",
"state": "CO",
"setup_rate":"0.000000",
"monthly_rate":"0.790000",
"per_minute_rate":"0.006000"
}
]}
"count": 2
}

Sample Error

{
"code": 400,
"status": "error",
"data": "Missing variable: token"
}