How to retrieve shipment location using Container Tracking API ?

Shipment location is available at different points in the API response:

If you are trying to locate a shipment and possibly get an updated location regularly until its arrival, here are the response points that you can use:

  1. If you are interested in container location in a geographical sense (to integrate container movement on a map for example), we recommend using data contained in the Coordinates point of the response. This is the current position of the container.
    "routeData": {
    "routeSegments": [
    {
    "path": [
    {
    "lat": 29.76328,
    "lng": -95.36327,
    "updatedAt": null
    },

    {
    "lat": 53.551052,
    "lng": 8.570912,
    "updatedAt": null
    },
    {
    "lat": 53.53615,
    "lng": 8.59298,
    "updatedAt": null
    }
    ],
    "routeType": "SEA"
    }
    ],
    "coordinates": {
    "lat": 47.08643,
    "lng": -11.237754,

    The previous listed positions show the progress of the shipment throughout its journey, which is useful to display said journey on a map.

  2. You can also use the position contained in “Last Vessel Position” of the AIS response (if the AIS status is “OK”.
    Note that you can check the “updatedat” of the AIS response to determine if the position is sufficiently up to date to your liking.
   "ais": {
"status": "OK",
"data": {
"lastEvent": {
"description": "Vessel departure",
"date": "2023-11-11T07:09:00Z",
"voyage": "344E"
},
"dischargePort": null,
"vessel": {
"name": "MAERSK OHIO",
"imo": 9298698,
"callSign": "KABP",
"mmsi": 367775000,
"flag": "US"
},
"lastVesselPosition": {
"lat": 51.28157,
"lng": 4.253457,
"updatedAt": "2023-11-28T10:28:00Z"

What is the difference between the “Last Vessel Position” and “Coordinates”? Last Vessel Position comes from AIS data which is satellite geopositioning. Coordinates comes from the data of the Sealine.

 

If you are interested in locating a shipment based on its events and movements, we recommend using Container Events and Status:

For a quick status check, you can use the Metadata response point.

{
"metadata": {
"shipmentType": "CT",
"shipmentNumber": "MSKU0496560",
"sealine": "MAEU",
"sealineName": "Maersk",
"shippingStatus": "IN_TRANSIT",
"updatedAt": "2023-11-28T11:24:59Z"

For more in depth information, we recommend using shipment events: 

{
"number": "MSKU0496560",
"isoCode": "45G1",
"status": "IN_TRANSIT",
"events": [
{
"location": {
"name": "Houston",
"state": "Texas",
"country": "United States",
"countryCode": "US",
"locode": "USHOU",
"coordinates": {
"lat": 29.76328,
"lng": -95.36327,
"updatedAt": null
},
"timezone": "America/Chicago"
},
"facility": {
"name": "Houston Barbours Cut Terminal",
"countryCode": "US",
"locode": "USUQF",
"bicCode": "USUQFGDQQ",
"smdgCode": null,
"coordinates": {
"lat": null,
"lng": null,
"updatedAt": null
}
},
"description": "Gate out",
"eventType": "EQUIPMENT",
"eventCode": "GTOT",
"status": "CEP",
"date": "2023-11-07T11:16:00Z",
"isActual": true,
"isAdditionalEvent": false,
"routeType": "LAND",
"transportType": null,
"vessel": null,
"voyage": null
},

See complete list of status here : 

List of possible Status:
CEP - Container Empty to Shipper
CPS - Container Pickup at Shipper
CGI - Container Arrival at first POL (Gate In)
CLL - Container Loaded at first POL
VDL - Vessel Departure from first POL
VAT - Vessel Arrival at T/S Port
TSD - Transhipment Delay
CLT - Container Loaded at T/S Port
VDT - Vessel Departure from T/S Port
VAD - Vessel Arrival at Final POD
CDD - Container Discharge at final POD
CGO - Container Departure from final POD (Gate Out)
CDC - Container Delivery to Consignee
CER - Container Empty Return to Depot
LTS - Land Transhipment
BTS - Barge Transhipment
UKN - Unknown (default value)

See complete event code list here : 

Event Codes for TRANSPORT:
ARRI - ARRIVED
DEPA - Departed
Event Codes for EQUIPMENT:
LOAD - Loaded
DISC - Discharged
GTIN - Gated In
GTOT - Gated Out
STUF - Stuffed
STRP - Stripped
PICK - Pick-Up
AVPU - Available for Pick Up
DROP - Drop Off
AVDO - Available for Drop Off
INSP - Inspected
RSEA - Resealed
RMVD - Removed
CUSS - Customs Selected for Scan
CUSI - Customs Selected for Inspection
CUSR - Customs Released
CROS - Crossed
Event Codes for SHIPMENT
RECE - Received
DRFT - Drafted
PENA - Pending Approval
PENU - Pending Update
PENC - Pending Confirmation
CONF - Confirmed
REJE - Rejected
APPR - Approved
ISSU - Issued
SURR - Surrendered
SUBM - Submitted
VOID - Void
REQS - Requested
CMPL - Completed
HOLD - On Hold
RELS - Released
CANC - Cancelled