---
title: "Calculate sea route between two points"
method: GET
path: "/api/ext/route"
tags: ["Sea Routes"]
---

# Calculate sea route between two points

`GET /api/ext/route`

## Request

- Base URL: `https://api.datalastic.com`
- URL: `https://api.datalastic.com/api/ext/route`
- Auth: one of:
  - API key in header `x-api-key`
  - API key in query parameter `api-key`
- TypeScript: <https://skmtc.dev/datalastic/apis/datalastic-maritime-api/docs/api/ext/route/get.ts> (a function with typed inputs; its response is checked against the schema)

Calculates the optimal navigable sea route between two points. Each
endpoint can be given as coordinates, a port UUID, or a port UN/LOCODE.
Returns a GeoJSON LineString with waypoints and the total distance in
nautical miles.

Uses the extended base URL `https://api.datalastic.com/api/ext/`.

**Credit cost:** 1 credit per request. Requires an Add-Ons plan tier.

## Query parameters

- `port_unlocode_from` string
- `port_uuid_from` string, uuid
- `lat_from` number, float
- `lon_from` number, float
- `port_unlocode_to` string
- `port_uuid_to` string, uuid
- `lat_to` number, float
- `lon_to` number, float

## Response `200`

Calculated route with waypoints and total distance.

- object
  - `data` object
    - `distance_nm` number, float: Total route distance in nautical miles.
    - `waypoints` object[]
      - `lat` number, float
      - `lon` number, float
  - `meta` Meta
    - `duration` number, float: Server-side query time in seconds.
    - `endpoint` string
    - `success` boolean
    - `next` string: Pagination token. Present on paginated endpoints (`/vessel_find`) only when more results exist. Pass it back as the `next` query parameter to fetch the following page.

## Other responses

- `400`: Missing required parameter or invalid parameter value.
- `401`: Invalid or expired API key.
- `402`: API key is valid but the credit balance is exhausted or the subscription has expired. Purchase more credits to continue.
- `404`: Requested vessel, port, or resource was not found. No credits deducted.
- `429`: More than 600 API calls in a single minute. The response carries a `Retry-After` header with the wait in seconds. Use it for backoff.
- `500`: Server-side error. Retry the request.

## Changes

- **2026-09-08** `a29cf323d1c3`: 1 warning, 9 info
  - deleted the `query` request parameter `api-key`
  - added the new optional `query` request parameter `port_uuid_from`
  - added the new optional `query` request parameter `port_uuid_to`
  - added the media type `application/json` for the response with the status `401`
  - …6 more
- **2026-05-12** `0b2f634e7f91`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/datalastic/apis/datalastic-maritime-api/changes/api/ext/route/get.md)

---

[API](https://skmtc.dev/datalastic/apis/datalastic-maritime-api.md) - [All operations](https://skmtc.dev/datalastic/apis/datalastic-maritime-api/llms.txt) - [OpenAPI document](https://skmtc.dev/datalastic/apis/datalastic-maritime-api/revisions/2097cdbffcb4?raw)
