---
title: "Live WebSocket stream (Pro and Business plans; sources: `aisstream`, `barentswatch`, `digitraffic`, `openwaters`). ?key= is accepted here only"
method: GET
path: "/v1/stream"
---

# Live WebSocket stream (Pro and Business plans; sources: \`aisstream\`, \`barentswatch\`, \`digitraffic\`, \`openwaters\`). ?key= is accepted here only

`GET /v1/stream`

## Request

- Base URL: `https://api.aistrail.com`
- URL: `https://api.aistrail.com/v1/stream`
- Auth: HTTP bearer

Send 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 max_bbox_deg, and 1000 MMSIs. The server answers {"type":"subscribed"} with bbox, mmsi, sources, private_vessels, attribution and notice, then sends {"type":"position"} messages (the Position fields with rot and ais_class) and {"type":"status","live":"stale"|"ok","since":…} when the live view stops or resumes being current. The stream is included in the plan and uses no credits; concurrent connections are limited per account (429 Too many connections). Close codes: 4000 no subscription in time, 4001 empty subscription, 4002 invalid subscription, 4003 not included in your plan (also after a plan change, when the subscription exceeds the new plan, or for the newest streams beyond the new plan's connection limit), 4004 API key revoked, 1011 server error.

## Other responses

- `101`: switching protocols
- `401`: RFC 9457 problem details
- `403`: RFC 9457 problem details
- `429`: RFC 9457 problem details

---

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