Docs

API reference

Every endpoint, parameter and field of the AIS Trail API. Base URL https://api.aistrail.com. New here? Start with the Quickstart. The machine-readable contract is openapi.json (OpenAPI 3.1).

Conventions

  • Authentication. Send your key on every request: Authorization: Bearer ap_live_…. Keys are created in your dashboard. Data endpoints never accept the key in the URL. Call the API from your server or scripts: browsers on other websites are not allowed to call it directly (CORS), and a key in browser code would be public. /v1/status, /v1/sources and /v1/openapi.json need no key.
  • Units. Times are ISO 8601 in UTC (responses end in Z); a date alone means midnight UTC and a time without an offset is read as UTC. Speeds in knots, angles in degrees, positions in decimal degrees.
  • Embargo. On Free and Starter, the most recent 24 hours are not available: a later to is clamped and meta.embargo_cutoff says where. Pro and Business include live data: there is no embargo and embargo_cutoff is null.
  • Not for navigation. AIS data can be missing, delayed or wrong; do not use it for navigation, collision avoidance, search and rescue or any other safety-of-life purpose. Every data response repeats this in meta.notice and the X-Notice header.
  • Credits. Data responses use credits, counted from what they return; empty results and errors use none. Credits are shared by all keys of your account; when none are left, data endpoints answer 402 Out of credits.
  • Rate limits. Each key may send up to your plan's requests per second (Free 1, Starter 5, Pro 10, Business 20), with short bursts up to twice that; above it you get 429 Rate limited with Retry-After: 1. Requests without a valid key are limited to 5 per second per IP address.
  • Concurrency. At most 2 requests per key are processed at a time; a third gets 429. While your account has fewer than 100,000 credits left, at most 2 metered requests per account (all keys together) are processed at a time. A query that runs longer than the server limit is stopped with 503: narrow the box or the time range.
  • HTTPS only. Plain HTTP GET and HEAD requests are redirected (301) to HTTPS; other methods and ws:// WebSocket connections get 403 HTTPS required.
  • Errors. RFC 9457 problem details. Every status and title is listed on Errors.

Plan limits

PlanCredits / monthRequests / secondHistoryArea queriesRows per pageLive data
Free5001Last 7 daysNot included1,000Not included
Starter15,0005Up to 12 monthsUp to 2° × 2°50,000Not included
Pro60,00010Up to 12 monthsUp to 2° × 2°50,000Included, 2 WebSocket connections
Business250,00020Up to 24 monthsUp to 10° × 10°50,000Included, 5 WebSocket connections

Prices are in the pricing section; they are in US dollars and exclude VAT or sales tax. To subscribe, see Upgrade and pay. On Free, from may be at most 7 days in the past, on Starter and Pro at most 12 months and on Business at most 24 months (403 History limit otherwise; older data is offered through Enterprise on request, as a one-off file delivery). History reaches back only as far as each source's archive: about 12 months for dma, kystverket and noaa (up to 24 months on Business), from October 2026 for digitraffic and from November 2026 for barentswatch. noaa ends on 30 June 2026, the latest day the source has published. Dates for every region and product are on the Coverage page (see also Data sources).

Longest range per request

resolutionWhat you getLongest from–to range
raw (default)Every fix, as received24 hours
1mThe latest real fix per vessel per minute7 days
1hThe latest real fix per vessel per hour366 days

Nothing is interpolated. A longer range returns 400 Window too large: split it into several requests or use a coarser resolution.

Credits

Usage is measured in credits, counted from what a response returns:

RequestCredits
Historical track1 credit per vessel-day: all positions of one vessel on one UTC day
Area query1 credit per distinct vessel-day in the rows returned
Vessel details, batch, IMO lookup, search1 credit per vessel returned
Port calls1 credit per port-call record
Vessel events1 credit per event record
Live position (REST)1 credit per vessel returned
Vessel density or sea depth at a point1 credit per point with a value
Vessel density by area1 credit per started square degree of the box
Submarine cables near a point1 credit per cable returned
Live WebSocket streamIncluded in Pro and Business, no credits
Status, sources, usage, docsFree
  • What is free. Empty results and errors (4xx, 5xx) use no credits. /v1/status, /v1/sources, /v1/openapi.json, /v1/usage and the WebSocket stream never do, and port lookups (/v1/ports, /v1/ports/{port_id}) use none either.
  • Paging. A track page that continues the vessel-days of the previous page does not charge them again; area queries count the vessel-days of each page.
  • Monthly credits and packs. Each plan includes monthly credits (Plan limits). They renew every billing period of your subscription, every month on the same day and time also when you pay yearly, and every calendar month (UTC) on Free. Unused monthly credits do not carry over. A credit pack ($49, one-time, any plan) adds 20,000 credits valid for 12 months; packs add up and are used after the monthly credits, the pack that expires first before the others.
  • When credits run out. Credits are taken after a successful response. With none left, data endpoints answer 402 Out of credits before running the query; the body carries credits_reset_at and pricing_url. A response never uses more credits than you have left, less the credits held by your other requests still running (from any of your keys), so requests running at the same time cannot together use more than your balance. When that is less than a full page would use, the page is cut short (each row or record uses at most 1 credit): track, area, port call and event pages continue with next_cursor, search with next_offset, a batch lists the rest in not_returned, and IMO lookups and live positions set truncated. With no credits free while other requests run, a new request gets 429 until they finish.
  • Headers. Responses from endpoints that use credits carry X-Credits-Used and X-Credits-Remaining (see Response headers); /v1/usage has the full balance.

Endpoints

EndpointWhat it answersKey
GET /v1/vessels/searchSearch vessels by name, call sign, MMSI prefix or IMORequired
GET /v1/vessels/{mmsi}Vessel identity by MMSI: current static data and observation logRequired
GET /v1/vessels/batchVessel details for up to 100 MMSIs and IMO numbers in one requestRequired
GET /v1/vessels/imo/{imo}MMSIs that have reported this IMO number, newest firstRequired
GET /v1/vessels/{mmsi}/trackTrack of one MMSI over a time rangeRequired
GET /v1/vessels/imo/{imo}/trackTrack of one ship by IMO number, across MMSI changesRequired
GET /v1/areaHistorical positions inside a bounding box (Starter, Pro and Business plans)Required
GET /v1/vessels/{mmsi}/port-callsPort calls of one MMSI over a time rangeRequired
GET /v1/vessels/imo/{imo}/port-callsPort calls of one ship by IMO number, across MMSI changesRequired
GET /v1/ports/{port_id}/callsArrivals, departures and port calls at one portRequired
GET /v1/ports/{port_id}/expectedVessels expected at one port, from the port's own records (Pro and Business plans)Required
GET /v1/port-callsPort calls across ports by port, country, UN/LOCODE or box (Starter, Pro and Business plans)Required
GET /v1/portsSearch ports by name, country, UN/LOCODE or boxRequired
GET /v1/ports/{port_id}One port by idRequired
GET /v1/vessels/{mmsi}/eventsPort arrivals and departures, stops and moves, changes of name, IMO, call sign, destination, draught or flag, AIS gaps, close encounters and position jumpsRequired
GET /v1/vessels/imo/{imo}/eventsThe same events for one ship by IMO number, across MMSI changesRequired
GET /v1/densityVessel traffic density at a point, from open data products (European waters)Required
GET /v1/density/areaVessel traffic density statistics for a box (Starter, Pro and Business plans)Required
GET /v1/bathymetrySea depth at a pointRequired
GET /v1/cablesSubmarine cables near a point (NOAA charts and NVE power cables)Required
GET /v1/cables/{cable_id}/vesselsLive vessels near a submarine cable (Pro and Business)Required
GET /v1/positionsLatest live positions inside a bounding box (Pro and Business)Required
GET /v1/vessels/{mmsi}/positionLatest live position of one vessel (Pro and Business)Required
/v1/streamLive positions over WebSocket (Pro and Business)Required
GET /v1/usagePlan, limits and credits (uses no credits)Required
GET /v1/sourcesData sources, licenses, required attribution and coverage (public)Not needed
GET /v1/statusService status and data coverage per source (public)Not needed
GET /v1/openapi.jsonThis API as an OpenAPI 3.1 document (public)Not needed
POST /mcpMCP server for AI assistants: live ship tools, and tracks and port calls with a keyOnly for the archive tools

