grandline

Compare Routes

Returns all four route variants between two ports side-by-side so the caller can compare distance, canal transits, and steaming time.

Each row in grandline.port_distances already carries pre-computed distances for all four variants (primary / via_suez / via_panama / via_cape), so a single SELECT delivers the full comparison.

The "canonical" pair is chosen as the row with the shortest primary distance — variants that are NULL on that row (not all pairs have all four variants populated) come back as distance_nm: null.

recommended is the name of the shortest non-null variant — usually "primary" by definition, but the field is dynamic so future routing enhancements (sanctions filters, vessel class restrictions) can shift it without breaking the response schema.

post/api/v1/routes/compare

Request

  • Base URL: https://grandline.luzomi.com
  • URL: https://grandline.luzomi.com/api/v1/routes/compare
  • Auth: none declared

Query parameters

string required
OR
integer required
string required
OR
integer required

Response

Successful Response

origin_port_idinteger required
origin_port_namestring required
destination_port_idinteger required
destination_port_namestring required
origin_latnumber nullable
origin_lonnumber nullable
destination_latnumber nullable
destination_lonnumber nullable
recommendedstring required

Changes

No recorded changes to this operation across all 1 revision of this API.