---
title: "Get trace of vessel"
method: GET
path: "/vessel/v2/trace"
tags: ["Trace"]
---

# Get trace of vessel

`GET /vessel/v2/trace`

This endpoint returns the historical trace of a given vessel between two dates in the past. The successive positions of the vessel are retrieved from AIS and processed to determine the geometry and route statistics. 

### Vessel information 
The vessel can be identified either by its `imo` number or its `mmsi`. In the case both are given, the `mmsi` will be taken into account. 

### Dates
This endpoint takes two dates for the beginning and the end of the trace. Both are required and can be passed using the ISO 8601 format (`departureDateTime` and `arrivalDateTime`) or the unix time in milliseconds (`departure` and `arrival`).

### Response
The response is a Geojson `FeatureCollection`. The trace is represented as a `Feature` : its geometry is a MultiLineString (cut at the antimeridian if crossed) and its properties give information about the route (distance, areas crossed, average speed).
Total distance + distances in Seca zones and HRA are returned.
Note that the average speed is computed for the entire trace. If the vessel stops multiple days, the average speed can be low.

## Query parameters

- `imo` integer, required
- `mmsi` integer
- `departureDateTime` string, required
- `departure` number
- `arrivalDateTime` string, required
- `arrival` number

## Response `200`

OK

## Other responses

- `400` — Bad request
- `404` — Not found
- `503` — Service is unavailable.

---

[API](https://skmtc.net/searoutes/apis/geocoding.md) · [All operations](https://skmtc.net/searoutes/apis/geocoding/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/searoutes/geocoding/versions/59f769fc4f39/schema)