Vessels

GET /v1/vessels/{mmsi}

Vessel identity by MMSI: current static data and observation log.

Response: mmsi, current (latest known imo, name, callsign, ship_type, length_m, width_m, draught_m, destination, eta), first_seen, last_seen and observations: the distinct static reports the vessel has sent (up to 50, newest first), each with its first_seen, last_seen and sources; flag and dwt_estimate (see Vessel particulars; the estimate uses the latest dimensions and the deepest draught in all of the vessel's reports); sanctions, the official lists that name the current IMO number (see Sanctions lists). The response also has a live_position field: the vessel's latest live position on Pro and Business (live data, live sources open to customers only), null otherwise. meta (see Response meta) attributes all of the vessel's reports, not only the 50 listed. Without access to private vessels, a private vessel answers 404 like a vessel never seen (see Private vessels).

Passing a 7-digit IMO number here returns 400 with the IMO URL to use instead.

NameInTypeRequired / defaultDescription
mmsipathintegerrequired9-digit MMSI

Status codes: 200, 400, 401, 402, 404, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/vessels/276859000"

GET /v1/vessels/batch

Vessel details for up to 100 MMSIs and IMO numbers in one request.

Pass mmsi, imo or both as comma-separated lists, at most 100 identifiers in all. Each entry of results carries query (the identifier you asked for, {"mmsi": …} or {"imo": …}), the vessel's mmsi, its latest imo, name, callsign, ship_type, length_m, width_m, draught_m, destination and eta, first_seen, last_seen, sources, flag, dwt_estimate and sanctions (see Vessel particulars and Sanctions lists). An IMO number resolves to the MMSI that reported it last; for an IMO you asked for, sanctions also covers that IMO number when the MMSI now reports a different one. Identifiers with no vessel in the sources of your plan are listed in not_found; private vessels without access are listed there too, like vessels never seen. Results come in the order asked, MMSIs first. One credit per vessel returned; a vessel asked for twice counts once.

NameInTypeRequired / defaultDescription
mmsiquerystringoptionalComma-separated 9-digit MMSIs
imoquerystringoptionalComma-separated IMO numbers with a valid check digit; mmsi and imo together at most 100

Status codes: 200, 400, 401, 402, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/vessels/batch?mmsi=276859000,219024000&imo=9892690"

GET /v1/vessels/imo/{imo}

MMSIs that have reported this IMO number, newest first.

Ships change MMSI when they change flag. This lists every MMSI that has reported this IMO number, with the period (first_seen, last_seen), name, callsign, sources, flag and dwt_estimate (a new MMSI usually comes with a new flag, so the list shows the ship's flag history); newest first, at most 50 (truncated is true beyond that), plus sanctions, the official lists that name this IMO number (see Sanctions lists), and meta (see Response meta). The IMO number must have a valid check digit.

NameInTypeRequired / defaultDescription
imopathintegerrequired7-digit IMO number with a valid check digit

Status codes: 200, 400, 401, 402, 404, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/vessels/imo/9892690"

Vessel particulars

Two particulars are derived by AIS Trail from what the vessels broadcast, at no extra credit cost. Search results, the vessel lookup and IMO matches carry both as objects; track, area and port call rows carry the flag code only (flag, the last CSV column).

  • Flag (flag). The first three digits of a ship station's MMSI are its Maritime Identification Digits (MID), which the ITU allocates to a country or territory. We map them to an ISO 3166-1 alpha-2 code and an English name with the ITU table of MIDs. This is the flag of the ship station's radio licence: usually the registry flag, but not always (a vessel that changes flag can keep its old MMSI for a while, and some MMSIs are entered wrongly). MMSIs that are not ship stations get null: coast stations, search and rescue aircraft (111…), AIS-SART, man-overboard and EPIRB devices (970, 972, 974), craft associated with a parent ship (98…), aids to navigation (99…), handheld radios (8…), unallocated MIDs and placeholder numbers such as 111111111. MID 306 is shared by three Caribbean territories and reported as CW.
  • Estimated deadweight (dwt_estimate). Deadweight is estimated from the AIS length, beam and draught, with a factor per hull family calibrated on vessels with published deadweight. The draught is the deepest one the vessel has reported; when it has reported none, or only one too shallow to be a loaded draught, a typical draught for its beam is used (draught_source ais_max or typical). Where the AIS ship type does not tell the hull family, it is inferred from the vessel's dimensions. It is always an estimate, never a registry value.

Measured on the vessels used for calibration (expect somewhat larger errors on others): with a loaded draught the error is typically a few percent for tankers and bulk carriers and about 10% for container and passenger ships (at most about 17%); without a draught it is larger, typically 5-20% and up to a third for passenger ships, and a wide container ship can be taken for a bulk carrier and overestimated by about 70%.

A vessel seen only part-loaded is estimated low by about the same share. Car carriers, ro-ro and reefer ships fit neither cargo hull and are overestimated (a car carrier by about 2.5 times); gas carriers report tanker types and are overestimated too.

class is the industry size class. Tankers by estimated deadweight: Handysize 10,000-25,000 t, MR 25,000-55,000, Panamax 55,000-80,000, Aframax 80,000-120,000, Suezmax 120,000-200,000, VLCC 200,000-320,000, ULCC above. Bulk carriers: Handysize 10,000-40,000 t, Handymax 40,000-50,000, Supramax 50,000-60,000, Ultramax 60,000-67,000, Panamax 67,000-120,000 (Post-Panamax when wider than the old Panama Canal locks, 32.3 m), Capesize 120,000-220,000, VLOC above. A tanker or bulk carrier at the old canal beam and longer than 215 m is Panamax whatever the estimate. Container ships by dimensions: Feeder under 200 m, Panamax up to 32.3 m beam, Post-Panamax, New Panamax from 46 m beam within the new locks (366 m, 51.25 m), ULCV beyond. Passenger and fishing vessels and vessels under 10,000 t have no class (null).

dwt_estimate is null when the length or beam is missing or implausible, for vessels under 20 m long, and for ship types where deadweight does not apply or the hull is unknown: tugs, pilot vessels, search and rescue, port tenders, anti-pollution, law enforcement and medical craft, military, diving, dredging, sailing and pleasure craft, high speed craft, wing-in-ground craft, other and unknown types. Private vessels stay out of responses as before (see Private vessels).

Flag

FieldTypeDescription
codestringISO 3166-1 alpha-2 country or territory code
namestringEnglish short name
sourcemmsiDerived from the MMSI's MID

DWT estimate

FieldTypeDescription
tonnesintegerEstimated deadweight, metric tonnes, rounded to 3 significant digits
classstring | nullIndustry size class, see above
hulltanker | bulk | container | passenger | fishingHull family used; bulk covers dry bulk and general cargo
draught_mnumberDraught used, metres
draught_sourceais_max | typicalais_max: the deepest draught the vessel has reported; typical: a typical draught for the beam
methoddimensionsEstimated from the AIS dimensions
notestringStates that the value is an estimate, not a registry value

Example, as in a search result or a vessel lookup:

"flag": { "code": "MT", "name": "Malta", "source": "mmsi" },
"dwt_estimate": { "tonnes": 77300, "class": "Panamax", "hull": "bulk",
                  "draught_m": 14.4, "draught_source": "ais_max", "method": "dimensions",
                  "note": "Estimated from AIS length, beam and draught; not a registry value." }

Sanctions lists

Vessel, IMO and batch lookups, search results, port call rows and event rows are checked by IMO number against three official sanctions lists, at no extra credit cost:

  • OFAC: the Specially Designated Nationals (SDN) List of the Office of Foreign Assets Control, vessel entries.
  • UK: the UK Sanctions List, ship designations.
  • EU: Annex XLII of Council Regulation (EU) No 833/2014, the vessels under the Article 3s ban on port access and services.

The vessel lookup (for the current IMO number), the IMO lookup and batch results carry sanctions, one Sanction listing per list that names the vessel; the IMO track carries the same in meta.sanctions. Search results, port call rows (both layouts) and event rows carry the list codes, for example "sanctions": ["OFAC", "UK"]; in CSV and Excel this is the sanctions column (the last one in port call exports, the last but one, before detail, in event exports), codes joined with |. An empty list means none of the three lists names that IMO number. meta.sanctions_lists gives each list's publication date, when we fetched it and how many vessels it names. The lists are fetched every night; when one cannot be fetched, the previous copy stays in use and is marked stale.

Informational only, not a compliance determination. The match is by the IMO number the row carries: a vessel that broadcasts no IMO number or a wrong one is not matched. Only vessels a list names by IMO number are covered; designations that follow from ownership or control, sanctions on a vessel's owner, manager or operator, and other lists (such as the UN Security Council list) are not. A list can change after the date shown. Check the official list before you act. Each list's licence and attribution text is on the sources page; a response that includes a listing carries that list's attribution in meta.attribution.

Sanction listing

FieldTypeDescription
listOFAC | UK | EUThe list naming the vessel
programmesarraySanctions programmes or regimes, as written on the list
listeddate | nullDate the vessel was designated, as published on the list
namestring | nullVessel name on the list
refstring | nullThe list's own identifier for the entry

Example, as in a vessel lookup:

"sanctions": [
  { "list": "UK", "programmes": ["The Democratic People's Republic of Korea (Sanctions) (EU Exit) Regulations 2019"],
    "listed": "2017-10-03", "name": "Petrel 8", "ref": "DPR0075" }
]

Tracks

To look at a track without writing code, sign in and open Voyages in your dashboard: it draws the track on a map coloured by speed, with port names, direction arrows and the start and end, charts speed and draught, lists port and anchorage calls and events, replays the voyage and downloads it as CSV or Excel. No API key is needed there.

  • A range is up to 92 days: one position per minute for up to 7 days, one per hour beyond that. Your plan's limits apply: Free covers the last 7 days, and Free and Starter don't include the most recent 24 hours.
  • Credits are the same as in the API: the track uses 1 credit per vessel-day, port calls 1 per call and events 1 per event. Leave calls or events out to use fewer.
  • The Area player (Starter and above) replays every vessel in a box for up to 12 hours. Credits are as for area queries: 1 per vessel-day in each page of 5,000 positions, so a busy box costs more; one load stops at 40,000 positions.
  • Downloads have the same columns as the API's CSV and Excel output, use no credits and stay available for 30 minutes after you load a voyage. Credits used by Voyages appear on the Usage page as "Dashboard voyage viewer".

GET /v1/vessels/{mmsi}/track

Track of one MMSI over a time range.

Positions of one MMSI between from and to, ordered by time. Paged: see Paging. The default range is the 24 hours before to.

NameInTypeRequired / defaultDescription
mmsipathintegerrequired9-digit MMSI
fromqueryISO 8601 date-timeoptionalISO 8601 start (inclusive); default: to minus 24 h
toqueryISO 8601 date-timeoptionalISO 8601 end (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff)
resolutionqueryraw | 1m | 1hdefault rawraw = every fix; 1m / 1h = latest fix per vessel per minute / hour (no interpolation)
formatqueryjson | geojson | csv | xlsxdefault jsonjson, geojson (application/geo+json), csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers
includequerystatic | nonestatic for csv and xlsx, none otherwisestatic adds the vessel's static data to every row: IMO, name, call sign, ship type, length, beam, draught, destination, ETA and the AIS dimensions A, B, C, D, as reported at or before that row's time (up to 30 days back, from the sources on your plan). No extra credits
limitqueryintegerdefault 5000; 1000 on FreeRows per page, up to your plan's maximum (1,000 on Free, 50,000 on paid plans)
cursorquerystringoptionalOpaque cursor from meta.next_cursor. When given, from, to, resolution and the subject are taken from the cursor

Status codes: 200, 400, 401, 402, 403, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/vessels/276859000/track?from=2026-10-08T00:00:00Z&to=2026-10-09T00:00:00Z&resolution=1m"

On Free, use a day from the last 7 days: an older from returns 403 History limit.

Response, trimmed to the first position. embargo_cutoff is the time of your request minus 24 hours.

{
  "meta": {
    "mmsi": 276859000,
    "from": "2026-10-08T00:00:00Z",
    "to": "2026-10-09T00:00:00Z",
    "resolution": "1m",
    "count": 654,
    "complete": true,
    "next_cursor": null,
    "next": null,
    "embargo_cutoff": "2026-10-10T09:30:00Z",
    "sources_through": { "digitraffic": "2026-10-10T09:30:00Z", "dma": "2026-10-08T00:00:00Z" },
    "pending_days": { "dma": ["2026-10-08"] },
    "missing_days": {},
    "unavailable_days": {},
    "data_complete": false,
    "private_vessels": "excluded",
    "attribution": [
      { "source": "<source id>",
        "text": "<attribution text of this source, see /v1/sources>",
        "license": "CC BY 4.0",
        "license_url": "https://creativecommons.org/licenses/by/4.0/" }
    ],
    "notice": "Not for navigation. AIS data can be missing, delayed or wrong; …"
  },
  "positions": [
    { "mmsi": 276859000, "ts": "2026-10-08T00:17:23.383000Z",
      "lat": 60.14799, "lon": 24.91475, "sog": 0.0, "cog": 15.6,
      "heading": 207, "nav_status": 5, "source": "<source id>", "flags": null, "flag": "EE" },
    …
  ]
}

Each source is a source id; the ids and their attribution are listed at /v1/sources. Here dma has not delivered 8 October yet, so data_complete is false although the page is complete (see Data freshness).

One row per report. Several sources often receive the same AIS transmission. At raw resolution such copies are returned once in tracks, IMO tracks and area queries, in every format, and the row keeps the source and ts of one of the sources that received it. Rows from one source are never merged with each other, and a copy from a source your plan does not include never removes a row. Paging is unaffected: rows never repeat or go missing at page boundaries, and credits count vessel-days as before. At 1m and 1h there is already one fix per vessel per interval.

GET /v1/vessels/imo/{imo}/track

Track of one ship by IMO number, across MMSI changes.

Follows one ship across MMSI changes. Each MMSI is included only for the periods in which it reported this IMO number, so positions of an unrelated ship that later reused the MMSI are not mixed in. Every row carries its mmsi. Same parameters and paging as the MMSI track.

NameInTypeRequired / defaultDescription
imopathintegerrequired7-digit IMO number with a valid check digit
fromqueryISO 8601 date-timeoptionalISO 8601 start (inclusive); default: to minus 24 h
toqueryISO 8601 date-timeoptionalISO 8601 end (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff)
resolutionqueryraw | 1m | 1hdefault rawraw = every fix; 1m / 1h = latest fix per vessel per minute / hour (no interpolation)
formatqueryjson | geojson | csv | xlsxdefault jsonjson, geojson (application/geo+json), csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers
includequerystatic | nonestatic for csv and xlsx, none otherwisestatic adds the vessel's static data to every row: IMO, name, call sign, ship type, length, beam, draught, destination, ETA and the AIS dimensions A, B, C, D, as reported at or before that row's time (up to 30 days back, from the sources on your plan). No extra credits
limitqueryintegerdefault 5000; 1000 on FreeRows per page, up to your plan's maximum (1,000 on Free, 50,000 on paid plans)
cursorquerystringoptionalOpaque cursor from meta.next_cursor. When given, from, to, resolution and the subject are taken from the cursor

Status codes: 200, 400, 401, 402, 403, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/vessels/imo/9892690/track?from=2026-10-08&to=2026-10-09&resolution=1m"

Area queries

GET /v1/area

Historical positions inside a bounding box (Starter, Pro and Business plans).

Every position inside a bounding box over a time range. Starter and Pro plans: each side up to 2°; Business plan: up to 10°. Free keys get 403 Plan limit. Boxes that cross the antimeridian are not supported. A box larger than your plan allows returns 400 Bad request. The default range is the hour before to.

Rows come day by day and, at raw resolution, area by area within a day; inside each group they are ordered by vessel and time. Each page is time-boxed on the server, so a page can hold fewer rows than limit (even zero) while complete is still false: keep following next.

Copies of one report from several sources are merged as in tracks; in rare cases, at the edge of a day or of one of those areas, both copies of a report are returned, one per source.

Heavy area queries (1m or 1h resolution, or a side longer than 2°) may wait briefly and then answer 503 Server busy with Retry-After; no credits are taken.

NameInTypeRequired / defaultDescription
bboxquerystringrequired unless cursor is givenlat_min,lon_min,lat_max,lon_max in decimal degrees; each side at most 2° on Starter and Pro, 10° on Business
fromqueryISO 8601 date-timeoptionalISO 8601 start (inclusive); default: to minus 1 h
toqueryISO 8601 date-timeoptionalISO 8601 end (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff)
resolutionqueryraw | 1m | 1hdefault rawraw = every fix; 1m / 1h = latest fix per vessel per minute / hour (no interpolation)
formatqueryjson | geojson | csv | xlsxdefault jsonjson, geojson (application/geo+json), csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers
includequerystatic | nonestatic for csv and xlsx, none otherwisestatic adds the vessel's static data to every row: IMO, name, call sign, ship type, length, beam, draught, destination, ETA and the AIS dimensions A, B, C, D, as reported at or before that row's time (up to 30 days back, from the sources on your plan). No extra credits
limitqueryintegerdefault 5000; 1000 on FreeRows per page, up to your plan's maximum (1,000 on Free, 50,000 on paid plans)
cursorquerystringoptionalOpaque cursor from meta.next_cursor. When given, from, to, resolution and the subject are taken from the cursor

Status codes: 200, 400, 401, 402, 403, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/area?bbox=54.95,10.6,55.6,11.25&from=2026-10-08T10:00:00Z&to=2026-10-08T12:00:00Z&resolution=1m"

Port calls

A port call starts when a vessel stops inside a port area and ends when it leaves the area. arrival is the start of that stop; departure is the vessel's last position inside the area, and null while the vessel is still in port. Ships that pass through without stopping make no port call. A ship that waits just outside the area makes an anchorage call instead (zones=anchorage or all, zone: "anchorage"). Ports come from the World Port Index and UN/LOCODE, about 11,000 ports in 220 countries (/v1/ports): a port area is a circle around the port's position, sized by the harbor (radius_km in /v1/ports); a vessel just outside the circle still counts as in port. A short gap in reception does not end a call; a long silence ends it at the vessel's last position in port.

Port calls at Taiwan's international ports (Keelung, Taipei, Suao, Hualien, Taichung and Kaohsiung) also come from the source twport, which has no positions or draught (Data sources). Port calls at the ports covered by the source portnet also come from the ports' own records (Data sources): they add berth, the arrival and departure recorded by the port (reported_arrival, reported_departure) and the previous and next port declared there (declared_previous_port, declared_next_port, which may lie outside our coverage). Where the same call is also seen in AIS, arrival and departure stay those seen in AIS. Elsewhere these fields are null.

Port calls are built every night from the archive and follow the rules of the history endpoints: your plan's sources (a call seen in several sources is one call that lists them all in sources), history depth, embargo (calls that start more than 15 minutes before meta.embargo_cutoff; a later departure or next port is null) and private vessels (a private vessel's port calls are an empty page). meta.calls_through gives, per source, the time up to which port calls are built. Draught comes from the vessel's own static reports: draught_arrival_m at arrival, draught_departure_m by departure, and cargo_estimate from the change: loaded (0.3 m deeper or more), ballast (0.3 m shallower or more) or unchanged. previous_port and next_port are the vessel's port calls before and after this one, at most 30 days apart; ports outside our coverage are not seen, so they are the previous and next calls we observed. Results are ordered by arrival (by departure with event=departure) and paged like tracks; the response is {"meta": {…}, "port_calls": […]} (see Port call and Port call meta).

GET /v1/vessels/{mmsi}/port-calls

Port calls of one MMSI over a time range.

meta.mmsi is the vessel. A private vessel without access returns an empty page, like a vessel without port calls.

NameInTypeRequired / defaultDescription
mmsipathintegerrequired9-digit MMSI
fromqueryISO 8601 date-timeoptionalStart of the range; default: to minus 30 days (on Free, no earlier than the oldest day the plan includes)
toqueryISO 8601 date-timeoptionalEnd of the range (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff). At most 366 days after from
eventqueryany | arrival | departuredefault anyany = calls in port at any time in the range; arrival = calls that arrived in the range; departure = calls that departed in the range
formatqueryjson | csv | xlsxdefault jsonjson, csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers
zonesqueryport | anchorage | alldefault portport = port calls; anchorage = waits at the port's anchorage, just outside the port area, named Port Anch. in the events layout; all = both in one order. Every row has zone
layoutquerycalls | eventsdefault callscalls = one row per port call; events = one ENTER_ZONE row at arrival and, once the vessel has left, one EXIT_ZONE row at departure, with the draught reported then (json: events instead of port_calls; csv columns mmsi, imo, name, ship_type, draught_m, ts, event, port_id, port_name, port_country, port_locode, flag). Paging and credits stay per port call
limitqueryintegerdefault 1000Port calls per page, up to 10,000 (1,000 on Free)
cursorquerystringoptionalOpaque cursor from meta.next_cursor. When given, from, to, event and the subject or filters are taken from the cursor

Status codes: 200, 400, 401, 402, 403, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/vessels/276859000/port-calls?from=2026-10-08&to=2026-10-22"

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

Port calls of one ship by IMO number, across MMSI changes.

Each MMSI counts only for the periods it reported this IMO number, as for the IMO track; every row carries its mmsi and meta.imo is the IMO number.

NameInTypeRequired / defaultDescription
imopathintegerrequired7-digit IMO number with a valid check digit
fromqueryISO 8601 date-timeoptionalStart of the range; default: to minus 30 days (on Free, no earlier than the oldest day the plan includes)
toqueryISO 8601 date-timeoptionalEnd of the range (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff). At most 366 days after from
eventqueryany | arrival | departuredefault anyany = calls in port at any time in the range; arrival = calls that arrived in the range; departure = calls that departed in the range
formatqueryjson | csv | xlsxdefault jsonjson, csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers
zonesqueryport | anchorage | alldefault portport = port calls; anchorage = waits at the port's anchorage, just outside the port area, named Port Anch. in the events layout; all = both in one order. Every row has zone
layoutquerycalls | eventsdefault callscalls = one row per port call; events = one ENTER_ZONE row at arrival and, once the vessel has left, one EXIT_ZONE row at departure, with the draught reported then (json: events instead of port_calls; csv columns mmsi, imo, name, ship_type, draught_m, ts, event, port_id, port_name, port_country, port_locode, flag). Paging and credits stay per port call
limitqueryintegerdefault 1000Port calls per page, up to 10,000 (1,000 on Free)
cursorquerystringoptionalOpaque cursor from meta.next_cursor. When given, from, to, event and the subject or filters are taken from the cursor

Status codes: 200, 400, 401, 402, 403, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/vessels/imo/9892690/port-calls?from=2026-10-08&to=2026-10-22"

GET /v1/ports/{port_id}/calls

Arrivals, departures and port calls at one port over a time range.

meta.port is the port (see Port). Use event=arrival or event=departure for an arrivals or departures board. An unknown port id returns 404 Not found.

NameInTypeRequired / defaultDescription
port_idpathintegerrequiredPort id from /v1/ports
fromqueryISO 8601 date-timeoptionalStart of the range; default: to minus 30 days (on Free, no earlier than the oldest day the plan includes)
toqueryISO 8601 date-timeoptionalEnd of the range (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff). At most 366 days after from
eventqueryany | arrival | departuredefault anyany = calls in port at any time in the range; arrival = calls that arrived in the range; departure = calls that departed in the range
formatqueryjson | csv | xlsxdefault jsonjson, csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers
zonesqueryport | anchorage | alldefault portport = port calls; anchorage = waits at the port's anchorage, just outside the port area, named Port Anch. in the events layout; all = both in one order. Every row has zone
layoutquerycalls | eventsdefault callscalls = one row per port call; events = one ENTER_ZONE row at arrival and, once the vessel has left, one EXIT_ZONE row at departure, with the draught reported then (json: events instead of port_calls; csv columns mmsi, imo, name, ship_type, draught_m, ts, event, port_id, port_name, port_country, port_locode, flag). Paging and credits stay per port call
limitqueryintegerdefault 1000Port calls per page, up to 10,000 (1,000 on Free)
cursorquerystringoptionalOpaque cursor from meta.next_cursor. When given, from, to, event and the subject or filters are taken from the cursor

Status codes: 200, 400, 401, 402, 403, 404, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/ports/29230/calls?from=2026-10-01&to=2026-10-08&event=arrival"

GET /v1/ports/{port_id}/expected

Vessels expected at one port, from the port's own records. Pro and Business plans.

Vessels that have not arrived yet, in order of their estimated time of arrival, from 6 hours ago to 14 days ahead: eta, etd, berth and declared_previous_port, with the vessel's mmsi, imo, name and flag. The list comes from the ports' own records (the source portnet; its ports are on the Data sources page); at other ports it is empty. One credit per vessel returned. On plans without live data it returns 403 Plan limit; an unknown port id returns 404 Not found. meta.generated_at is when the list was last refreshed.

NameInTypeRequired / defaultDescription
port_idpathintegerrequiredPort id from /v1/ports
limitqueryintegerdefault 100Vessels to return, up to 500
formatqueryjson | csvdefault jsonjson or csv (text/csv; columns mmsi, imo, name, flag, port_id, port_name, port_locode, eta, etd, berth_code, berth_name, declared_previous_locode, sources)

Status codes: 200, 400, 401, 402, 403, 404, 429.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/ports/28190/expected"

GET /v1/ports/{port_id}

One port by id.

The port's fields (see Port) and meta with attribution and notice; 404 Not found for an unknown id.

NameInTypeRequired / defaultDescription
port_idpathintegerrequiredPort id (World Port Index number)

Status codes: 200, 401, 402, 404, 429.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/ports/29230"

Vessel events

A vessel's events are computed from the archive when you ask, under the rules of the history endpoints (your plan's sources, history depth, embargo and private vessels). Every event has ts, event, old_value, new_value, the position at that moment (lat, lon: the fix of that minute, or the last one before the event within 6 hours; null when none), the vessel's imo and name at that time, source, sanctions (the lists that name that IMO number, see Sanctions lists), detail (more about the event, null for most types; JSON text in CSV and Excel) and, for zone events, port. The response is {"meta": {…}, "events": […]}, ordered by time and paged like tracks. One credit per event.

  • ENTER_ZONE / EXIT_ZONE: the arrival and departure of a port call or an anchorage call; the value is Port / LOCODE or Port Anch. / LOCODE, and port.zone says which.
  • STATE_CHANGED: MOVING, NOT_MOVING (from the start of a stop) or LONG_STOP (the stop has lasted 6 hours, at that moment). Short moves do not end a stop, and after a long silence the state is unknown until the next position.
  • NAME_CHANGED, IMO_CHANGED, CALLSIGN_CHANGED, DESTINATION_CHANGED, DRAUGHT_CHANGED: a static field the vessel broadcasts changed. Formatting-only differences and one-off noisy reports are ignored, and the same change reported by several sources at about the same time is listed once, at the earliest.
  • AIS_GAP: no positions for 6 hours or more while the vessel was under way, at the last position before the gap. old_value is the gap in hours and new_value the distance in nautical miles between the last position and the one where the vessel reappeared. A gap is listed once the vessel reappears, up to 2 days after the end of your range. detail.others_nearby counts other vessels heard near the last position during the gap: above 0, receivers covered the area while the vessel was silent; 0 usually means the vessel left receiver coverage; null when it was not checked (only the first gaps of each request are checked; ask for a shorter range to check more).
  • ENCOUNTER: a slow, close approach to another vessel lasting 2 hours or more outside port areas: a candidate ship-to-ship transfer. Tugs, pilot boats, service and pleasure craft do not count. old_value is the duration in hours and new_value the other vessel's MMSI; detail has its name, IMO number and ship type, the end time and the closest distance. Only the first slow periods of each request are checked, so over a long range ask for shorter ranges to find every encounter.
  • FLAG_CHANGED: the vessel's IMO number was reported before by another MMSI with a different flag (from the MMSI), and that MMSI had stopped reporting it. At the first report of the IMO number on the new MMSI; old_value and new_value are flag codes and detail has both MMSIs.
  • POSITION_JUMP: a position marked as a physically impossible jump (possible GPS spoofing, two transmitters with one MMSI, or a corrupt message), the first one in each hour. old_value is the distance in nautical miles from the last good position and new_value the speed that jump would need, in knots; detail.flagged_in_hour counts the marked positions in that hour.

