AIS Trail

AIS Trail API

Normalized historical AIS vessel positions from public maritime authorities, covering the northern and western Baltic, the Kattegat, the Skagerrak, the North…

Logistics & shipping#transportation

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

Normalized historical AIS vessel positions from public maritime authorities, covering the northern and western Baltic, the Kattegat, the Skagerrak, the North Atlantic coast up to the Barents Sea and the Atlantic, Gulf and Pacific coasts of North America, and from the volunteer receiving stations of the AIS Trail receiver network (areas per source on the sources page): vessel search, tracks by MMSI or IMO, and historical area queries, as JSON, GeoJSON, CSV or Excel; port calls by vessel, IMO or port and across ports, and vessel events, as JSON, CSV or Excel. Live positions from barentswatch, digitraffic and the AIS Trail receiver network's stations (rx- ) come with the Pro and Business plans.

Usage is measured in credits. Each plan includes monthly credits; they renew every billing period (every calendar month, UTC, on Free) and are used first, then credit packs, starting with the pack that expires soonest. Credits per response:

  • 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

Empty results and errors (4xx, 5xx) use no credits. Credits are taken after a successful response. A response never uses more credits than the account has left, less the credits held by its other requests still running (from any of its keys), so requests running at the same time cannot together use more than the 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 from there with next_cursor, search with next_offset, a vessel details batch lists the vessels beyond that in not_returned, and an IMO lookup and live positions set truncated. With no credits free while other requests run, a new request gets 429 (Too many concurrent requests) until they finish. A page of a track continues the vessel-days of the previous page without charging them again; area queries count vessel-days per page. Metered responses carry X-Credits-Used and X-Credits-Remaining. When no credits are left, metered endpoints answer 402 (Out of credits) before running the query, with credits_reset_at and pricing_url. GET /v1/usage shows plan credits, credit packs with their expiry and the credits used this period.

The most recent 24 hours are not available on the history endpoints (embargo) unless your plan includes live data (Pro and Business), which also opens the live endpoints.

Plans:

  • Free (free, $0/month): 500 credits/month, 1 request/s, last 7 days of history in supported coverage regions, area queries not included, up to 1,000 rows per page, no live data (24-hour delay)
  • Starter (starter, $29/month or $290/year): 15,000 credits/month, 5 requests/s, up to 12 months of history in supported coverage regions, area queries up to 2° x 2°, up to 50,000 rows per page, no live data (24-hour delay)
  • Pro (pro, $129/month or $1,290/year): 60,000 credits/month, 10 requests/s, up to 12 months of history in supported coverage regions, area queries up to 2° x 2°, up to 50,000 rows per page, live data with 2 concurrent WebSocket connections per account and no 24-hour delay
  • Business (business, $249/month or $2,490/year): 250,000 credits/month, 20 requests/s, up to 24 months of history in supported coverage regions, area queries up to 10° x 10°, up to 50,000 rows per page, live data with 5 concurrent WebSocket connections per account and no 24-hour delay
  • Credit pack ($49, one-time, any plan including Free): 20,000 credits, valid for 12 months; packs stack

