You have an IMO code and need vessel data without manually searching maritime records. By the end of this guide, you can call the Vessel Traffic Information API with an IMO code, read the returned vessel details, and use port-based endpoints to look for related arrivals and vessel activity.
Getting started on Zyla API Hub
The Vessel Traffic Information API provides a direct IMO-code lookup alongside port-based vessel and traffic data. The lookup example returns the vessel’s name, ship type, flag, tonnage, dimensions and build year when those values are available. Port endpoints return current vessels, arrivals and departures, or expected arrivals for a supplied port ID.
On Zyla API Hub, open the API’s marketplace page and click Subscribe or Start Free Trial when available. Create a free account and obtain an API key, then send it as a bearer token when calling the Hub endpoint.
Access uses a subscription and quota rather than pay-per-call billing. The first API offers a 7-day trial or 50 requests; check the API page for current access options and pricing. The listing link at the end of this article is where you can start.
Look up a vessel by IMO code
Use Get Vessel Data by IMO Code for a direct lookup. It accepts a GET request with the imoCode query parameter. The following request uses the documented IMO code and the Hub URL:
curl -s -X GET "https://zylalabs.com/api/78/vessel-traffic-information-api/1509/get-vessel-data-by-imo-code?imoCode=9702510" \
-H "Authorization: Bearer YOUR_API_KEY"
Replace YOUR_API_KEY with your key. The documented response for this request is:
{
"status": 200,
"success": true,
"message": "IMO Code 9702510 is valid",
"data": {
"imo_number": "9702510",
"vessel_name": "ZJ ATLANTIC",
"ship_type": "Bulk Carrier",
"flag": "Liberia",
"gross_tonnage": "36332",
"summer_deadweight_t": null,
"length_overall_m": "199.90",
"beam_m": "32.26",
"year_of_built": null
}
}
The top-level success, status and message fields describe the result; vessel details are under data. The returned IMO number is a string, as are the populated tonnage and dimension values. The dimension field names specify metres, while summer_deadweight_t identifies tonnes.
Two values in this response are null. Treat them as unavailable rather than converting them to zero, and preserve the IMO number as a string when matching it against other records.
Call the same endpoint from Python
This example uses Python’s standard library. It checks the response’s success field and reads the vessel fields without assuming that the build year or deadweight is populated.
import json
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
url = "https://zylalabs.com/api/78/vessel-traffic-information-api/1509/get-vessel-data-by-imo-code?imoCode=9702510"
request = Request(
url,
headers={"Authorization": "Bearer YOUR_API_KEY"},
method="GET",
)
try:
with urlopen(request) as response:
payload = json.load(response)
except (HTTPError, URLError) as exc:
raise SystemExit(f"Request failed: {exc}")
if not payload.get("success"):
raise SystemExit(payload.get("message", "Vessel lookup was not successful"))
vessel = payload.get("data")
if not isinstance(vessel, dict):
raise SystemExit("Successful response did not include vessel data")
print("IMO:", vessel.get("imo_number"))
print("Name:", vessel.get("vessel_name"))
print("Type:", vessel.get("ship_type"))
print("Flag:", vessel.get("flag"))
print("Length (m):", vessel.get("length_overall_m"))
print("Beam (m):", vessel.get("beam_m"))
print("Summer deadweight (t):", vessel.get("summer_deadweight_t"))
print("Year built:", vessel.get("year_of_built"))
For production use, provide the key securely rather than committing it to source control. Validate any decimal conversion in your application and keep the original string if you need to preserve the precision returned by the API.
Use port data alongside an IMO lookup
The direct lookup starts with an IMO code. The following endpoints instead start with a port_id: use them when your workflow is centred on a port and you want to inspect vessel records for an IMO match. A port response is not a direct search by IMO code.
Port Activity
GET https://zylalabs.com/api/78/vessel-traffic-information-api/5309/port-activity
Port Activity returns arrival and departure activity for a port. It requires the string parameter port_id; the documented example uses 89. The optional string parameter page is shown as 1.
The supplied activity example includes an event array with event type, time, port, vessel name, country, MMSI and IMO fields. Some event records show --- for imo, so an event cannot always be matched by IMO code alone.
Port Expected Arrivals
GET https://zylalabs.com/api/78/vessel-traffic-information-api/5308/port-expected-arrivals
This endpoint returns vessels expected to arrive at a port. It requires the string parameter port_id; the documented request uses 89. It also accepts the optional string parameter page, shown as 1.
The documented response below is a separate example for AALBORG, with port ID 80; it should not be treated as the response to the request using port ID 89.
{"success":true,"status":200,"port":"AALBORG","id":"80","expected_arrivals":"3","page":"1","expected_arrivals_data":[{"name":"RIX PLATO","country":"LR","mmsi":"636018620","imo":"9139323","Port":"AALBORG","Estimated Arrival":"2024-12-05 23:34"},{"name":"CEMLUNA","country":"CY","mmsi":"209671000","imo":"9007063","Port":"AALBORG","Estimated Arrival":"2024-12-06 12:25"},{"name":"JULIETTE","country":"LR","mmsi":"636015461","imo":"9459113","Port":"AALBORG","Estimated Arrival":"2024-12-07 11:06"}]}
Read the vessel records from expected_arrivals_data. Each example record contains an imo, mmsi, vessel name and Estimated Arrival. The top-level expected_arrivals and page values are strings in this response.
Vessels in Port
GET https://zylalabs.com/api/78/vessel-traffic-information-api/5307/vessels-in-port
This endpoint retrieves vessels currently in the selected port. It requires the string parameter port_id; the documented example uses 69. The response can include a vessel’s name, MMSI or IMO code and other information.
{"success":true,"status":200,"port":"KOUFONISI","id":"69","vessel_in_port":"7","page":"1","vessels":[{"name":"KARAVAKI","country":"MT","mmsi":"256004814","imo":null,"arrived":"2026-05-29 15:09","DWT":"---","GRT":"---","Built":"---","Size":"21 m"},{"name":"IDIL412","country":"US","mmsi":"338238421","imo":null,"arrived":"2026-05-29 11:49","DWT":"---","GRT":"---","Built":"---","Size":"13 m"},{"name":"THALASSA","country":"NL","mmsi":"244110348","imo":null,"arrived":"2026-05-29 10:08","DWT":"---","GRT":"---","Built":"---","Size":"12 m"},{"name":"SEA ANGEL","country":"GB","mmsi":"235103676","imo":"9690676","arrived":"2026-05-29 08:06","DWT":"---","GRT":"---","Built":"---","Size":"13 m"},{"name":"PEREGRINE I","country":"AU","mmsi":"503039630","imo":null,"arrived":"2026-05-29 07:54","DWT":"---","GRT":"---","Built":"---","Size":"16 m"},{"name":"JUST US OF LONDON","country":"GB","mmsi":"232059396","imo":null,"arrived":"2026-05-28 13:35","DWT":"---","GRT":"---","Built":"---","Size":"19 m"},{"name":"CALICO JACK","country":"GR","mmsi":"240613900","imo":null,"arrived":"","DWT":"---","GRT":"---","Built":"---","Size":"14 m"}]}
Inspect the vessels array for matches. This response shows why a parser must handle both a string IMO and null: only one of the example vessels has a populated IMO. It also contains --- values and an empty arrived string, which should remain distinct from actual measurements or timestamps.
Build a reliable maritime workflow
For a vessel detail screen, start with the direct IMO lookup and show vessel_name, ship_type, flag and available dimensions. Display missing values explicitly instead of filling them with zeros. If your application also has a port ID, port records can add context without changing the meaning of the vessel lookup.
For an arrivals dashboard, use Port Expected Arrivals and match populated imo values against vessels your application tracks. Keep the estimated arrival separate from the arrived field returned by Vessels in Port and from the Time field in Port Activity: they describe different kinds of information.
The sample timestamps are date-and-time strings, but the supplied examples do not specify a timezone. Preserve the returned value and confirm its timezone before converting it or scheduling notifications. Likewise, the examples show a page parameter for Port Activity and Port Expected Arrivals; they do not establish a pagination parameter for Vessels in Port, even though its response contains a page field.
Choose cache lifetimes according to your application’s needs. Vessel characteristics and port activity serve different purposes, so avoid assuming that a cached vessel profile also represents current port activity. Account for subscription quota when deciding how often to refresh port data.
Call the API from an AI agent
Zyla API Hub exposes its APIs to compatible agents through MCP. Configure Claude Code, Cursor, Windsurf or another MCP-compatible client with the endpoint below, replacing the key placeholder with your API key:
https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY
For an IMO lookup, give the agent the code and ask it to retrieve the vessel data. Review the returned fields just as you would in a direct integration: an agent should not interpret null values as measurements or claim that a port record contains an IMO when it does not.
FAQ
Can I get vessel details directly from an IMO code?
Yes. Get Vessel Data by IMO Code uses the imoCode query parameter and returns vessel details under data in the documented successful response.
Does every port record include an IMO code?
No. The Vessels in Port example contains both populated and null IMO values, while the Port Activity example includes --- for some IMO values. Plan for records that cannot be matched by IMO alone.
Are port arrival timestamps in a documented timezone?
The supplied examples show timestamp strings but do not specify a timezone. Confirm the timezone before converting those values or using them to trigger time-sensitive actions.
Can I paginate every port endpoint?
The documented request parameters include optional page values for Port Activity and Port Expected Arrivals. The documented Vessels in Port request only specifies port_id.
Create a free Zyla API Hub account, check the current access options and pricing, and get an API key from the marketplace workflow. Start 7-day trial on Vessel Traffic Information API.