AIS_GAP, ENCOUNTER, FLAG_CHANGED and POSITION_JUMP come only when you name them in types or ask for types=all; they take longer to compute than the other events. Without types you get the other eight.

GET /v1/vessels/{mmsi}/events

Events of one MMSI over a time range.

meta.mmsi is the vessel. A private vessel without access returns an empty page.

NameInTypeRequired / defaultDescription
mmsipathintegerrequired9-digit MMSI
fromqueryISO 8601 date-timeoptionalStart of the range; default: to minus 7 days (on Free, no earlier than the oldest day the plan includes)
toqueryISO 8601 date-timeoptionalEnd of the range (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff). At most 31 days after from
typesquerystringdefault: all but the last fourall, or comma-separated event types: ENTER_ZONE, EXIT_ZONE, STATE_CHANGED, NAME_CHANGED, IMO_CHANGED, CALLSIGN_CHANGED, DESTINATION_CHANGED, DRAUGHT_CHANGED, AIS_GAP, ENCOUNTER, FLAG_CHANGED, POSITION_JUMP
formatqueryjson | csv | xlsxdefault jsonjson, csv (text/csv) or xlsx (Excel workbook); csv columns mmsi, imo, name, lat, lon, ts, event, old_value, new_value, port_id, port_locode, source, flag
limitqueryintegerdefault 1000Events per page, up to 10,000 (1,000 on Free)
cursorquerystringoptionalOpaque cursor from meta.next_cursor. When given, from, to and types are taken from the cursor

