Calculate Sea Route
Get the sailing route between two or more points, navigating around land
Endpoint
Description
Calculates the actual sea route between coordinates, navigating around coastlines and islands. Uses GSHHG coastline data with A* pathfinding for accurate maritime routing.
Supports both simple point-to-point routes and multi-waypoint routes. Long routes are automatically split into segments and stitched together.
Responses are cached for 24 hours.
Authentication
No authentication required. This is a public endpoint.
Query Parameters
Use either from+to or waypoints, not both.
| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | Yes* | Origin as longitude,latitude |
to | string | Yes* | Destination as longitude,latitude |
waypoints | string | Yes* | Multiple points as lon,lat|lon,lat|... (min 2) |
* Provide either from+to or waypoints.
Example Requests
Point to Point
Multi-Waypoint
Example Response
Returns a GeoJSON Feature with a LineString geometry.
Response Properties
| Property | Type | Description |
|---|---|---|
distance_km | number | Total route distance in kilometers |
distance_nm | number | Total route distance in nautical miles |
waypoints | number | Number of coordinates in the route geometry |
tiles_used | string[] | Coastline tiles used for pathfinding |
total_iterations | number | A* algorithm iterations |
segments | number | Number of route segments (multi-waypoint only) |
fallback_segments | number | Segments that used straight-line fallback (if any) |
compute_ms | number | Computation time in milliseconds |
fallback | boolean | true if straight-line fallback was used (single segment) |
Coverage
Currently covers the Ionian Sea (Greece):
- Longitude: 19°E to 22°E
- Latitude: 37°N to 40°N
- Resolution: ~550 meters
Requests outside this region will return an error.
Fallback Behavior
If no sea route can be found (e.g., points are on land or in enclosed bodies of water), the API returns a straight-line route with properties.fallback: true.