History depth: Free reaches the last 7 days; Starter and Pro reach up to the last 12 months; Business reaches up to the last 24 months in supported coverage regions and up to the last 12 months elsewhere. A from older than that answers 403 (History limit); on the paid plans the response also carries enterprise_url: older data is offered through Enterprise as a one-off file delivery (https://aistrail.com/coverage/). Which products each plan includes in which region, with its history: GET /v1/coverage (public) and https://aistrail.com/coverage/.

Live endpoints (Pro and Business plans): GET /v1/positions, GET /v1/vessels/{mmsi}/position and the WebSocket /v1/stream serve the latest positions from barentswatch, digitraffic and the AIS Trail receiver network's stations (rx- ) only; positions and static data…

Endpoints 29

  • GETService status and data coverage per source (public)/v1/statusstatus is ok or degraded, HTTP 200 in both cases. reasons lists the failed checks as stable codes: dma_stale and digitraffic_stale (that source is behind),…
  • GETData sources, licences, required attribution and coverage (public)/v1/sourcesEach source carries its coverage and available_until: the time up to which its data can be queried, never later than the embargo cutoff (dma lags by its…
  • GETCoverage by region and product (public)/v1/coverageRegions with the products available there (live_api, historical_api, port_intelligence, enterprise_historical, map_only), access (standard plans, enterprise…
  • GETPlan, limits and credits (uses no credits)/v1/usagelabel is the plan's name (for example Pro), limits the plan's limits (credits: monthly credits; live and ws: live data and WebSocket connections). credits:…
  • GETSearch vessels by name, call sign, MMSI prefix or IMO/v1/vessels/search?q=string
  • GETVessel identity by MMSI: current static data and observation log/v1/vessels/:mmsilive_position is the latest live position (a LivePosition) on plans with live data (Pro and Business), null otherwise. flag and dwt_estimate are derived (see…
  • GETTrack of one MMSI over a time range/v1/vessels/:mmsi/trackAt raw resolution, copies of one report received by several sources are returned as one row, with the source and ts of one of the sources that received it.…
  • GETVessel details for up to 100 MMSIs and IMO numbers in one request/v1/vessels/batchEach result carries the identifier asked for (query) and the vessel's latest static data, first and last seen, sources, flag, dwt_estimate and sanctions. An…
  • GETMMSIs that have reported this IMO number, newest first (at most 50 and at most the credits free; truncated=true beyond that; the /track endpoint is not limited)/v1/vessels/imo/:imo
  • GETTrack of one IMO across MMSI changes. Each MMSI counts only while it reported this IMO/v1/vessels/imo/:imo/trackAt raw resolution, copies of one report received by several sources are returned as one row, with the source and ts of one of the sources that received it.…
  • GETHistorical positions inside a bounding box (Starter, Pro and Business plans)/v1/areaRows are returned day by day and, at raw resolution, area by area within a day; inside each group ordered by vessel and time. Follow next_cursor until…
  • GETEvents of one MMSI: port arrivals and departures, stops and moves, and changes of name, IMO, call sign, destination or draught/v1/vessels/:mmsi/eventsComputed from the archive when requested, ordered by time, for up to the last 12 months on every plan. Static changes are detected per source; the same change…
  • GETEvents of one IMO across MMSI changes. Each MMSI counts only while it reported this IMO/v1/vessels/imo/:imo/events
  • GETPort calls of one MMSI over a time range/v1/vessels/:mmsi/port-callsOrdered by arrival (by departure with event=departure). A private vessel without access returns an empty page, like a vessel without port calls.
  • GETPort calls of one IMO across MMSI changes. Each MMSI counts only while it reported this IMO/v1/vessels/imo/:imo/port-calls
  • GETArrivals, departures and port calls at one port over a time range/v1/ports/:port_id/callsmeta.port is the port (a Port).
  • GETVessels expected at one port, from the port's own records (Pro and Business plans)/v1/ports/:port_id/expectedVessels that have not arrived yet, with their estimated time of arrival, departure, berth and declared previous port, in order of arrival time: arrivals…
  • GETPort calls across ports, filtered by port, country, UN/LOCODE or bounding box (Starter, Pro and Business plans)/v1/port-callsFilters combine (all must match); without filters every port is included. meta carries no subject field.
  • GETSearch ports by name, country, UN/LOCODE or bounding box/v1/portsPorts of the World Port Index and UN/LOCODE. q matches the name or an alternate name (case and accent insensitive): exact names first, then names starting…
  • GETOne port: name, country, UN/LOCODE, position, harbor size and type, port area radius/v1/ports/:port_idUses no credits.
  • GETLatest live position (Pro and Business plans; sources: `barentswatch`, `digitraffic` and the AIS Trail receiver network's stations (`rx-<id>`))/v1/vessels/:mmsi/position404 when the vessel has no live position in your plan's live sources, with the same detail for a private or withdrawn vessel. 503 while the live view is…
  • GETLatest live positions in a box (Pro and Business plans; sources: `barentswatch`, `digitraffic` and the AIS Trail receiver network's stations (`rx-<id>`))/v1/positions?bbox=stringUp to 2000 vessels and at most the credits free; truncated is true when there are more. 503 while the live view is starting.
  • GETVessel traffic density at a point (open data products, European waters)/v1/density?lat=0.0&lon=0.0Annual traffic density from open data products, as published: vessel_hours (EMODnet Human Activities Vessel Density, 2017-2024: hours per km² per month,…
  • GETVessel traffic density statistics for an area (Starter, Pro and Business plans)/v1/density/area?bbox=stringCells with a value, mean, maximum and 90th percentile of the product in the box; for vessel_hours also the total vessel-hours per month (value times true cell…
  • GETSea depth at a point (EMODnet Bathymetry in European seas, GEBCO elsewhere)/v1/bathymetry?lat=0.0&lon=0.0elevation_m is negative below sea level; depth_m is its positive depth, null on land. In European seas the EMODnet Digital Bathymetry (DTM 2024, about 115 m,…
  • GETSubmarine cables near a point (official open data: NOAA charts, NVE power cables)/v1/cables?lat=0.0&lon=0.0Cables within radius_km of the point, nearest first: id, dataset, kind (power, telecom or unknown), name, owner, voltage_kv or category where the source gives…
  • GETLive vessels near a submarine cable (Pro and Business plans; sources: `barentswatch`, `digitraffic` and the AIS Trail receiver network's stations (`rx-<id>`))/v1/cables/:cable_id/vesselsLatest live positions within distance_km of the cable's line, nearest first, with distance_km; the same live sources, private-vessel rules and credits as…
  • GETLive WebSocket stream (Pro and Business plans; sources: `barentswatch`, `digitraffic` and the AIS Trail receiver network's stations (`rx-<id>`)). ?key= is accepted here only/v1/streamSend one subscription message within 5 s: {"bbox":[[lat_min,lon_min,lat_max,lon_max],…]} and/or {"mmsi":[…]}; at most 10 boxes, each side at most the plan's…
  • GETThis document/v1/openapi.json

API details

Base URL
https://api.aistrail.com
Authentication
A bearer token in the Authorization header
Operations
29 operations on 29 pathsGET 29
Response formats
application/json text/csv application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/geo+json
Description format
OpenAPI 3.1.0, API version 1.9.0

How to test the AIS Trail API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the AIS Trail API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses A bearer token in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Service status and data coverage per source (public)” (GET /v1/status), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the AIS Trail API?

Normalized historical AIS vessel positions from public maritime authorities, covering the northern and western Baltic, the Kattegat, the Skagerrak, the North… It is listed under Logistics & shipping and has 29 endpoints.

Who publishes the AIS Trail API?

It is listed from AIS Trail's public API description (an OpenAPI document), not published by AIS Trail on Swastik Codes. Anyone who controls aistrail.com can claim the profile by adding a DNS TXT record.

What is the base URL of the AIS Trail API?

Requests go to https://api.aistrail.com. Endpoint paths are added to this base URL.

How do I authenticate with the AIS Trail API?

With A bearer token in the Authorization header.

How many endpoints does the AIS Trail API have?

29 operations on 29 paths (29 GET).

Is forking the AIS Trail API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.