FreightTrackAPI

API Reference

The FreightTrackAPI REST API. All responses are JSON. Billed per API call.

Authentication

All API requests require an API key passed via the x-api-key header. You can create and manage keys in your dashboard.

curl https://api.freighttrackapi.com/track/2751234567 \
  -H "x-api-key: YOUR_API_KEY"

Base URL

https://api.freighttrackapi.com

Endpoints

MethodPathAuthDescription
GET/track/{bookingNumber}x-api-keyTrack by carrier booking or reference number
GET/NoneAPI info (name, version, environment)
GET/healthNoneHealth check

GET /track/{bookingNumber}

Resolves the carrier from the booking number format and returns voyage steps. Responses are cached for 24 hours.

Path parameters

ParameterTypeDescription
bookingNumberstringThe booking or reference number issued by the carrier (OOCL example: 2751234567)

Supported carriers

COSCO, Evergreen, Maersk, OOCL, ZIM, ANL, ONE, Shipco. The carrier is resolved automatically from the booking number format — no need to specify it.

Example request

curl https://api.freighttrackapi.com/track/2751234567 \
  -H "x-api-key: YOUR_API_KEY"

Example response

{
  "bookingNumber": "2751234567",
  "mode": "ocean",
  "carrier": "OOCL",
  "cached": false,
  "fetchedAt": "2024-11-01T08:00:00.000Z",
  "expiresAt": "2024-11-02T08:00:00.000Z",
  "steps": [
    {
      "stepIndex": 0,
      "modeOfTransport": "VESSEL",
      "vesselName": "OOCL EXAMPLE VESSEL",
      "voyageNumber": "042E",
      "portOfLoadingCode": "CNSHA",
      "portOfLoadingName": "Shanghai",
      "portOfDischargeCode": "USNYC",
      "portOfDischargeName": "New York",
      "etd": "2024-10-20T14:00:00.000Z",
      "eta": "2024-11-10T08:00:00.000Z"
    }
  ]
}

Response fields

FieldTypeDescription
bookingNumberstringThe booking number as provided
mode"ocean" | "air"Transport mode (currently always ocean)
carrierstringResolved carrier code (e.g. COSCO, MAERSK, ZIM)
cachedbooleantrue if this response was served from cache
fetchedAtISO 8601When the data was fetched from the carrier
expiresAtISO 8601When the cache entry expires (24h TTL)
stepsarrayOrdered voyage legs — see Step object below

Step object

FieldTypeDescription
stepIndexnumberZero-based leg index
modeOfTransport"VESSEL" | "TRUCK" | "RAIL" | "UNKNOWN"Transport mode for this leg
vesselNamestring | nullVessel name (when modeOfTransport is VESSEL)
voyageNumberstring | nullVoyage number
portOfLoadingCodestring | nullUN/LOCODE for port of loading
portOfLoadingNamestring | nullHuman-readable port of loading name
portOfDischargeCodestring | nullUN/LOCODE for port of discharge
portOfDischargeNamestring | nullHuman-readable port of discharge name
etdISO 8601 | nullEstimated time of departure
etaISO 8601 | nullEstimated time of arrival

Error codes

StatusDescription
400Bad request — unknown, ambiguous, or disabled carrier, or malformed booking number
401Unauthorized — missing or invalid x-api-key header
429Too Many Requests — rate limit exceeded
500Internal Server Error — upstream carrier error or unexpected failure

Error response shape

{
  "statusCode": 401,
  "message": "Unauthorized"
}

Billing & rate limits

FreightTrackAPI is billed per successful API call — you are only charged when the API returns a 2xx response.

Rate limits are enforced per API key. If you hit a 429, implement exponential backoff before retrying. Contact us at hello@freightapi.com if you need a higher limit.