Last Free Day (LFD) via API

The Last Free Day (LFD) is one of the most operationally important data points we provide. Here's how to consume it from our API and use it in your application.

Last Free Day (LFD) fields to use

OpenTrack reports three different LFD fields:

  1. lastFreeDay = applies only to the ocean port terminal
  2. lastFreeDayAtRailFacility = applies only to the final rail facility
  3. lineLastFreeDay = the LFD provided by the steamship line (ocean carrier). Can apply to either the ocean port terminal or the final rail facility.

How to use them

If in doubt, you can default to displaying all LFDs reported on a container. We’ve found that logistics professionals prefer having more information rather than less.

However, you may want to provide a more streamlined experience—and we don’t blame you. We do this too! We use logic to display a smart Destination LFD, which only shows the most relevant, actionable LFD value. Here’s how you can replicate this.

How to build a smart destination LFD

The logic is pretty simple:

  1. If the container has "isRailMove":"true", then use the earliest of lastFreeDayAtRailFacility or lineLastFreeDay
  2. If the container has "isRailMove":"false", then use the earliest of lastFreeDay or lineLastFreeDay

This will ensure you use the relevant LFD for the container’s destination. If it’s moving by rail, you don’t want to rely on the ocean port terminal LFD.

It also ensures that when multiple sources report a relevant LFD, you’re displaying the earliest one to be conservative. For example, if both the steamship line and the rail carrier report an LFD, and the line’s is earlier, you’ll want to use that—all else being equal.

Where LFD comes from

Click here to see our coverage map for each of the Last Free Day types:

Other questions? Don’t hesitate to reach out to us.