Status codes: 200, 400, 401, 402, 403, 429.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/vessels/276859000/events?from=2026-10-08&to=2026-10-22&format=csv"

GET /v1/vessels/imo/{imo}/events

Events of one ship by IMO number, across MMSI changes.

Each MMSI counts only while it reported this IMO number, like the IMO track; every event carries its mmsi. meta.imo is the ship.

NameInTypeRequired / defaultDescription
imopathintegerrequired7-digit IMO number
fromqueryISO 8601 date-timeoptionalStart of the range; default: to minus 7 days (on Free, no earlier than the oldest day the plan includes)
toqueryISO 8601 date-timeoptionalEnd of the range (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff). At most 31 days after from
typesquerystringdefault: all but the last fourall, or comma-separated event types: ENTER_ZONE, EXIT_ZONE, STATE_CHANGED, NAME_CHANGED, IMO_CHANGED, CALLSIGN_CHANGED, DESTINATION_CHANGED, DRAUGHT_CHANGED, AIS_GAP, ENCOUNTER, FLAG_CHANGED, POSITION_JUMP
formatqueryjson | csv | xlsxdefault jsonjson, csv (text/csv) or xlsx (Excel workbook); csv columns mmsi, imo, name, lat, lon, ts, event, old_value, new_value, port_id, port_locode, source, flag
limitqueryintegerdefault 1000Events per page, up to 10,000 (1,000 on Free)
cursorquerystringoptionalOpaque cursor from meta.next_cursor. When given, from, to and types are taken from the cursor

