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/sourcesand/v1/openapi.jsonneed 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
tois clamped andmeta.embargo_cutoffsays where. Pro and Business include live data: there is no embargo andembargo_cutoffisnull. - 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.noticeand theX-Noticeheader. - 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
GETandHEADrequests are redirected (301) to HTTPS; other methods andws://WebSocket connections get 403 HTTPS required. - Errors. RFC 9457 problem details. Every status and title is listed on Errors.
Plan limits
| Plan | Credits / month | Requests / second | History | Area queries | Rows per page | Live data |
|---|---|---|---|---|---|---|
| Free | 500 | 1 | Last 7 days | Not included | 1,000 | Not included |
| Starter | 15,000 | 5 | Up to 12 months | Up to 2° × 2° | 50,000 | Not included |
| Pro | 60,000 | 10 | Up to 12 months | Up to 2° × 2° | 50,000 | Included, 2 WebSocket connections |
| Business | 250,000 | 20 | Up to 24 months | Up to 10° × 10° | 50,000 | Included, 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
resolution | What you get | Longest from–to range |
|---|---|---|
raw (default) | Every fix, as received | 24 hours |
1m | The latest real fix per vessel per minute | 7 days |
1h | The latest real fix per vessel per hour | 366 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:
| Request | Credits |
|---|---|
| Historical track | 1 credit per vessel-day: all positions of one vessel on one UTC day |
| Area query | 1 credit per distinct vessel-day in the rows returned |
| Vessel details, batch, IMO lookup, search | 1 credit per vessel returned |
| Port calls | 1 credit per port-call record |
| Vessel events | 1 credit per event record |
| Live position (REST) | 1 credit per vessel returned |
| Vessel density or sea depth at a point | 1 credit per point with a value |
| Vessel density by area | 1 credit per started square degree of the box |
| Submarine cables near a point | 1 credit per cable returned |
| Live WebSocket stream | Included in Pro and Business, no credits |
| Status, sources, usage, docs | Free |
- What is free. Empty results and errors (4xx, 5xx) use no credits.
/v1/status,/v1/sources,/v1/openapi.json,/v1/usageand 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_atandpricing_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 withnext_cursor, search withnext_offset, a batch lists the rest innot_returned, and IMO lookups and live positions settruncated. 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-UsedandX-Credits-Remaining(see Response headers);/v1/usagehas the full balance.
Endpoints
| Endpoint | What it answers | Key |
|---|---|---|
GET /v1/vessels/search | Search vessels by name, call sign, MMSI prefix or IMO | Required |
GET /v1/vessels/{mmsi} | Vessel identity by MMSI: current static data and observation log | Required |
GET /v1/vessels/batch | Vessel details for up to 100 MMSIs and IMO numbers in one request | Required |
GET /v1/vessels/imo/{imo} | MMSIs that have reported this IMO number, newest first | Required |
GET /v1/vessels/{mmsi}/track | Track of one MMSI over a time range | Required |
GET /v1/vessels/imo/{imo}/track | Track of one ship by IMO number, across MMSI changes | Required |
GET /v1/area | Historical positions inside a bounding box (Starter, Pro and Business plans) | Required |
GET /v1/vessels/{mmsi}/port-calls | Port calls of one MMSI over a time range | Required |
GET /v1/vessels/imo/{imo}/port-calls | Port calls of one ship by IMO number, across MMSI changes | Required |
GET /v1/ports/{port_id}/calls | Arrivals, departures and port calls at one port | Required |
GET /v1/ports/{port_id}/expected | Vessels expected at one port, from the port's own records (Pro and Business plans) | Required |
GET /v1/port-calls | Port calls across ports by port, country, UN/LOCODE or box (Starter, Pro and Business plans) | Required |
GET /v1/ports | Search ports by name, country, UN/LOCODE or box | Required |
GET /v1/ports/{port_id} | One port by id | Required |
GET /v1/vessels/{mmsi}/events | Port arrivals and departures, stops and moves, changes of name, IMO, call sign, destination, draught or flag, AIS gaps, close encounters and position jumps | Required |
GET /v1/vessels/imo/{imo}/events | The same events for one ship by IMO number, across MMSI changes | Required |
GET /v1/density | Vessel traffic density at a point, from open data products (European waters) | Required |
GET /v1/density/area | Vessel traffic density statistics for a box (Starter, Pro and Business plans) | Required |
GET /v1/bathymetry | Sea depth at a point | Required |
GET /v1/cables | Submarine cables near a point (NOAA charts and NVE power cables) | Required |
GET /v1/cables/{cable_id}/vessels | Live vessels near a submarine cable (Pro and Business) | Required |
GET /v1/positions | Latest live positions inside a bounding box (Pro and Business) | Required |
GET /v1/vessels/{mmsi}/position | Latest live position of one vessel (Pro and Business) | Required |
/v1/stream | Live positions over WebSocket (Pro and Business) | Required |
GET /v1/usage | Plan, limits and credits (uses no credits) | Required |
GET /v1/sources | Data sources, licenses, required attribution and coverage (public) | Not needed |
GET /v1/status | Service status and data coverage per source (public) | Not needed |
GET /v1/openapi.json | This API as an OpenAPI 3.1 document (public) | Not needed |
POST /mcp | MCP server for AI assistants: live ship tools, and tracks and port calls with a key | Only for the archive tools |
Vessels
GET /v1/vessels/search
Search vessels by name, call sign, MMSI prefix or IMO.
Matches the vessel name or call sign (substring, case-insensitive), the start of an MMSI, or an exact IMO number. Results are ordered by when the vessel was last seen, newest first.
Response: query, offset, results (each with mmsi, name, imo, callsign, ship_type, length_m, last_seen, sources, flag and dwt_estimate, see Vessel particulars, and sanctions, see Sanctions lists), next_offset (null on the last page) and meta (see Response meta). Private vessels are left out unless your account has access to them (see Private vessels).
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
q | query | string | required | 2 to 64 characters |
limit | query | integer | default 20 | 1-50 |
offset | query | integer | default 0 | 0-1000; use next_offset from the previous page |
Status codes: 200, 400, 401, 402, 429, 503.
curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
"https://api.aistrail.com/v1/vessels/search?q=MYSTAR"
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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
mmsi | path | integer | required | 9-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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
mmsi | query | string | optional | Comma-separated 9-digit MMSIs |
imo | query | string | optional | Comma-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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
imo | path | integer | required | 7-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 getnull: 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 asCW. - 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_sourceais_maxortypical). 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
| Field | Type | Description |
|---|---|---|
code | string | ISO 3166-1 alpha-2 country or territory code |
name | string | English short name |
source | mmsi | Derived from the MMSI's MID |
DWT estimate
| Field | Type | Description |
|---|---|---|
tonnes | integer | Estimated deadweight, metric tonnes, rounded to 3 significant digits |
class | string | null | Industry size class, see above |
hull | tanker | bulk | container | passenger | fishing | Hull family used; bulk covers dry bulk and general cargo |
draught_m | number | Draught used, metres |
draught_source | ais_max | typical | ais_max: the deepest draught the vessel has reported; typical: a typical draught for the beam |
method | dimensions | Estimated from the AIS dimensions |
note | string | States 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
| Field | Type | Description |
|---|---|---|
list | OFAC | UK | EU | The list naming the vessel |
programmes | array | Sanctions programmes or regimes, as written on the list |
listed | date | null | Date the vessel was designated, as published on the list |
name | string | null | Vessel name on the list |
ref | string | null | The 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
mmsi | path | integer | required | 9-digit MMSI |
from | query | ISO 8601 date-time | optional | ISO 8601 start (inclusive); default: to minus 24 h |
to | query | ISO 8601 date-time | optional | ISO 8601 end (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff) |
resolution | query | raw | 1m | 1h | default raw | raw = every fix; 1m / 1h = latest fix per vessel per minute / hour (no interpolation) |
format | query | json | geojson | csv | xlsx | default json | json, geojson (application/geo+json), csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers |
include | query | static | none | static for csv and xlsx, none otherwise | static 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 |
limit | query | integer | default 5000; 1000 on Free | Rows per page, up to your plan's maximum (1,000 on Free, 50,000 on paid plans) |
cursor | query | string | optional | Opaque 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
imo | path | integer | required | 7-digit IMO number with a valid check digit |
from | query | ISO 8601 date-time | optional | ISO 8601 start (inclusive); default: to minus 24 h |
to | query | ISO 8601 date-time | optional | ISO 8601 end (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff) |
resolution | query | raw | 1m | 1h | default raw | raw = every fix; 1m / 1h = latest fix per vessel per minute / hour (no interpolation) |
format | query | json | geojson | csv | xlsx | default json | json, geojson (application/geo+json), csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers |
include | query | static | none | static for csv and xlsx, none otherwise | static 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 |
limit | query | integer | default 5000; 1000 on Free | Rows per page, up to your plan's maximum (1,000 on Free, 50,000 on paid plans) |
cursor | query | string | optional | Opaque 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
bbox | query | string | required unless cursor is given | lat_min,lon_min,lat_max,lon_max in decimal degrees; each side at most 2° on Starter and Pro, 10° on Business |
from | query | ISO 8601 date-time | optional | ISO 8601 start (inclusive); default: to minus 1 h |
to | query | ISO 8601 date-time | optional | ISO 8601 end (exclusive); default: now minus 24 hours, the embargo cutoff (now on Pro and Business). Later values are clamped (see meta.embargo_cutoff) |
resolution | query | raw | 1m | 1h | default raw | raw = every fix; 1m / 1h = latest fix per vessel per minute / hour (no interpolation) |
format | query | json | geojson | csv | xlsx | default json | json, geojson (application/geo+json), csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers |
include | query | static | none | static for csv and xlsx, none otherwise | static 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 |
limit | query | integer | default 5000; 1000 on Free | Rows per page, up to your plan's maximum (1,000 on Free, 50,000 on paid plans) |
cursor | query | string | optional | Opaque 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
mmsi | path | integer | required | 9-digit MMSI |
from | query | ISO 8601 date-time | optional | Start of the range; default: to minus 30 days (on Free, no earlier than the oldest day the plan includes) |
to | query | ISO 8601 date-time | optional | End 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 |
event | query | any | arrival | departure | default any | any = calls in port at any time in the range; arrival = calls that arrived in the range; departure = calls that departed in the range |
format | query | json | csv | xlsx | default json | json, csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers |
zones | query | port | anchorage | all | default port | port = 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 |
layout | query | calls | events | default calls | calls = 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 |
limit | query | integer | default 1000 | Port calls per page, up to 10,000 (1,000 on Free) |
cursor | query | string | optional | Opaque 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
imo | path | integer | required | 7-digit IMO number with a valid check digit |
from | query | ISO 8601 date-time | optional | Start of the range; default: to minus 30 days (on Free, no earlier than the oldest day the plan includes) |
to | query | ISO 8601 date-time | optional | End 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 |
event | query | any | arrival | departure | default any | any = calls in port at any time in the range; arrival = calls that arrived in the range; departure = calls that departed in the range |
format | query | json | csv | xlsx | default json | json, csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers |
zones | query | port | anchorage | all | default port | port = 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 |
layout | query | calls | events | default calls | calls = 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 |
limit | query | integer | default 1000 | Port calls per page, up to 10,000 (1,000 on Free) |
cursor | query | string | optional | Opaque 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
port_id | path | integer | required | Port id from /v1/ports |
from | query | ISO 8601 date-time | optional | Start of the range; default: to minus 30 days (on Free, no earlier than the oldest day the plan includes) |
to | query | ISO 8601 date-time | optional | End 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 |
event | query | any | arrival | departure | default any | any = calls in port at any time in the range; arrival = calls that arrived in the range; departure = calls that departed in the range |
format | query | json | csv | xlsx | default json | json, csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers |
zones | query | port | anchorage | all | default port | port = 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 |
layout | query | calls | events | default calls | calls = 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 |
limit | query | integer | default 1000 | Port calls per page, up to 10,000 (1,000 on Free) |
cursor | query | string | optional | Opaque 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
port_id | path | integer | required | Port id from /v1/ports |
limit | query | integer | default 100 | Vessels to return, up to 500 |
format | query | json | csv | default json | json 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/port-calls
Port calls across ports (Starter, Pro and Business plans).
Port calls at every port that matches all the filters given; without filters, every port. Free keys get 403 Plan limit and can use the vessel and single-port endpoints instead. The response meta has no subject field; with a cursor, the filters come from the cursor.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
port_id | query | string | optional | Up to 100 port ids, comma separated |
country | query | string | optional | ISO 3166-1 alpha-2 country code of the port, e.g. DK |
locode | query | string | optional | UN/LOCODE of the port, e.g. DKCPH |
bbox | query | string | optional | lat_min,lon_min,lat_max,lon_max: ports inside the box |
from | query | ISO 8601 date-time | optional | Start of the range; default: to minus 30 days (on Free, no earlier than the oldest day the plan includes) |
to | query | ISO 8601 date-time | optional | End 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 |
event | query | any | arrival | departure | default any | any = calls in port at any time in the range; arrival = calls that arrived in the range; departure = calls that departed in the range |
format | query | json | csv | xlsx | default json | json, csv (text/csv) or xlsx (Excel workbook); csv and xlsx page through the Link / X-Next-Cursor headers |
zones | query | port | anchorage | all | default port | port = 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 |
layout | query | calls | events | default calls | calls = 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 |
limit | query | integer | default 1000 | Port calls per page, up to 10,000 (1,000 on Free) |
cursor | query | string | optional | Opaque 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/port-calls?country=DK&from=2026-10-01&to=2026-10-02&event=departure"
GET /v1/ports
Search ports by name, country, UN/LOCODE or bounding box.
Ports of the World Port Index. q matches the name or an alternate name, without regard to case or accents: exact names first, then names that start with q, then the rest, larger harbors first within each group. Response: ports (see Port), count, total, offset, next_offset (null on the last page) and meta with attribution and notice. Port lookups use no credits.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
q | query | string | optional | 2 to 64 characters |
country | query | string | optional | ISO 3166-1 alpha-2 country code, e.g. DK |
locode | query | string | optional | UN/LOCODE, e.g. DKCPH |
bbox | query | string | optional | lat_min,lon_min,lat_max,lon_max |
port_id | query | string | optional | Up to 100 port ids, comma separated |
limit | query | integer | default 50 | 1-500 |
offset | query | integer | default 0 | 0-10000; use next_offset from the previous page |
format | query | json | csv | xlsx | default json | json, csv (text/csv) or xlsx (Excel workbook); csv and xlsx columns id, name, alternate_names (| separated), country, locode, lat, lon, harbor_size, harbor_type, radius_km, with X-Count, X-Total and X-Attribution headers |
Status codes: 200, 400, 401, 402, 429.
curl -H "Authorization: Bearer $AIS_TRAIL_KEY" \
"https://api.aistrail.com/v1/ports?q=helsinki"
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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
port_id | path | integer | required | Port 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 isPort / LOCODEorPort Anch. / LOCODE, andport.zonesays which.STATE_CHANGED:MOVING,NOT_MOVING(from the start of a stop) orLONG_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_valueis the gap in hours andnew_valuethe 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_nearbycounts 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;nullwhen 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_valueis the duration in hours andnew_valuethe other vessel's MMSI;detailhas 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_valueandnew_valueare flag codes anddetailhas 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_valueis the distance in nautical miles from the last good position andnew_valuethe speed that jump would need, in knots;detail.flagged_in_hourcounts 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
mmsi | path | integer | required | 9-digit MMSI |
from | query | ISO 8601 date-time | optional | Start of the range; default: to minus 7 days (on Free, no earlier than the oldest day the plan includes) |
to | query | ISO 8601 date-time | optional | End 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 |
types | query | string | default: all but the last four | all, 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 |
format | query | json | csv | xlsx | default json | json, 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 |
limit | query | integer | default 1000 | Events per page, up to 10,000 (1,000 on Free) |
cursor | query | string | optional | Opaque 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
imo | path | integer | required | 7-digit IMO number |
from | query | ISO 8601 date-time | optional | Start of the range; default: to minus 7 days (on Free, no earlier than the oldest day the plan includes) |
to | query | ISO 8601 date-time | optional | End 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 |
types | query | string | default: all but the last four | all, 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 |
format | query | json | csv | xlsx | default json | json, 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 |
limit | query | integer | default 1000 | Events per page, up to 10,000 (1,000 on Free) |
cursor | query | string | optional | Opaque 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
lat | query | number | required | Latitude, -90 to 90 |
lon | query | number | required | Longitude, -180 to 180 |
product | query | string | vessel_hours | vessel_hours, route_crossings or uk_transits |
year | query | integer | latest of the product | Year of the product |
ship_type | query | string | all | vessel_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).
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
bbox | query | string | required | lat_min,lon_min,lat_max,lon_max |
product | query | string | vessel_hours | vessel_hours or route_crossings |
year | query | integer | latest of the product | Year of the product |
ship_type | query | string | all | As 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
lat | query | number | required | Latitude, -90 to 90 |
lon | query | number | required | Longitude, -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": […]}.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
lat | query | number | required | Latitude, -90 to 90 |
lon | query | number | required | Longitude, -180 to 180 |
radius_km | query | number | 10 | Search radius in km, 0.01 to 100 |
limit | query | integer | 25 | At 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.
| Name | In | Type | Required / default | Description |
|---|---|---|---|---|
cable_id | path | string | required | Cable id from /v1/cables, for example nve_cables:347 |
distance_km | query | number | 2 | Distance from the cable, 0.01 to 20 km |
max_age | query | number | 3600 | Only 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);propertieshasmmsi,flag,count,coordTimes(the time of every coordinate) andsources. An area is a FeatureCollection of Points whosepropertiesare the position fields. Paging, freshness and attribution are in the top-levelmeta.format=csv(text/csv): columnsmmsi, ts, lat, lon, sog, cog, heading, nav_status, source, flags, flag, then (unlessinclude=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=staticwith json and geojson: the static fields are added to each position (an area's Point properties); a track's LineString getsproperties.static, one object per coordinate in the order ofcoordTimes.
Objects
Position
| Field | Type | Description |
|---|---|---|
mmsi | integer | Maritime Mobile Service Identity of the transmitting vessel (9 digits) |
ts | ISO 8601 date-time | Message timestamp (UTC) as reported by the source |
lat | number | Latitude, decimal degrees |
lon | number | Longitude, decimal degrees |
sog | number | null | Speed over ground, knots |
cog | number | null | Course over ground, degrees |
heading | integer | null | True heading, degrees; null if unavailable (raw 511) |
nav_status | integer | null | ITU-R M.1371 navigational status 0-14 |
source | string | Data source id, see /v1/sources |
flags | string | null | Quality flag, e.g. implausible_jump (kept, never dropped) |
flag | string | null | Flag 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.
| Field | Type | Description |
|---|---|---|
from | ISO 8601 date-time | Start of the range actually served (inclusive) |
to | ISO 8601 date-time | End of the range actually served (exclusive), after embargo clamping |
resolution | raw | 1m | 1h | Resolution of this page |
count | integer | Rows in this page |
complete | boolean | true when there are no more pages (paging only; see data_complete) |
next_cursor | string | null | Pass as ?cursor= to get the next page |
next | string | null | Relative URL of the next page |
embargo_cutoff | ISO 8601 date-time | Data newer than this is not available on your plan (null on plans with live data) |
include | static | none | Whether rows carry static data (the include parameter, or its default for the format) |
sources_through | object | Per source: the archive holds this source's data up to this time, never later than embargo_cutoff (null: no data yet) |
pending_days | object | Per source: UTC days in this range the source has not delivered yet (at most 100) |
missing_days | object | Per source: UTC days in this range up to sources_through without data (at most 100) |
unavailable_days | object | Per 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_complete | boolean | false when pending_days or missing_days is not empty for any source |
private_vessels | excluded | included | Whether private vessels are part of this response for your account |
attribution | array | One entry per source in this page: source, text, license, license_url |
sanctions | array | IMO track only: the official sanctions lists that name this IMO number (see Sanctions lists) |
sanctions_lists | object | IMO track only: the sanctions lists checked |
notice | string | Not-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.
| Field | Type | Description |
|---|---|---|
embargo_cutoff | ISO 8601 date-time | Data newer than this is not available on your plan (null on plans with live data) |
sources_through | object | Per source of your plan: the archive holds its data up to this time, never later than embargo_cutoff |
private_vessels | excluded | included | Whether private vessels are part of this response for your account |
attribution | array | One entry per source in this response: source, text, license, license_url |
sanctions_lists | object | The sanctions lists checked: per list its publication date, fetch time and vessel count, plus a note (see Sanctions lists) |
notice | string | Not-for-navigation notice (also in the X-Notice header) |
Port call
| Field | Type | Description |
|---|---|---|
mmsi | integer | MMSI of the vessel |
imo | integer | null | IMO number reported at arrival; otherwise taken from another report of the same MMSI within 30 days; left empty when the MMSI is ambiguous |
name | string | null | Vessel name reported at arrival; otherwise taken from another report of the same MMSI within 30 days; left empty when the MMSI is ambiguous |
ship_type | integer | null | AIS ship type reported at arrival; otherwise taken from another report of the same MMSI within 30 days; left empty when the MMSI is ambiguous |
flag | string | null | Flag of the vessel: ISO 3166-1 alpha-2 code from the MMSI (see Vessel particulars) |
port | object | The port: id, name, country, locode |
arrival | ISO 8601 date-time | Start of the vessel's stop inside the port area |
departure | ISO 8601 date-time | null | Last position inside the port area before the vessel left; null while it is still in port (or when it left after embargo_cutoff) |
duration_s | integer | null | departure minus arrival, seconds |
draught_arrival_m | number | null | Draught reported at arrival, metres |
draught_departure_m | number | null | Draught reported by departure, metres |
draught_change_m | number | null | draught_departure_m minus draught_arrival_m |
cargo_estimate | loaded | ballast | unchanged | null | From 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_port | object | null | The previous port call (id, name, country, locode, departure), at most 30 days before arrival |
next_port | object | null | The next port call (id, name, country, locode, arrival), at most 30 days after departure |
zone | port | anchorage | port: a call inside the port area; anchorage: a wait at the port's anchorage (see zones) |
sources | array | Data sources the port call was detected in |
sanctions | array | Sanctions 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.
| Field | Type | Description |
|---|---|---|
from | ISO 8601 date-time | Start of the range actually served |
to | ISO 8601 date-time | End of the range actually served (exclusive), after embargo clamping |
event | any | arrival | departure | Which calls the range selects |
layout | calls | events | calls: one row per port call; events: ENTER_ZONE / EXIT_ZONE rows (the layout parameter) |
count | integer | Port calls in this page |
complete | boolean | true when there are no more pages |
next_cursor | string | null | Pass as ?cursor= to get the next page |
next | string | null | Relative URL of the next page |
embargo_cutoff | ISO 8601 date-time | Data newer than this is not available on your plan (null on plans with live data) |
calls_through | object | Per source of your plan: port calls are built from its data up to this time, never later than embargo_cutoff (null: none yet) |
private_vessels | excluded | included | Whether private vessels are part of this response for your account |
attribution | array | One entry per source in this page, and the World Port Index |
sanctions_lists | object | The sanctions lists checked (see Sanctions lists) |
notice | string | Not-for-navigation notice (also in the X-Notice header) |
Port
| Field | Type | Description |
|---|---|---|
id | integer | Port id (World Port Index number) |
name | string | Port name |
alternate_names | array | Other names of the port |
country | string | null | ISO 3166-1 alpha-2 country code |
locode | string | null | UN/LOCODE |
lat, lon | number | Position of the port, decimal degrees |
harbor_size | string | null | Large, Medium, Small or Very Small |
harbor_type | string | null | For example Coastal (Breakwater) or River (Natural) |
radius_km | number | Radius of the port area used to detect port calls |
Problem (errors)
| Field | Type | Description |
|---|---|---|
type | string | URI of the error type: a link to its entry on the Errors page, or about:blank |
title | string | Short, stable title, e.g. Window too large; branch on this and the status |
status | integer | HTTP status code |
detail | string | Human-readable explanation of this occurrence |
retry_after_s | integer | Seconds to wait before retrying. Rate limited, Too many concurrent requests and Server busy also send it as a Retry-After header |
upgrade_url | string | Pricing 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):
| Header | Meaning |
|---|---|
X-Credits-Used | Credits this response used (0 for empty results and errors) |
X-Credits-Remaining | Credits left after this response: monthly credits plus credit packs |
X-Notice | Not-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:
| Header | Meaning |
|---|---|
X-Count | Rows in this page |
X-Complete | true when there are no more pages |
X-Next-Cursor | Cursor of the next page (absent on the last page) |
Link | rel="next" URL of the next page |
X-Attribution | Required attribution for the sources in this page |
X-Data-Through | meta.sources_through as source=time pairs, comma separated (source=- when the source has no data) |
X-Data-Complete | meta.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).
| Endpoint | What it answers |
|---|---|
GET /v1/positions | Latest 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}/position | Latest 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/stream | WebSocket: 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.