Companies
Find supported carriers, their SCAC codes, and tracking types
GET /v2/companies lists supported carriers, their SCAC codes, and available tracking number types. Use it to choose company and type for single-number and batch requests.
The data field contains an object whose keys are company names and whose values are { scac, cn, bl, bk, availability }. Pass the scac value as company. The cn, bl, and bk flags indicate the tracking types supported by each carrier:
| Support flag | type value | Tracking number |
|---|---|---|
cn | container | Container number |
bl | bl | Bill of lading number |
bk | bk | Booking number |
A flag set to true means that tracking type is supported. Use a carrier SCAC code or company=AUTO for automatic carrier detection. Both options support containers, bills of lading, and bookings, with an explicit or omitted number type.
The availability field provides status for each type: cn, bl, bk contain { active, deactivated_at }. active: false means that type has a registered parser deactivation, and deactivated_at is its UTC timestamp. Active types have deactivated_at: null; disabled types can also have null if the timestamp is unknown.
Unsupported types return null. For AUTO, all three types contain { active: true, deactivated_at: null }: automatic detection remains available when an individual carrier is disabled. This does not guarantee that every carrier parser is operational. The cn/bl/bk support flags remain unchanged during temporary deactivation. Disabling bill of lading tracking does not disable container tracking for the same carrier.
The list refreshes every two minutes. Core checks actual availability, so a request may still return LINE_IS_UNDER_MAINTENANCE after an active: true response. Try again later; there is no need to change the SCAC code because of this status.
Request example
The example retrieves the companies list, selects carriers that support bill of lading tracking (bl: true), and prints their names and SCAC codes.
// Find carriers that support bill of lading tracking.
const res = await fetch("https://tracking.timetocargo.com/v2/companies?api_key=YOUR_TOKEN", {
headers: { Accept: "application/json" },
});
// Check the HTTP response before using the result.
if (!res.ok) throw new Error(`HTTP ${res.status}`);
// Read JSON; success and status describe the request result.
const body = await res.json();
if (body.success === false) throw new Error("Request failed");
// Select only carriers that support bills of lading.
const typeFlag = { container: "cn", bl: "bl", bk: "bk" };
const carriers = Object.entries(body.data)
.filter(([, flags]) => flags[typeFlag.bl])
.map(([name, flags]) => ({ name, scac: flags.scac }));
console.log(carriers);For HTTP status and API result handling, see Error handling.
Last updated on