Technology
How do you look up a ship's IMO number, MMSI or call sign by API?
Source: Dev Community|
5 min read
The MMSI 209093000 belongs to the ferry Isle of Inishmore, IMO 9142605, call sign C4HQ2, flagged in Cyprus. One request to GET /v1/search/vessels?q=209093000 returned all four on 26 November 2026, in under a second. The same q parameter takes an IMO number, a call sign, an inland ENI number or a ship's name, and the response says which of them matched. The lookups below ran against the live API between 20:40 and 21:20 UTC that evening. Response times for single searches were 630 to 850 ms. Four identifiers and where each one comes from An AIS feed gives you the MMSI, the 9-digit number of the ship's radio. It changes when the ship changes flag. The IMO number is 7 digits and stays with the hull for life, so it is the key that charter parties and emissions records use. The call sign is the radio station's licence, and it shows up on documents and in AIS static messages. Inland vessels in Europe carry an ENI, the 8-digit European Number of Identification, in place of an IMO number. A lookup usually starts with whichever of these the source gave you and needs the IMO number at the end. One search parameter for every identifier q is matched against IMO, MMSI, ENI, call sign and name at once. The _meta.matchedOn field maps each result's position in the vessels array to the identifiers that matched it. curl -s "https://api.vesselapi.com/v1/search/vessels?q=9HA4880" \ -H "Authorization: Bearer $VESSELAPI_API_KEY" The response above is trimmed to the identifying fields. What each kind of input returned: Input Example Results matchedOn MMSI 209093000 1 IMO 9142605 Call sign 9HA4880 callsign ENI with leading zero 02332611 eni ENI without it 2332611 Full name DOVER SEAWAYS name EVER GIVEN 2 Single word SPIRIT 50, with more pages Unknown value NOSUCHSHIP12345 0 none An unknown value returns HTTP 200 with an empty vessels array, so code has to check the length and not the status. Names are matched without regard to case: ever given returned the same two records as EVER GIVEN. In Python the same call goes through the SDK (pip install vessel-api-python, tested with version 2.1.2): import os from vessel_api_python import VesselClient client = VesselClient(api_key=os.environ["VESSELAPI_API_KEY"]) found = client.search.vessels(q="209093000") matched = found.meta.matched_on if found.meta else {} for i, v in enumerate(found.vessels or []): print(v.name, v.imo, v.mmsi, v.call_sign, matched.get(str(i))) # ISLE OF INISHMORE 9142605 209093000 C4HQ2 ['mmsi'] Names that match more than one ship A name is the weakest of the identifiers. EVER GIVEN returned two records. IMO 9811000 is the 2018 container ship with MMSI 636026627. IMO 8320901 is a container ship built in 1986 under the same name whose record has no MMSI. MSC CATANIA also returned two, IMO 9073995 and IMO 9964247, with different MMSIs and flags. A single word matches every name that contains it. SPIRIT filled the first page of 50 and returned a nextToken for more, starting with Gillians Spirit, a US-flagged vessel with no IMO number. Search with the full name, and when more than one record comes back, choose by a second fact you already hold: the MMSI from the AIS message, the build year, or the presence of an MMSI at all. An IMO number copied from a document is worth validating before the lookup. Its seventh digit is a check digit. Multiply the first six digits by 7 down to 2 and add them up. The last digit of the sum must equal the seventh digit. def imo_is_valid(imo: str) -> bool: if len(imo) != 7 or not imo.isdigit(): return False total = sum(int(d) * w for d, w in zip(imo[:6], range(7, 1, -1))) return total % 10 == int(imo[6]) imo_is_valid("9142605") # True: 9*7 + 1*6 + 4*5 + 2*4 + 6*3 + 0*2 = 115 A valid check digit only proves the number is well formed. It does not prove a ship carries it. From a search result to the full vessel record Search results carry the identifiers. The static record for one ship comes from GET /v1/vessel/{id}, where filter.idType says whether the id is an imo or an mmsi: curl -s "https://api.vesselapi.com/v1/vessel/9318345?filter.idType=imo" \ For the ferry Dover Seaways it returned call sign MLBZ6, MMSI 235010500, type Ro-Ro/Passenger Ship, built 2006, 187 m by 29 m, gross tonnage 35,923, deadweight 6,874 t, home port Dover, and one former name, Maersk Dover, used until 2010. The former_names list is the field to check when a document names a ship that the search cannot find under its current name. The record has no position. The latest AIS position is a separate request to GET /v1/vessel/{id}/position, and port calls are in the port events endpoints. Each of the three is one API call. Ships with no IMO number IMO numbers are issued to seagoing merchant ships above a size threshold. Most of what moves in a harbour has none. Of the first 50 vessels a radius query returned within 8 km of 51.90 N, 4.40 E in Rotterdam, 37 had no IMO number in their record. We fetched the full record of 8 of those 37. Four were inland vessels with an ENI, among them the Belgian-flagged inland tanker Westzee, 135 m, ENI 02332611, which q found from the ENI with or without the leading zero and from its call sign OT5515. The other four, a pleasure craft, a small passenger boat and two harbour craft, had neither an IMO number nor an ENI, only an MMSI and a call sign. For these vessels the MMSI is the key, and GET /v1/vessel/{mmsi}?filter.idType=mmsi returns the record. Code that stores IMO numbers as the primary key needs a second path for them, or it drops most of the vessels in a harbour like this one. The search and vessel endpoints are part of the vessel database API, and their parameters are in the vessels documentation.