Status codes: 200, 400, 401, 402, 403, 429.

Marine data

Traffic density, sea depth and submarine cables come from open data of public bodies, not from AIS Trail's own AIS archive. Values are returned as the source publishes them, rounded to 6 significant digits; meta.provenance names the dataset, its version and license, and meta.attribution carries the text to keep when you pass the values on (see Data sources). The values are not for navigation.

GET /v1/density

Vessel traffic density at a point.

Three products: vessel_hours (EMODnet Human Activities Vessel Density, 2017 to 2024: hours per square kilometre per month, annual average, by ship type), route_crossings (EMSA Route Density via EMODnet, 2019 to 2025: route crossings per 1 km cell per year) and uk_transits (Marine Management Organisation, 2011 to 2019: weekly average transits per 2 km cell, with by_ship_type_group as published). The response is {"meta": {…}, "density": {lat, lon, product, year, ship_type, unit, density}}; density is null outside the product's area, and then no credit is used.

NameInTypeRequired / defaultDescription
latquerynumberrequiredLatitude, -90 to 90
lonquerynumberrequiredLongitude, -180 to 180
productquerystringvessel_hoursvessel_hours, route_crossings or uk_transits
yearqueryintegerlatest of the productYear of the product
ship_typequerystringallvessel_hours: all, other, fishing, service, dredging, sailing, pleasure, high_speed, tug, passenger, cargo, tanker, military, unknown. route_crossings: all, cargo, fishing, passenger, tanker, other. uk_transits: all

