Carriers
List and look up carrier information by Operating Company Number (OCN)
The carriers endpoints let you list all carriers or look up detailed information about a specific carrier.
Endpoints
GET /v1/carriers
GET /v1/carrier/:ocn
GET /v1/carrier?ocn=:ocn
Authentication
Requires API key via one of:
Authorization: Bearer <key>header (recommended)X-API-KeyheaderapiKeyquery parameter
See Authentication for details.
List All Carriers
Endpoint
GET /v1/carriers
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
country | string | No | Filter by country: US or CA |
state | string | No | Filter by state/province code |
type | string | No | Filter by carrier type |
limit | integer | No | Number of results per page (default: 50, max: 100) |
offset | integer | No | Number of results to skip for pagination (default: 0) |
Request Example
curl -H "Authorization: Bearer your-api-key" \
"https://api.telco.dev/v1/carriers?country=US&limit=20"
Response (200 OK)
{
"carriers": [
{
"ocn": "7500",
"company_name": "AT&T WIRELESS",
"common_name": "AT&T",
"carrier_type": "WIRELESS",
"state": "GA",
"country": "US"
},
{
"ocn": "9740",
"company_name": "PACIFIC BELL TELEPHONE COMPANY",
"common_name": "AT&T",
"carrier_type": "ILEC",
"state": "CA",
"country": "US"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"total": 2847
}
}
Get Carrier by OCN
Endpoint
GET /v1/carrier/:ocn
GET /v1/carrier?ocn=:ocn
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ocn | string | Yes | 4-character Operating Company Number |
Request Examples
# Using path parameter
curl -H "Authorization: Bearer your-api-key" \
"https://api.telco.dev/v1/carrier/9740"
# Using query parameter
curl -H "Authorization: Bearer your-api-key" \
"https://api.telco.dev/v1/carrier?ocn=9740"
Response (200 OK)
{
"ocn": "9740",
"company_name": "PACIFIC BELL TELEPHONE COMPANY",
"common_name": "AT&T",
"carrier_type": "ILEC",
"state": "CA",
"country": "US",
"exchanges": {
"total": 3247,
"by_state": {
"CA": 3247
}
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
ocn | string | Operating Company Number |
company_name | string | Full legal company name |
common_name | string | Common/trade name (if different) |
carrier_type | string | Type of carrier (see below) |
state | string | Primary state/province |
country | string | Country code |
exchanges.total | integer | Total exchanges owned |
exchanges.by_state | object | Exchange count by state |
Carrier Types
| Type | Description |
|---|---|
ILEC | Incumbent Local Exchange Carrier (e.g., AT&T, Verizon) |
CLEC | Competitive Local Exchange Carrier |
WIRELESS | Mobile/cellular carrier |
CAP | Competitive Access Provider |
IXC | Interexchange Carrier |
PCS | Personal Communications Service |
Error Responses
Invalid Request (400)
Missing or invalid OCN:
{
"error": "invalid_request",
"message": "Missing required parameter 'ocn' (4-character Operating Company Number). Usage: /v1/carrier?ocn=XXXX"
}
{
"error": "invalid_request",
"message": "Invalid 'ocn' parameter: '974'. Must be exactly 4 alphanumeric characters."
}
Not Found (404)
OCN not found:
{
"error": "not_found",
"message": "Carrier not found: XXXX"
}
Code Examples
JavaScript
// List all carriers
async function listCarriers(options = {}) {
const params = new URLSearchParams(options);
const response = await fetch(
`https://api.telco.dev/v1/carriers?${params}`,
{
headers: {
"Authorization": `Bearer ${process.env.TELCO_API_KEY}`
}
}
);
return response.json();
}
// Get carrier by OCN
async function getCarrier(ocn) {
const response = await fetch(
`https://api.telco.dev/v1/carrier/${ocn}`,
{
headers: {
"Authorization": `Bearer ${process.env.TELCO_API_KEY}`
}
}
);
return response.json();
}
// Usage
const wireless = await listCarriers({ type: "WIRELESS", limit: 10 });
console.log(`Found ${wireless.pagination.total} wireless carriers`);
const att = await getCarrier("9740");
console.log(`${att.company_name} has ${att.exchanges.total} exchanges`);
Python
import requests
import os
def list_carriers(**params):
response = requests.get(
"https://api.telco.dev/v1/carriers",
params=params,
headers={"Authorization": f"Bearer {os.environ['TELCO_API_KEY']}"}
)
response.raise_for_status()
return response.json()
def get_carrier(ocn):
response = requests.get(
f"https://api.telco.dev/v1/carrier/{ocn}",
headers={"Authorization": f"Bearer {os.environ['TELCO_API_KEY']}"}
)
response.raise_for_status()
return response.json()
# Usage
wireless = list_carriers(type="WIRELESS", country="US")
print(f"Found {wireless['pagination']['total']} US wireless carriers")
verizon = get_carrier("6006")
print(f"{verizon['company_name']}: {verizon['exchanges']['total']} exchanges")
Use Cases
Find Largest Carriers
async function getLargestCarriers(limit = 10) {
// Get all carriers (paginate if needed)
const result = await listCarriers({ limit: 1000 });
// This is simplified - in practice you'd use the exchanges.total from individual carrier lookups
// or aggregate from a full data export
return result.carriers.slice(0, limit);
}
Get All Carriers in a State
async function getCarriersInState(state) {
const result = await listCarriers({ state, limit: 1000 });
return result.carriers;
}
const caCarriers = await getCarriersInState("CA");
console.log(`${caCarriers.length} carriers operating in California`);