Search

Search for phone number records by state, carrier, rate center, or other criteria

The search endpoint allows you to find phone number records matching various criteria.

Endpoint

GET /v1/search

Authentication

Requires API key via one of:

  • Authorization: Bearer <key> header (recommended)
  • X-API-Key header
  • apiKey query parameter

See Authentication for details.

Query Parameters

ParameterTypeRequiredDescription
statestringNo2-letter state/province code (e.g., CA, ON)
countrystringNoCountry code: US or CA
ocnstringNo4-character Operating Company Number
carrierstringNoPartial carrier name match (case-insensitive)
rate_centerstringNoPartial rate center name match (case-insensitive)
statusstringNoNumber status: ASSIGNED, UNASSIGNED, RESERVED
limitintegerNoNumber of results per page (default: 50, max: 100)
offsetintegerNoNumber of results to skip for pagination (default: 0)
ℹ️ At Least One Filter Required

You must provide at least one search parameter (state, country, ocn, carrier, rate_center, or status).

Request Examples

Search by State

curl -H "Authorization: Bearer your-api-key" \
  "https://api.telco.dev/v1/search?state=CA"

Search by Carrier Name

curl -H "Authorization: Bearer your-api-key" \
  "https://api.telco.dev/v1/search?carrier=verizon"
curl -H "Authorization: Bearer your-api-key" \
  "https://api.telco.dev/v1/search?state=CA&carrier=wireless&limit=20"

Search Canadian Numbers

curl -H "Authorization: Bearer your-api-key" \
  "https://api.telco.dev/v1/search?country=CA&state=ON"

Response

Success Response (200 OK)

{
  "results": [
    {
      "npa": "415",
      "nxx": "200",
      "ocn": "7500",
      "company_name": "AT&T WIRELESS",
      "rate_center": "SAN FRANCISCO",
      "state": "CA",
      "country": "US",
      "status": "ASSIGNED"
    },
    {
      "npa": "415",
      "nxx": "201",
      "ocn": "9740",
      "company_name": "PACIFIC BELL",
      "rate_center": "SAN FRANCISCO",
      "state": "CA",
      "country": "US",
      "status": "ASSIGNED"
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "total": 12453
  }
}

Response Fields

FieldTypeDescription
resultsarrayList of matching NPA-NXX records
results[].npastring3-digit area code
results[].nxxstring3-digit exchange code
results[].ocnstringOperating Company Number
results[].company_namestringCarrier/company name
results[].rate_centerstringRate center name
results[].statestringState/province code
results[].countrystringCountry code
results[].statusstringAssignment status
pagination.limitintegerNumber of results requested
pagination.offsetintegerNumber of results skipped
pagination.totalintegerTotal matching records

Error Responses

Invalid Request (400)

No search parameters provided:

{
  "error": "invalid_request",
  "message": "At least one search parameter is required"
}

Code Examples

JavaScript

async function searchRecords(params) {
  const searchParams = new URLSearchParams(params);

  const response = await fetch(
    `https://api.telco.dev/v1/search?${searchParams}`,
    {
      headers: {
        "Authorization": `Bearer ${process.env.TELCO_API_KEY}`
      }
    }
  );

  if (!response.ok) {
    const error = await response.json();
    throw new Error(error.message);
  }

  return response.json();
}

// Find all VoIP carriers in New York
const voipNY = await searchRecords({
  state: "NY",
  carrier: "voip"
});

console.log(`Found ${voipNY.pagination.total} VoIP exchanges in NY`);

Python

import requests
import os

def search_records(**params):
    response = requests.get(
        "https://api.telco.dev/v1/search",
        params=params,
        headers={"Authorization": f"Bearer {os.environ['TELCO_API_KEY']}"}
    )
    response.raise_for_status()
    return response.json()

# Find all T-Mobile exchanges in California
result = search_records(state="CA", carrier="t-mobile")
print(f"Found {result['pagination']['total']} T-Mobile exchanges in CA")

Use Cases

Find All Carriers in a State

async function getCarriersInState(state) {
  const result = await searchRecords({ state, limit: 1000 });

  // Extract unique carriers
  const carriers = new Set();
  result.results.forEach(r => {
    if (r.company_name) {
      carriers.add(r.company_name);
    }
  });

  return Array.from(carriers).sort();
}

const caCarriers = await getCarriersInState("CA");
console.log(`${caCarriers.length} unique carriers in California`);

Count Exchanges by Rate Center

async function countByRateCenter(state) {
  const result = await searchRecords({ state, limit: 1000 });

  const counts = {};
  result.results.forEach(r => {
    const rc = r.rate_center || "Unknown";
    counts[rc] = (counts[rc] || 0) + 1;
  });

  return Object.entries(counts)
    .sort((a, b) => b[1] - a[1])
    .slice(0, 10);
}

const topRateCenters = await countByRateCenter("CA");
console.log("Top 10 rate centers:", topRateCenters);