Status codes: 200, 400, 401, 402, 404, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/density?lat=51.0&lon=1.45&ship_type=cargo"

GET /v1/density/area

Vessel traffic density statistics for a box (Starter, Pro and Business plans).

For vessel_hours and route_crossings: cells with a value, mean, max and p90 of the cell values in the box and, for vessel_hours, vessel_hours_per_month (each value times its cell's area). Each side of the box is at most your plan's area limit (Plan limits).

NameInTypeRequired / defaultDescription
bboxquerystringrequiredlat_min,lon_min,lat_max,lon_max
productquerystringvessel_hoursvessel_hours or route_crossings
yearqueryintegerlatest of the productYear of the product
ship_typequerystringallAs for /v1/density

Status codes: 200, 400, 401, 402, 403, 404, 429, 503.

GET /v1/bathymetry

Sea depth at a point.

In European seas the EMODnet Digital Bathymetry (DTM 2024, about 115 m, depths relative to the lowest astronomical tide; source_type CDI for a surveyed cell, DTM for a filled one); elsewhere, and on land, the GEBCO 2026 Grid (about 460 m, mean sea level). The response is {"meta": {…}, "bathymetry": {lat, lon, elevation_m, depth_m, min_m, max_m, vertical_datum, resolution_m, source_type, source_reference}}; elevation_m is negative below sea level and depth_m is null on land.

NameInTypeRequired / defaultDescription
latquerynumberrequiredLatitude, -90 to 90
lonquerynumberrequiredLongitude, -180 to 180

Status codes: 200, 400, 401, 402, 404, 429, 503.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/bathymetry?lat=58.0&lon=20.0"

GET /v1/cables

Submarine cables near a point.

Cables within radius_km of the point, nearest first, from official open data: submarine cables charted by NOAA (Electronic Navigational Charts, general scale, public domain) and the submarine power cables registered by NVE (NLOD 1.0). Each cable has id, dataset, kind (power, telecom or unknown), distance_km and, where the source gives them, name, owner, voltage_kv, in_service_year or category. Coverage is limited to the waters of these two sources; landing stations are not included. The response is {"meta": {…}, "count", "truncated", "cables": […]}.

NameInTypeRequired / defaultDescription
latquerynumberrequiredLatitude, -90 to 90
lonquerynumberrequiredLongitude, -180 to 180
radius_kmquerynumber10Search radius in km, 0.01 to 100
limitqueryinteger25At most this many cables, 1 to 100

Status codes: 200, 400, 401, 402, 404, 429.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
  "https://api.aistrail.com/v1/cables?lat=60.39&lon=5.32&radius_km=5"

GET /v1/cables/{cable_id}/vessels

Live vessels near a submarine cable (Pro and Business).

Latest live positions within distance_km of the cable's line, nearest first, each with distance_km. The live sources, private vessels and credits are the same as for /v1/positions; meta.cable describes the cable. The box around the cable is at most your plan's area limit.

NameInTypeRequired / defaultDescription
cable_idpathstringrequiredCable id from /v1/cables, for example nve_cables:347
distance_kmquerynumber2Distance from the cable, 0.01 to 20 km
max_agequerynumber3600Only positions newer than this many seconds

Status codes: 200, 400, 401, 402, 403, 404, 429, 503.

Account

GET /v1/usage

Plan, limits and credits (uses no credits).

Your plan and how much of it you have used: plan, label (the plan's name, for example Pro), limits (including live and ws), sources, live (included, the live endpoints' sources, ws_limit and ws_open), credits (remaining: usable now; plan: monthly, used, remaining, period_start and resets_at of your monthly credits; packs: each valid credit pack with credits, remaining, purchased_at and expires_at, the one used next first; packs_remaining; used_this_period: all credits used this period, packs included; all keys of your account), period_resets_at and private_vessels (your access to private vessels: not_available on every customer plan). The same numbers are in your dashboard. Calls to /v1/usage use no credits.

Status codes: 200, 401, 429.

curl -H "Authorization: Bearer $AIS_TRAIL_KEY" "https://api.aistrail.com/v1/usage"

Service

GET /v1/sources

Data sources, licenses, required attribution and coverage (public).

Public, no key needed. Each source with its id, name, license, license_url, homepage, required attribution text, live coverage (first_date, last_date, days and missing) and available_until: the time up to which its data can be queried, never later than the embargo cutoff (a daily source lags by its publication delay). The top-level available_until is the embargo cutoff and notice the not-for-navigation notice. See Data sources.

Status codes: 200.

curl "https://api.aistrail.com/v1/sources"

GET /v1/status

Service status and data coverage per source (public).

Public, no key needed. status is ok or degraded, with HTTP 200 in both cases; reasons lists the failed checks as stable codes: dma_stale and digitraffic_stale (that source is behind), live_heartbeat and live_replica_stale (live data is not current), privacy_registry_missing (vessel search and lookups may return fewer or no results until it clears), and writer_error, disk_warning and coverage_error (internal checks; the service may be degraded). The body also has coverage per source (first_date, last_date, days, missing and its available_until) and the overall available_until (the embargo cutoff). Called with your key, the cutoff is your plan's (available_until is null on Pro and Business, which include live data), and on those plans the body also has live: included, sources, state (syncing, live or stale) and stale_s. To monitor the service, match the body text "status": "degraded".

Status codes: 200.

curl "https://api.aistrail.com/v1/status"

GET /v1/openapi.json

This API as an OpenAPI 3.1 document (public).

Public. This API as an OpenAPI 3.1 document, for code generators and API clients. A copy is published at /docs/openapi.json.

Status codes: 200.

curl "https://api.aistrail.com/v1/openapi.json"

Paging

Track and area results come in pages (default 5,000 rows, 1,000 on Free; set limit up to your plan's rows per page), and port calls too (default 1,000, up to 10,000). Follow meta.next, a relative URL, until meta.complete is true. The cursor is opaque and signed by the server; when you pass cursor, the range, resolution and subject come from the cursor, and your plan's rules are applied again on every page. Rows never repeat or go missing at page boundaries.

For CSV and Excel, paging is in the headers: X-Next-Cursor and Link: <…>; rel="next" (both absent on the last page), X-Complete and X-Count.

Formats

  • format=json (default): {"meta": {…}, "positions": […]}.
  • format=geojson (application/geo+json): a track is a FeatureCollection with one LineString per vessel (a single fix is a Point); properties has mmsi, flag, count, coordTimes (the time of every coordinate) and sources. An area is a FeatureCollection of Points whose properties are the position fields. Paging, freshness and attribution are in the top-level meta.
  • format=csv (text/csv): columns mmsi, ts, lat, lon, sog, cog, heading, nav_status, source, flags, flag, then (unless include=none) imo, name, callsign, ship_type, length_m, width_m, draught_m, destination, eta, dim_a, dim_b, dim_c, dim_d (dim_a–dim_d: the AIS dimensions A, B, C, D, metres from the GPS antenna to bow, stern, port and starboard); empty cell for null; a text cell that starts with =, +, - or @ gets a leading apostrophe, so spreadsheets do not run it as a formula. Paging, attribution, freshness and the notice are in the response headers.
  • format=xlsx (Excel workbook): the same columns as csv on one sheet, header row frozen, numbers as numbers and times as ISO 8601 text; the same headers as csv.
  • include=static with json and geojson: the static fields are added to each position (an area's Point properties); a track's LineString gets properties.static, one object per coordinate in the order of coordTimes.

Objects

Position

FieldTypeDescription
mmsiintegerMaritime Mobile Service Identity of the transmitting vessel (9 digits)
tsISO 8601 date-timeMessage timestamp (UTC) as reported by the source
latnumberLatitude, decimal degrees
lonnumberLongitude, decimal degrees
sognumber | nullSpeed over ground, knots
cognumber | nullCourse over ground, degrees
headinginteger | nullTrue heading, degrees; null if unavailable (raw 511)
nav_statusinteger | nullITU-R M.1371 navigational status 0-14
sourcestringData source id, see /v1/sources
flagsstring | nullQuality flag, e.g. implausible_jump (kept, never dropped)
flagstring | nullFlag of the vessel: ISO 3166-1 alpha-2 code from the MMSI (see Vessel particulars)

Page meta

Track responses also carry mmsi or imo; area responses carry bbox.

FieldTypeDescription
fromISO 8601 date-timeStart of the range actually served (inclusive)
toISO 8601 date-timeEnd of the range actually served (exclusive), after embargo clamping
resolutionraw | 1m | 1hResolution of this page
countintegerRows in this page
completebooleantrue when there are no more pages (paging only; see data_complete)
next_cursorstring | nullPass as ?cursor= to get the next page
nextstring | nullRelative URL of the next page
embargo_cutoffISO 8601 date-timeData newer than this is not available on your plan (null on plans with live data)
includestatic | noneWhether rows carry static data (the include parameter, or its default for the format)
sources_throughobjectPer source: the archive holds this source's data up to this time, never later than embargo_cutoff (null: no data yet)
pending_daysobjectPer source: UTC days in this range the source has not delivered yet (at most 100)
missing_daysobjectPer source: UTC days in this range up to sources_through without data (at most 100)
unavailable_daysobjectPer source: UTC days in this range the source never published; they will not arrive and do not count against data_complete (at most 100)
data_completebooleanfalse when pending_days or missing_days is not empty for any source
private_vesselsexcluded | includedWhether private vessels are part of this response for your account
attributionarrayOne entry per source in this page: source, text, license, license_url
sanctionsarrayIMO track only: the official sanctions lists that name this IMO number (see Sanctions lists)
sanctions_listsobjectIMO track only: the sanctions lists checked
noticestringNot-for-navigation notice (also in the X-Notice header)

Response meta

Search, vessel and IMO responses carry a shorter meta, built from the rows returned.

FieldTypeDescription
embargo_cutoffISO 8601 date-timeData newer than this is not available on your plan (null on plans with live data)
sources_throughobjectPer source of your plan: the archive holds its data up to this time, never later than embargo_cutoff
private_vesselsexcluded | includedWhether private vessels are part of this response for your account
attributionarrayOne entry per source in this response: source, text, license, license_url
sanctions_listsobjectThe sanctions lists checked: per list its publication date, fetch time and vessel count, plus a note (see Sanctions lists)
noticestringNot-for-navigation notice (also in the X-Notice header)

Port call

FieldTypeDescription
mmsiintegerMMSI of the vessel
imointeger | nullIMO number reported at arrival; otherwise taken from another report of the same MMSI within 30 days; left empty when the MMSI is ambiguous
namestring | nullVessel name reported at arrival; otherwise taken from another report of the same MMSI within 30 days; left empty when the MMSI is ambiguous
ship_typeinteger | nullAIS ship type reported at arrival; otherwise taken from another report of the same MMSI within 30 days; left empty when the MMSI is ambiguous
flagstring | nullFlag of the vessel: ISO 3166-1 alpha-2 code from the MMSI (see Vessel particulars)
portobjectThe port: id, name, country, locode
arrivalISO 8601 date-timeStart of the vessel's stop inside the port area
departureISO 8601 date-time | nullLast position inside the port area before the vessel left; null while it is still in port (or when it left after embargo_cutoff)
duration_sinteger | nulldeparture minus arrival, seconds
draught_arrival_mnumber | nullDraught reported at arrival, metres
draught_departure_mnumber | nullDraught reported by departure, metres
draught_change_mnumber | nulldraught_departure_m minus draught_arrival_m
cargo_estimateloaded | ballast | unchanged | nullFrom the draught change: loaded (0.3 m deeper or more), ballast (0.3 m shallower or more), unchanged; null when a draught is unknown
previous_portobject | nullThe previous port call (id, name, country, locode, departure), at most 30 days before arrival
next_portobject | nullThe next port call (id, name, country, locode, arrival), at most 30 days after departure
zoneport | anchorageport: a call inside the port area; anchorage: a wait at the port's anchorage (see zones)
sourcesarrayData sources the port call was detected in
sanctionsarraySanctions lists that name the row's IMO number: OFAC, UK, EU (see Sanctions lists)

CSV columns: mmsi, imo, name, ship_type, port_id, port_name, port_country, port_locode, arrival, departure, duration_s, draught_arrival_m, draught_departure_m, draught_change_m, cargo_estimate, previous_port_id, previous_port_name, previous_departure, next_port_id, next_port_name, next_arrival, sources, flag, zone, sanctions, berth_code, berth_name, reported_arrival, reported_departure, declared_previous_locode, declared_next_locode (sources and sanctions separated by |).

Port call meta

Port call responses also carry mmsi, imo or port for the subject.

FieldTypeDescription
fromISO 8601 date-timeStart of the range actually served
toISO 8601 date-timeEnd of the range actually served (exclusive), after embargo clamping
eventany | arrival | departureWhich calls the range selects
layoutcalls | eventscalls: one row per port call; events: ENTER_ZONE / EXIT_ZONE rows (the layout parameter)
countintegerPort calls in this page
completebooleantrue when there are no more pages
next_cursorstring | nullPass as ?cursor= to get the next page
nextstring | nullRelative URL of the next page
embargo_cutoffISO 8601 date-timeData newer than this is not available on your plan (null on plans with live data)
calls_throughobjectPer source of your plan: port calls are built from its data up to this time, never later than embargo_cutoff (null: none yet)
private_vesselsexcluded | includedWhether private vessels are part of this response for your account
attributionarrayOne entry per source in this page, and the World Port Index
sanctions_listsobjectThe sanctions lists checked (see Sanctions lists)
noticestringNot-for-navigation notice (also in the X-Notice header)

Port

FieldTypeDescription
idintegerPort id (World Port Index number)
namestringPort name
alternate_namesarrayOther names of the port
countrystring | nullISO 3166-1 alpha-2 country code
locodestring | nullUN/LOCODE
lat, lonnumberPosition of the port, decimal degrees
harbor_sizestring | nullLarge, Medium, Small or Very Small
harbor_typestring | nullFor example Coastal (Breakwater) or River (Natural)
radius_kmnumberRadius of the port area used to detect port calls

Problem (errors)

FieldTypeDescription
typestringURI of the error type: a link to its entry on the Errors page, or about:blank
titlestringShort, stable title, e.g. Window too large; branch on this and the status
statusintegerHTTP status code
detailstringHuman-readable explanation of this occurrence
retry_after_sintegerSeconds to wait before retrying. Rate limited, Too many concurrent requests and Server busy also send it as a Retry-After header
upgrade_urlstringPricing page, on errors that a higher plan would avoid

upgrade_url appears on errors that a higher plan would avoid. See Errors.

Response headers

Responses to a request with a valid key, from endpoints that use credits (all but /v1/usage and the stream):

HeaderMeaning
X-Credits-UsedCredits this response used (0 for empty results and errors)
X-Credits-RemainingCredits left after this response: monthly credits plus credit packs
X-NoticeNot-for-navigation notice, the same text as meta.notice (successful data responses; not /v1/usage)

Track, area and port call responses in CSV and Excel:

HeaderMeaning
X-CountRows in this page
X-Completetrue when there are no more pages
X-Next-CursorCursor of the next page (absent on the last page)
Linkrel="next" URL of the next page
X-AttributionRequired attribution for the sources in this page
X-Data-Throughmeta.sources_through as source=time pairs, comma separated (source=- when the source has no data)
X-Data-Completemeta.data_complete: true or false

For port calls, X-Data-Through carries meta.calls_through and there is no X-Data-Complete; /v1/ports in CSV and Excel sends X-Count, X-Total and X-Attribution.

Attribution

Every data response carries the attribution of the sources it was built from in meta.attribution, each with its text, license and license link: track, IMO track and area pages (GeoJSON included) and the search, vessel and IMO lookups. CSV and Excel carry it in the X-Attribution header. Search results and IMO matches also list their sources per row and vessel observations name theirs. Rows from the volunteer stations of the AIS Trail receiver network (rx-<id>) carry one entry with source rx and the text "AIS Trail receiver network", however many stations a response includes. Port call responses and /v1/ports also credit the sources of port names and positions: the World Port Index (wpi) and UN/LOCODE (unlocode), depending on the ports in the response. Keep the attribution when you redistribute data; all texts are on Data sources (the position sources also at /v1/sources).

Data freshness

Sources arrive on different schedules: dma publishes each day a few days later, and barentswatch, digitraffic and the receiver network's stations (rx-<id>) are collected continuously; kystverket is historical data loaded once, so it gets no new days and never has pending days. An empty result for a recent day can mean that the data has not arrived yet, not that no vessel was there. Track and area pages give, per source, the time up to which the archive holds its data in meta.sources_through; meta.pending_days lists the days in your range a source has not delivered yet and meta.missing_days the days before that without data (a failed load or a collection gap). Days a source never published are in meta.unavailable_days. meta.data_complete is false when pending_days or missing_days is not empty; meta.complete refers to paging only. CSV and Excel carry the same in X-Data-Through and X-Data-Complete. Search, vessel and IMO responses carry meta.sources_through, and /v1/sources gives each source's available_until.

Private vessels

Pleasure craft (ship type 37), sailing vessels (type 36) and Class B transponders without a valid IMO number are private vessels: they often belong to individuals. The API leaves them out by default. Track, IMO track and area results skip their positions and a private vessel's own track is an empty page; search skips them; the vessel and IMO lookups answer 404 Not found with the same detail as for a vessel never seen, so a response never reveals that a vessel is private. meta.private_vessels (excluded or included) says whether they are part of a response for your account. On the public live map they are anonymous dots: position, motion, type and size only, under an id that is never their MMSI and changes at least once a day.

Access to private vessels is not offered on any plan at present: the data policy of the dma source does not allow combinations that identify individuals. /v1/usage shows your account's access in private_vessels. MMSIs withdrawn at their owner's request are never served, on any plan.

Live data

Live data is included in the Pro and Business plans, at no extra charge; Free and Starter do not include it. It comes with your plan on the Plan page of your dashboard and applies to all keys of your account at once. It opens the live endpoints below and removes the embargo on history: meta.embargo_cutoff is null and history reaches the archive's latest write, about every 5 minutes. Live data covers the northern Baltic (the waters off Helsinki and Kotka, the Archipelago Sea around Turku and the Gulf of Bothnia), the North Atlantic coast from the Skagerrak to the Barents Sea and Svalbard, and the waters around the stations of the AIS Trail receiver network, and comes only from the live sources open to customers, today barentswatch, digitraffic and the receiver network's stations (rx-<id>); positions and names from other feeds are never merged in. Private vessels and withdrawn MMSIs follow the same rules as in history (see Private vessels).

EndpointWhat it answers
GET /v1/positionsLatest live positions inside bbox (each side up to your plan's area limit), at most 2,000 vessels; truncated is true when there are more. max_age: only positions newer than this many seconds (default 86400).
GET /v1/vessels/{mmsi}/positionLatest live position of one vessel; 404 Not found when it has none in the live sources. The vessel lookup carries the same in live_position (null on Free and Starter).
/v1/streamWebSocket: positions as they arrive, for the boxes and MMSIs you subscribe to.
curl -H "Authorization: Bearer $AIS_TRAIL_KEY" "https://api.aistrail.com/v1/positions?bbox=59.9,24.6,60.3,25.2&max_age=600"

The stream is the only endpoint that takes the key in the URL (browsers cannot send headers on a WebSocket). Connect to wss://api.aistrail.com/v1/stream?key=… and send one subscription within 5 seconds, with bbox (at most 10 boxes, each side up to your plan's area limit) and/or mmsi (at most 1,000). The server answers {"type": "subscribed"}, then sends {"type": "position"} messages, and {"type": "status"} when the live view stops or resumes being current.

{"bbox": [[59.9, 24.6, 60.3, 25.2]], "mmsi": [276859000]}

Live responses carry meta.sources, meta.private_vessels, meta.attribution and meta.notice; the stream's subscribed message carries the same fields. Live positions over REST use 1 credit per vessel returned; the stream is included in the plan and uses no credits. Open WebSocket connections are limited per account (Pro 2, Business 5); one more gets 429 Too many connections. While the live view is starting, the live endpoints answer 503 Live data unavailable with Retry-After; when it is not current, they serve the last known state with X-Live-Status: stale and X-Live-Stale-S.

On Free and Starter, the live endpoints answer 403 Plan limit with upgrade_url, and a WebSocket is closed with code 4003. Other close codes: 4000 no subscription in time, 4001 empty subscription, 4002 invalid subscription, 4004 key revoked, 1011 server error. When your account moves to a plan without live data, open streams close with 4003 within about 15 seconds; after a downgrade, the newest streams beyond the new plan's connection limit close the same way. /v1/usage shows your plan's live access.

MCP server

AI assistants and other Model Context Protocol clients can use AIS Trail as a set of read-only tools at https://api.aistrail.com/mcp: setup, every tool and its limits are on the MCP server page.

Found a mistake, or something unclear? Suggest an edit and we will fix the page.