Tracking a ferry means turning an AIS identifier into a position you can trust, then presenting it alongside the vessel’s route and arrival information. By the end of this guide, you’ll know how to find a ferry, request its latest position and history, and build a dashboard that handles stale data and missing ETAs.
Find the right ferry before you track it
Start with GET /vessels/search when you have a ferry’s name but not its identifier. Search accepts a fuzzy name query as well as an IMO number or MMSI. A name search can return multiple vessels, so match the result against the particulars you know before saving an identifier for tracking.
Each result can include the vessel’s name, IMO, MMSI, flag, vessel type, dimensions and year built. The ship_type and flag filters can narrow the search, but check the Documentation for supported filter values before putting one in a request.
Search results are paginated through page and per_page, with a maximum of 100 results per page. Use the returned pagination fields to determine whether there are more matches. Once a user selects a ferry, retain its MMSI or IMO as a string: identifiers are keys, not quantities to calculate with.
The examples below use the documented MMSI 258785000. Confirm the identity and vessel type of any result before labeling it as a particular ferry in your application.
Request a position and interpret the response
Use GET /vessels/track for a vessel’s latest position, position history and voyage context. Supply either mmsi or imo; hours controls the requested history window, defaults to 24 and has a maximum of 168. Optional parameters can request route, predicted ETA and weather information.
This request asks for the documented vessel and a 48-hour history window. Replace YOUR_API_KEY with your key before running it:
curl -H "X-API-Key: YOUR_API_KEY" "https://vessels-api.com/api/V1/vessels/track?mmsi=258785000&hours=48"
The documented response is shown below. It is a sample response, not a statement that these are the vessel’s current coordinates.
{
"status": 200,
"success": true,
"message": "OK",
"data": {
"vessel": {
"imo": "9122556",
"mmsi": "258785000",
"name": null
},
"current_position": {
"latitude": 53.33708,
"longitude": 7.17993,
"position_precision": "precise",
"position_accuracy_nm": null,
"speed_knots": 0,
"course_degrees": 212,
"heading_degrees": null,
"navigational_status": 5,
"timestamp_utc": "2017-01-24T04:07:17+00:00",
"age_minutes": 5171660,
"destination": null,
"eta": null
},
"predicted_eta": null,
"position_history": [],
"route": {
"departure_port": "HERACLIO",
"departure_time": "2026-04-27T21:35:36+00:00",
"destination_port": "HERACLIO",
"eta": null,
"distance_nm": null,
"avg_speed_knots": 17.1
},
"last_port_visits": [
{
"port_id": "156",
"port_name": "EMDEN",
"arrival_time": "2026-07-30T13:00:10+00:00",
"departure_time": null,
"duration_hours": null
},
{
"port_id": "10",
"port_name": "HERACLIO",
"arrival_time": "2026-04-20T12:00:00+00:00",
"departure_time": "2026-04-23T08:00:00+00:00",
"duration_hours": 68
}
],
"weather": null
}
}
The outer envelope contains status, success, message and data. Read the vessel and tracking fields from data, and check both the HTTP outcome and the response’s success value before using them.
For a map, use current_position.latitude and longitude, but show timestamp_utc beside the marker. The sample position is old, even though the request succeeded. Its empty position_history also shows why asking for 48 hours of history does not guarantee that points will be available.
speed_knots is a speed in knots, while course_degrees and heading_degrees are separate fields and should not be treated as interchangeable. A speed of zero alone does not establish that a ferry has arrived at its intended berth. Route distance is expressed in nautical miles, and the position timestamp is UTC.
Expect missing values. In this sample, the name, destination, ETA, predicted ETA and weather are null. Render those as unavailable rather than as empty labels, zeroes or promises of arrival. Position, route and port-visit fields can also have different timestamps; avoid presenting them as though they were all observed simultaneously.
Call the same endpoint from Python
The following example uses Python’s standard library and the same URL and parameters as the cURL request. It reports the position timestamp and tolerates missing position fields without turning a null ETA into a fabricated value.
import json
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
url = (
"https://vessels-api.com/api/V1/vessels/track"
"?mmsi=258785000&hours=48"
)
request = Request(url, headers={"X-API-Key": "YOUR_API_KEY"})
try:
with urlopen(request, timeout=30) as response:
payload = json.load(response)
except HTTPError as exc:
raise SystemExit(f"API request failed with HTTP {exc.code}") from exc
except URLError as exc:
raise SystemExit(f"Network request failed: {exc.reason}") from exc
if not payload.get("success"):
raise SystemExit(f"API request was not successful: {payload.get('message')}")
data = payload.get("data") or {}
vessel = data.get("vessel") or {}
position = data.get("current_position") or {}
history = data.get("position_history") or []
print("MMSI:", vessel.get("mmsi"))
print("Name:", vessel.get("name") or "Unavailable")
print("Latitude:", position.get("latitude"))
print("Longitude:", position.get("longitude"))
print("Position time (UTC):", position.get("timestamp_utc"))
print("Speed (knots):", position.get("speed_knots"))
print("Destination:", position.get("destination") or "Unavailable")
print("ETA:", position.get("eta") or "Unavailable")
print("History points:", len(history))
In a production service, keep the API key out of source control and send requests from a trusted backend. Preserve the source timestamp when caching a response: the time your server fetched the data is not necessarily the time the ferry’s position was observed.
Build ferry fleet and port workflows
A single-vessel view is useful for passengers and dispatchers. For an operator managing several ferries, POST /vessels/fleet accepts a JSON body containing a vessels array, with an IMO or MMSI for each vessel. Set include_positions and, when needed, include_routes to request the corresponding fleet information.
The response includes fleet-level counts and a vessel list with identifiers, names, positions and routes. Use it to populate a fleet overview, then open the individual tracking view when an operator needs position history or more voyage context. Keep each position’s freshness visible rather than assuming every ferry in a batch was observed at the same moment.
For terminal operations, GET /port/activity provides recent arrivals and departures for a supplied port identifier. Its arrival entries include an MMSI, name, arrival time and origin; departure entries include an MMSI, name, departure time and destination. Match the MMSI to your ferry list to build a terminal activity feed.
Port activity and tracking answer different questions. A tracking position shows where a vessel was last observed; an activity entry describes a reported arrival or departure. For a passenger-facing ETA, distinguish a reported ETA from a predicted ETA, display the relevant timestamp when available, and provide an unavailable state when either value is null.
These workflows can support several practical views:
- Fleet dispatch: show each ferry’s last position, timestamp and available route alongside the fleet summary.
- Passenger information: display a ferry’s destination and ETA when supplied, with a clear indication that the position may be stale.
- Terminal operations: match recent port arrivals and departures to known ferry MMSIs.
- Voyage review: plot available history points without assuming the requested window contains a continuous track.
Vessels API uses the same base URL, https://vessels-api.com/api/V1, and X-API-Key header across these calls. The fleet endpoint is POST; search, track and port activity are GET. All responses use the same JSON envelope, so a shared client can handle common success and error paths.
Add emissions context and make the integration resilient
Ferry operators may also need an emissions view alongside operational tracking. GET /vessels/green accepts an IMO or MMSI and an optional period of 24h, 7d, 30d or 1y; the default is 30d. Its response includes distance, estimated CO₂ emissions and CII fields such as score, rating, year and regulation reference.
CII ratings run from A to E, with A the best rating. Present the selected period and the fact that emissions are estimated with the result; a tracking position by itself is not an emissions calculation. This gives an ESG team a useful starting point without confusing a live map marker with a compliance determination.
For reliable ferry dashboards, handle the documented error responses explicitly. A 400 indicates a missing or invalid parameter, 401 an invalid or missing key, 404 a vessel or port not found, and 422 an out-of-range parameter. Treat 429 as a signal to reduce request pressure, and handle 500 as a server error rather than displaying old data as newly observed.
Choose a refresh and caching policy that fits the application, and retain the last observation’s UTC timestamp in the interface. Global AIS coverage and near real-time refreshes are useful for tracking, but an individual position can still be delayed or unavailable. For tool-based workflows, MCP offers another way to work with Vessels API.
FAQ
Can I track a ferry using only its name?
Use vessel search to find candidates by name, then verify the vessel particulars and select an MMSI or IMO. The tracking endpoint requires one of those identifiers.
How much position history can I request?
The tracking endpoint defaults to 24 hours and accepts a maximum of 168 hours through hours. The returned history may contain fewer points than you expect, or be empty.
Does a successful response mean the position is live?
No. Check current_position.timestamp_utc and, when returned, age_minutes. A successful request can return an old last-known position, as the documented example demonstrates.
Can I track multiple ferries in one request?
Yes. Send their IMO or MMSI identifiers to POST /vessels/fleet and request positions or routes in the JSON body. Use individual tracking requests when you need a ferry’s detailed history.
What should I display when the ETA is null?
Show that the ETA is unavailable. Keep reported and predicted ETAs distinct, and avoid inferring an arrival time solely from the last position or speed.
Ready to build a ferry tracker? Register to start the seven-day free trial, then use the search and tracking workflow above to put a verified ferry on your map.