📍Get Shipment Location

How to retrieve shipment location with container tracking API?

Get shipment coordinates

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.

If the container is currently onboard a vessel, the coordinates will reflect the vessel position. If it is not, they will reflect the last know position of the container (usually its last location)

"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.

AIS position

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.

Events and status

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
    }
  ]
}

Complete list of Event codes and Status are available in the documentation : https://developers.sinay.ai/docs/container-tracking