---
title: "Port calls of one IMO across MMSI changes. Each MMSI counts only while it reported this IMO (±10 min)"
method: GET
path: "/v1/vessels/imo/{imo}/port-calls"
---

# Port calls of one IMO across MMSI changes. Each MMSI counts only while it reported this IMO (±10 min)

`GET /v1/vessels/imo/{imo}/port-calls`

## Request

- Base URL: `https://api.aistrail.com`
- URL: `https://api.aistrail.com/v1/vessels/imo/{imo}/port-calls`
- Auth: HTTP bearer

## Path parameters

- `imo` integer, required

## Query parameters

- `from` string, date-time
- `to` string, date-time
- `event` 'any' | 'arrival' | 'departure'
- `format` 'json' | 'csv' | 'xlsx'
- `zones` 'port' | 'anchorage' | 'all'
- `layout` 'calls' | 'events'
- `limit` integer
- `cursor` string

## Response `200`

Port calls; each row carries its mmsi

- object
  - `meta` PortCallMeta
    - `from` string, date-time
    - `to` string, date-time
    - `event` 'any' | 'arrival' | 'departure'
    - `layout` 'calls' | 'events': calls: one row per port call; events: ENTER_ZONE / EXIT_ZONE rows (the layout parameter)
    - `zones` 'port' | 'anchorage' | 'all': Which zones the rows cover (the zones parameter)
    - `count` integer
    - `complete` boolean: true when there are no more pages (paging only; see data_complete)
    - `next_cursor` string, nullable: Pass as ?cursor= to get the next page
    - `next` string, nullable: Relative URL of the next page
    - `embargo_cutoff` string, date-time, nullable: Data newer than this is not available on your plan (null on plans with live data)
    - `calls_through` object: Per source: port calls are built from this source's data up to this time (the archive is processed nightly), never later than embargo_cutoff
    - `private_vessels` 'excluded' | 'included': Whether private vessels are part of this response for your account
    - `attribution` object[]: Required attribution for the sources in this response
    - `sanctions_lists` SanctionsLists: The sanctions lists checked for this response: per list its publication date, when AIS Trail fetched it and how many vessels it names (stale: the last fetch failed, the previous copy is used), plus a note
      - `lists` object
      - `note` string
    - `notice` string: Not-for-navigation notice (also in the X-Notice header)
  - `port_calls` PortCall[]
    - `mmsi` integer
    - `imo` integer, nullable: IMO number reported at arrival; otherwise filled from one consistent report of the same MMSI within 30 days, preferring a report with the vessel's name and then the closest in time (all filled fields from the same report); left empty when the MMSI is ambiguous
    - `name` string, nullable: Vessel name reported at arrival; otherwise filled from one consistent report of the same MMSI within 30 days, preferring a report with the vessel's name and then the closest in time (all filled fields from the same report); left empty when the MMSI is ambiguous
    - `ship_type` integer, nullable: AIS ship type reported at arrival; otherwise filled from one consistent report of the same MMSI within 30 days, preferring a report with the vessel's name and then the closest in time (all filled fields from the same report); left empty when the MMSI is ambiguous
    - `flag` string, nullable: ISO 3166-1 alpha-2 flag code derived from the MMSI
    - `port` object, nullable
      - `id` integer: Port id: the World Port Index number for WPI ports; ports listed only in UN/LOCODE have ids from 10,000,000
      - `name` string
      - `country` string, nullable: ISO 3166-1 alpha-2 country code
      - `locode` string, nullable: UN/LOCODE, e.g. NLRTM
    - `arrival` string, date-time: Start of the first stop of at least 15 minutes inside the port area
    - `departure` string, date-time, nullable: Last position inside the port area before the vessel left; null while it is still in port (or after embargo_cutoff)
    - `duration_s` integer, nullable: departure minus arrival, seconds
    - `draught_arrival_m` number, nullable: Draught reported at arrival, metres
    - `draught_departure_m` number, nullable: Draught reported at departure, metres
    - `draught_change_m` number, nullable
    - `cargo_estimate` 'loaded' | 'ballast' | 'unchanged' | 'null', nullable: From the draught change: loaded (deeper by 0.3 m or more), ballast (shallower by 0.3 m or more), unchanged; null when a draught is unknown
    - `previous_port` object, nullable: The vessel's previous port call (id, name, country, locode, departure), at most 30 days before arrival; null when unknown
    - `next_port` object, nullable: The vessel's next port call (id, name, country, locode, arrival), at most 30 days after departure; null when unknown
    - `zone` 'port' | 'anchorage': port: a call inside the port area; anchorage: a wait at the port's anchorage (zones)
    - `sources` string[]: Data sources the port call was detected in. pelyr: detected from positions of a source the API does not serve otherwise (see the sources page); imo, name, ship_type and draughts never come from it, and meta.attribution then carries its credit
    - `sanctions` string[]: Sanctions lists that name this row's IMO number (empty when none; CSV: joined with |). Informational, not a compliance determination: see Sanctions lists in the docs
  - `events` PortCallEvent[]: With layout=events, instead of port_calls
    - `mmsi` integer
    - `imo` integer, nullable
    - `name` string, nullable
    - `ship_type` integer, nullable
    - `flag` string, nullable
    - `event` 'ENTER_ZONE' | 'EXIT_ZONE'
    - `ts` string, date-time: arrival (ENTER_ZONE) or departure (EXIT_ZONE)
    - `draught_m` number, nullable: Draught reported at arrival or departure
    - `port` object: id, name, country, locode; for an anchorage the name ends in ' Anch.'
    - `zone` 'port' | 'anchorage'
    - `sanctions` string[]: Sanctions lists that name this row's IMO number (empty when none; CSV: joined with |). Informational, not a compliance determination: see Sanctions lists in the docs

## Other responses

- `400`: RFC 9457 problem details
- `401`: RFC 9457 problem details
- `402`: RFC 9457 problem details
- `403`: RFC 9457 problem details
- `429`: RFC 9457 problem details
- `503`: RFC 9457 problem details

---

[API](https://skmtc.dev/aistrail/apis/ais-trail-api.md) · [All operations](https://skmtc.dev/aistrail/apis/ais-trail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/aistrail/apis/ais-trail-api/revisions/e829e4345208?raw)
