API documentation
Last updated 4 November 2026
Members read the live data of the member stations on api.aiscommons.org, over four channels: REST, a WebSocket stream of decoded messages, a raw NMEA stream and a polling format that some existing tools speak. One API key opens all four. This page describes each channel as it works today; how a station feeds the exchange is on the feeding page. The member terms are the contract; where this page and the terms differ, the terms apply, and section 10 of the terms sets the limits.
Paste a key from the API keys page. It fills in every example on this page and lets you send the REST calls below from your browser. This page does not save the key and clears the field when you leave or reload. Calls from this page send it only to api.aiscommons.org. Create a key for this page and revoke it when you are done, and do not paste it on a shared computer. Calls sent from here count towards your limits like any others.
Quick start
The same request in a few languages: the vessels in a box off Malaga, then the live stream of the same area. The examples use your key once you paste it above.
curl -H "Authorization: Bearer aisc_your_key" \ "https://api.aiscommons.org/v1/vessels?latmin=36.5&latmax=36.9&lonmin=-4.6&lonmax=-4.2"
# pip install requests
import requests
KEY = "aisc_your_key"
box = {"latmin": 36.5, "latmax": 36.9, "lonmin": -4.6, "lonmax": -4.2}
after = None
while True:
params = dict(box, after=after) if after else box
r = requests.get("https://api.aiscommons.org/v1/vessels", params=params,
headers={"Authorization": f"Bearer {KEY}"}, timeout=30)
if r.status_code != 200:
raise SystemExit(f"{r.status_code}: {r.json()['error']}")
page = r.json()
for v in page["vessels"]:
print(v["mmsi"], v.get("name", ""), round(v["lat"], 5), round(v["lon"], 5), v["sog"])
after = page["next"]
if after is None:
break
// Node.js 18 or later, saved as an .mjs file, or the browser console on this page
const KEY = "aisc_your_key";
const url = "https://api.aiscommons.org/v1/vessels?latmin=36.5&latmax=36.9&lonmin=-4.6&lonmax=-4.2";
const res = await fetch(url, { headers: { Authorization: `Bearer ${KEY}` } });
const body = await res.json();
if (!res.ok) throw new Error(`${res.status}: ${body.error}`);
for (const v of body.vessels) {
console.log(v.mmsi, v.name ?? "", v.lat.toFixed(5), v.lon.toFixed(5), v.sog);
}
# pip install websockets
import asyncio, json
import websockets
async def main():
async with websockets.connect("wss://api.aiscommons.org/v1/stream") as ws:
await ws.send(json.dumps({
"APIKey": "aisc_your_key",
"BoundingBoxes": [[[36.5, -4.6], [36.9, -4.2]]],
"FilterMessageTypes": ["PositionReport", "StandardClassBPositionReport"],
}))
async for frame in ws:
msg = json.loads(frame)
if "error" in msg:
raise SystemExit(msg["error"])
kind = msg["MessageType"]
if kind in ("PositionReport", "StandardClassBPositionReport"):
p = msg["Message"][kind]
print(p["UserID"], msg["MetaData"]["ShipName"], p["Latitude"], p["Longitude"], p["Sog"])
asyncio.run(main())
import socket
# unencrypted: the key travels in clear; /v1/nmea is the encrypted way
with socket.create_connection(("api.aiscommons.org", 10111)) as s:
s.sendall(b"aisc_your_key\r\n")
for line in s.makefile("r", encoding="ascii", errors="replace"):
if line.startswith("#"):
raise SystemExit(line.strip()) # a refusal, then the connection closes
print(line.rstrip())
Keys and access
You create keys on the API keys page. A key starts with aisc_ and is shown once; we keep only a hash of it and its first characters, so that you can tell your keys apart. You can hold several keys, for example one per program, and revoke any of them at any time.
A key goes in the Authorization header or in the address:
Authorization: Bearer aisc_your_key
https://api.aiscommons.org/v1/vessels?key=aisc_your_key
The header keeps the key out of the addresses that proxies and browsers record.
Access follows feeding. A key works while one of your stations sends data that passes our checks. A new station opens access while its last such data is less than 1 hour old. After 1,000 messages that pass our checks, on at least 3 different days, the station becomes active and keeps access through silences of up to 72 hours. Access comes back by itself when data flows again, unless the station is suspended (section 11 of the terms). While no station of yours opens access, REST answers with the status 403 and a message that says so, and the streams refuse the connection as their sections describe. GET /v1/stations/mine lists the stations the key's member owns; a member without a station gets an empty list.
What the feed contains
The feed carries every AIS message that a member station received and that passed our checks. The checks judge each line on its own and drop single lines, never a station. At present a line is dropped when its MMSI follows no numbering pattern or carries a country code no country has, when the vessel would have needed more than 100 knots to cover more than 5 km since its previous position, or, for feeders that send timestamps, when a line arrives more than 10 minutes later than the station's usual delay. Stations without an owner, which send to the open port (UDP 10110, see the feeding page), are shown on the public map and stay out of the feed.
Positions stay in the live data for about 2 hours. A vessel that no member station has heard for 2 hours disappears from REST and from the polling format; the privacy notice describes retention in full. The streams carry each message as it arrives. Class B vessels appear 30 minutes late on the public map only; the member channels carry them as they arrive.
AIS data can include personal data, for example the position of a private boat. What you do with the data you receive is your own responsibility under data protection law (section 8 of the terms).
The feed is not for navigation or for the safety of life. Positions arrive with a delay, can be wrong and can stop at any time (section 12 of the terms). Names, destinations and station names come from vessels and members as they sent them; the legal notice says how to report anything unlawful.
Every message type is in the feed, including static data, base station reports and aids to navigation. REST and the polling format answer from the newest position of each vessel. The streams carry each transmission once, as the first station delivers it; a copy that another station hears within 30 seconds is not sent again, so the station named in a stream message is the one that delivered it first. A message received by a station aboard a vessel whose owner keeps it Hidden carries station 0 in REST and in the raw stream.
REST
Every REST call needs the key, the station list included. All REST calls together are limited to 120 a minute per member; no quota header is sent, only Retry-After on a refusal. Answers are JSON. Times are in UTC, written as RFC 3339 with a fraction of a second of up to nine digits, trailing zeros removed (2026-11-02T14:03:21.953226743Z); a parser has to accept any number of digits. Positions carry the precision of the decoded message, for example 36.704899999999995, so round them for display. sog, cog, heading and nav_status are null when the vessel did not send them. The static fields, name to eni, are left out of the object one by one when we do not have them.
GET /v1/vessels
The newest position of every vessel heard in the last 2 hours, with the vessel's static data when we have it.
| Parameter | Meaning |
|---|---|
latmin, latmax, lonmin, lonmax | A bounding box in degrees. Either all four or none. lonmin above lonmax is a box across the antimeridian. |
limit | Vessels per page, 1 to 10,000. The default is 10,000. |
after | The next value of the previous page. Pages are ordered by MMSI, and the vessel with the MMSI given as after is not included again. |
curl -H "Authorization: Bearer aisc_your_key" \ "https://api.aiscommons.org/v1/vessels?latmin=36.5&latmax=36.9&lonmin=-4.6&lonmax=-4.2"
{
"vessels": [
{
"mmsi": 299123450,
"time": "2026-11-02T14:03:21.953226743Z",
"lat": 36.7102,
"lon": -4.4197999999999995,
"sog": 11.3,
"cog": 254,
"heading": 253,
"nav_status": 0,
"accuracy": true,
"msg_type": 1,
"station": 42,
"name": "EXAMPLE",
"call_sign": "EAAA",
"imo": 9123456,
"ship_type": 70,
"dimensions": {"a": 120, "b": 30, "c": 12, "d": 10},
"draught": 7.5,
"destination": "VALENCIA",
"eta": "11-03 06:00"
}
],
"next": null
}
next is the MMSI to pass as after for the following page, or null on the last page. Values in the examples on this page are made up.
| Field | Meaning |
|---|---|
mmsi | The vessel's MMSI. |
time | When the position was received. |
lat, lon | Position in degrees. |
sog, cog | Speed over ground in knots and course over ground in degrees. |
heading | True heading in degrees. |
nav_status | Navigational status, 0 to 15 as in the AIS message. |
accuracy | true when the vessel reports a position accuracy of 10 metres or better. |
msg_type | The AIS message type the position came from (1, 2, 3, 18, 19 or 27). |
station | The id of the station that received this position, or 0 when that station is aboard a vessel and its owner keeps it Hidden. |
name, call_sign, imo, ship_type | From the vessel's static data; ship_type is the AIS type code. |
dimensions | Distance in metres from the AIS antenna to bow (a), stern (b), port (c) and starboard (d). |
draught, destination, eta | From the voyage data; eta is MM-DD HH:MM in UTC, as the vessel sent it. |
eni | The European vessel number of an inland vessel, when it sent one. |
GET /v1/vessels/{mmsi}
One vessel, as a single object of the shape above, without the vessels wrapper. Status 404 when no member station has heard it in the last 2 hours. The MMSI in the example is made up, so "Try it" below first asks for a vessel the network hears now and fills in its MMSI.
curl -H "Authorization: Bearer aisc_your_key" https://api.aiscommons.org/v1/vessels/299123450
GET /v1/stations
The stations of the network, as every member may see them: registered stations, and stations without an owner that sent data in the last 7 days. vessels_this_hour is the number of distinct vessels the station has heard since the start of the current UTC hour. last_data is written about once a minute, so it can trail the newest position by up to a minute; it is null for a station that has never sent data.
{
"stations": [
{
"id": 42,
"name": "Example station",
"state": "active",
"kind": "fixed",
"lat": 54.3,
"lon": 10.1,
"approximate": true,
"last_data": "2026-11-02T14:03:25Z",
"vessels_this_hour": 27
}
]
}
A position the owner gave is rounded to a tenth of a degree, about 11 km, and moved to the nearest land within that distance when the rounded point falls in the sea (section 7 of the terms), unless the owner chose to show the exact position; approximate says which. A rounded position that was moved ashore is therefore not always a multiple of a tenth of a degree. A station the owner has not placed is shown at a rounded estimate from the vessels it hears, or with lat and lon null when it hears none. name is left out when the owner gave none. state is one of unclaimed (no owner), probation, active, paused or suspended; section 9 of the terms explains them.
kind is fixed for a station on land or on a fixed structure, and mobile for a station aboard a vessel. A mobile station's position is the vessel's newest position in the member feed. The owner's setting Station rounds it to about 11 km, and approximate is true. With Ship and station the position is exact, approximate is false, and vessel_mmsi gives the vessel's MMSI; with any other setting the field is left out. lat and lon are null, with approximate true, while the owner keeps the station Hidden, before the vessel's MMSI is confirmed, while the vessel is hidden, or when no member station has heard the vessel in the last 2 hours or so. Section 7 of the terms describes the owner's choices.
GET /v1/stations/mine
The stations owned by the key's member, with their exact position and what the checks said about their lines over the last 24 hours. Lines that could not be read at all are not in these numbers; the station page shows them.
{
"stations": [
{
"id": 42,
"name": "Example station",
"state": "active",
"kind": "fixed",
"lat": 54.3287,
"lon": 10.1392,
"approximate": false,
"last_data": "2026-11-02T14:03:25Z",
"vessels_this_hour": 27,
"checks_24h": {
"passed": 41230,
"dropped": 15,
"by_rule": {"identity.mmsi": 12, "physics.implied_speed": 3}
}
}
]
}
For a station aboard a vessel, lat and lon are the latest own position from the vessel's transponder sentences, and vessel_mmsi gives the vessel's MMSI once it is known, whatever the publication setting.
by_rule counts every finding: dropped lines under identity.mmsi, physics.implied_speed and physics.stale, and noted lines, which are used as usual, under identity.sender, physics.jump and physics.on_land. Its total can therefore exceed dropped. The station page shows the same numbers with the reasons in plain words.
WebSocket stream
The stream sends the messages of the feed as they arrive, decoded to JSON, filtered by the subscription you send. The message shape follows a JSON format that several existing AIS clients already speak, so such a client usually needs only the host and the key changed. The path /v0/stream is accepted as well. Every frame on the socket is a JSON object: the confirmation, the data messages and the Dropped notices carry MessageType, and an error frame is {"error": "..."} without one, so a client sorts frames by that field.
wss://api.aiscommons.org/v1/stream
Within 10 seconds of connecting, the client sends one JSON message:
{
"APIKey": "aisc_your_key",
"BoundingBoxes": [[[35.0, -6.0], [37.5, -1.0]]],
"FiltersShipMMSI": ["299123450"],
"FilterMessageTypes": ["PositionReport", "ShipStaticData"]
}
| Field | Meaning |
|---|---|
APIKey | Your key. The Authorization header works too; the key parameter of the address is not read on this path. |
BoundingBoxes | A list of boxes, each as two opposite corners written [latitude, longitude], in either order. The corners are read as opposite corners, so a box written from longitude 170 to -170 is read as the box from -170 to 170, almost the whole world, not the strip across the antimeridian; for that strip send two boxes, one from 170 to 180 and one from -180 to -170. A message passes when its position is inside any box. No box, or an empty list, means the whole world. A message that carries no position, such as static data, is placed at the vessel's newest position in the live data, when there is one, and passes a box that contains it. Without such a position (a vessel not heard in the last 2 hours, base station and binary messages) it passes only when there is no box, and MetaData gives 0 for latitude and longitude. |
FiltersShipMMSI | Up to 1,000 MMSIs as strings. Optional. |
FilterMessageTypes | Message type names from the list below. Optional. A name not in the list is answered with an error frame. |
The message type names, each with the AIS message numbers it covers:
PositionReport1, 2, 3BaseStationReport4, 11ShipStaticData5AddressedBinaryMessage6BinaryAcknowledge7, 13BinaryBroadcastMessage8StandardSearchAndRescueAircraftReport9CoordinatedUTCInquiry10AddressedSafetyMessage12SafetyBroadcastMessage14Interrogation15AssignedModeCommand16GnssBroadcastBinaryMessage17StandardClassBPositionReport18ExtendedClassBPositionReport19DataLinkManagementMessage20AidsToNavigationReport21ChannelManagement22GroupAssignmentCommand23StaticDataReport24SingleSlotBinaryMessage25MultiSlotBinaryMessage26LongRangeAisBroadcastMessage27
The server answers first with a confirmation, whose CompressionEnabled says whether per-message compression was negotiated, then with one message per AIS message:
{"Message": {"CompressionEnabled": true}, "MessageType": "SubscriptionConfirmation"}
{
"Message": {
"PositionReport": {
"UserID": 299123450,
"Latitude": 36.7102,
"Longitude": -4.4197999999999995,
"Sog": 11.3,
"Cog": 254,
"TrueHeading": 253,
"NavigationalStatus": 0,
"Timestamp": 21
}
},
"MessageType": "PositionReport",
"MetaData": {
"MMSI": 299123450,
"MMSI_String": 299123450,
"ShipName": "EXAMPLE",
"latitude": 36.7102,
"longitude": -4.4197999999999995,
"time_utc": "2026-11-02 14:03:21.48213907 +0000 UTC"
}
}
The object under Message is keyed by the message type and holds every decoded field of that type, including MessageID, RepeatIndicator and the raw flags; the example is shortened. Positions are in degrees, speed in knots, course and heading in degrees; other numeric fields, the rate of turn among them, hold the value as coded in the message. MMSI and MMSI_String are both JSON numbers, whatever the second name suggests. MetaData gives the vessel's name, the position of the message or else the vessel's newest position, and the time we received the message. ShipName is empty and latitude and longitude are 0 when we know neither. The fraction of a second in time_utc has up to nine digits, trailing zeros removed.
You can change the subscription by sending a new message on the same connection. The new message replaces the whole subscription, APIKey is not needed again, and no new confirmation follows. Changes are taken once a second: a message that arrives sooner, or one that cannot be read, is answered with an error frame and leaves the previous subscription in force, and the connection stays open. The error frames that close the connection are the ones for the first message, for a key that stops working and for a client that falls behind; the close code is then 1008, with an empty reason. The server sends a ping every 30 seconds. A client that falls behind receives, every 10 seconds while it lasts, a notice {"Message": {"Dropped": {"Count": 120, "Since": "...", "Until": "..."}}, "MessageType": "Dropped"}; after a minute of falling behind the connection is closed, with the reason in an error frame {"error": "..."}. A smaller bounding box or a faster link helps. Each member may hold 5 stream connections at once.
Raw NMEA stream
The raw stream sends the messages of the feed as NMEA 0183 sentences, one line per sentence, ending in CR LF on TCP, for tools that decode AIS themselves. The parts of a multi-part message arrive as consecutive lines, each with its own TAG block and without a g: group field, so the decoder reassembles them by the sentence fields. Each sentence carries a TAG block (NMEA 4.10) in front of it, with the id of the station that received it and the time we received it in Unix seconds:
\s:42,c:1793628201*39\!AIVDM,1,1,,A,14MA2vPP1iwci8hE0GR9s7rb0000,0*13
Tools that reject TAG blocks can get the sentences without them, on the WebSocket and through address bindings; on TCP with a key line the TAG blocks are always there. There are three ways in, all with the same key, and together they count towards 5 connections per member.
TCP, port 10111
api.aiscommons.org:10111
Within 10 seconds of connecting, the client sends its key as the first line, ending in a line feed (a carriage return before it is fine): the key alone, or A|T| followed by the key, a first line some NMEA tools can already send. Nothing else the client sends is read, but the sending side has to stay open: when the client closes it, the connection ends. This connection is unencrypted, so the key travels in clear; the WebSocket below is the encrypted version.
(printf 'aisc_your_key\r\n'; cat) | nc api.aiscommons.org 10111
A refusal arrives as one comment line starting with #, which NMEA tools skip, and the connection closes.
WebSocket, /v1/nmea
wss://api.aiscommons.org/v1/nmea?key=aisc_your_key
One sentence per text message, over TLS, without a line ending. The key goes in the address or in the Authorization header. ?tags=0 leaves the TAG blocks off. Nothing the client sends is read.
Address bindings
Some tools can send nothing after connecting, for example chart plotters and NMEA routers. For them you bind the address they connect from to your key, and connections from that address are let in without a key line. Anything that connects from that address is let in, so bind only an address that is yours alone; on a shared or mobile network, send a key line or use the WebSocket instead. A chart plotter that shows our feed beside its own radio targets should treat our targets as information only.
| Call | Meaning |
|---|---|
PUT /v1/keys/current/address | Binds the address you call from to the key of the request, or renews the binding; both answer 200 with the binding. The body is empty, or a JSON object with shared and tags, each true or false; what is left out keeps its value, and an unknown field is answered 400. |
GET /v1/keys/current/address | Shows the key's binding, or says why it has none. |
DELETE /v1/keys/current/address | Removes it; the answer is 204 with no body. |
curl -X PUT -H "Authorization: Bearer aisc_your_key" https://api.aiscommons.org/v1/keys/current/address
Try it below shows the key's current binding. Binding has to be called from the network the tool runs on, so it is not offered here.
{
"address": "203.0.113.7/32",
"shared": false,
"tags": true,
"host": "api.aiscommons.org",
"port": 10111,
"bound_at": "2026-11-02T14:00:00Z",
"renewed_at": "2026-11-02T14:00:00Z",
"lapses_at": "2026-11-09T14:00:00Z"
}
An exclusive binding (the default) opens port 10111 to the address. One key holds an address on 10111 at a time; another key can take it over once the binding has gone 10 minutes without a connection (or 10 minutes after a release of ours, when the record of recent connections starts empty), and the answer to GET then says so. A shared binding ({"shared": true}) gives the key a port of its own between 11000 and 11999, named in the answer, so several keys can stream to one address. A key holds one binding at a time: sending shared with the other value replaces it, and bound_at starts again. With a shared binding, a connection to port 10111 from that address is no longer let in without a key line: it waits 10 seconds for one and is then closed with a # comment line, so use the port named in the answer. host in the answer is the host to connect to. {"tags": false} sends the sentences without TAG blocks on connections through the binding.
A binding lapses 7 days after its last renewal. Calling PUT once a day keeps it. The address is the one you call from, counted as the whole /64 for IPv6, so the tool and the renewal have to run behind the same public address. api.aiscommons.org answers on IPv4 and IPv6, and a binding covers the one family you called from, so a tool on a dual-stack network has to use the same family as the renewal. On port 10111 a connection from a bound address may still send a line of the form aisc_... within 2 seconds and is then treated by that key; anything else leaves the binding in force. On a key's own port nothing the client sends is read. After a lapse, GET answers 404 and names the lapse for about an hour, then 404 with the message that the key has no address binding. The privacy notice says how long we keep the address.
Polling format
For software that polls an aggregator for a vessel list with the parameters username, format, output and compress, the same requests work here with your key as the username. The answer follows that shape, so such software usually needs only the address and the username changed; the differences we know of are listed below. Each of the two addresses answers one request a minute per member; a second request within the minute is answered with status 429.
https://api.aiscommons.org/ws.php?username=aisc_your_key&format=1&output=json&compress=0
| Parameter | Meaning |
|---|---|
username | Your key. |
format | 0 for raw AIS values (position in degrees times 600,000, speed, course and draught times 10, time as a string of Unix seconds, ETA packed as in message 5), 1 for readable values (degrees, knots, 2026-11-02 14:03:21 GMT). |
output | json, xml or csv. |
compress | 0 none, 1 zip, 2 gzip, 3 bzip2. The answer is always sent as a file download (Content-Disposition: attachment), named data.json, data.xml or data.csv, with the compressed names below. |
latmin, latmax, lonmin, lonmax | A bounding box in degrees. Optional. |
mmsi, imo | Comma-separated lists to keep only these vessels. Optional. |
interval | Keep only positions newer than this many minutes. Optional. |
The JSON answer is an array of two elements, a header and the vessel list. USERNAME echoes the first eleven characters of the key, and FORMAT is AIS for format 0 and HUMAN for format 1:
[{"ERROR":false,"USERNAME":"aisc_abcdef","FORMAT":"HUMAN","RECORDS":1},
[{"MMSI":299123450,"TIME":"2026-11-02 14:03:21 GMT","LONGITUDE":-4.4198,"LATITUDE":36.7102,"COG":254,"SOG":11.3,
"HEADING":253,"ROT":128,"NAVSTAT":0,"IMO":9123456,"NAME":"EXAMPLE","CALLSIGN":"EAAA","TYPE":70,
"A":120,"B":30,"C":12,"D":10,"DRAUGHT":7.5,"DEST":"VALENCIA","ETA":"11-03 06:00"}]]
Values a vessel has not sent are the AIS "not available" values: heading 511, course 360 (3600 in format 0), speed 102.4 (1024), navigational status 15, 0 for IMO, type, dimensions and draught, empty strings for name, call sign and destination, and an ETA of 00-00 24:60 (1596 in format 0; the packing is month times 65,536 plus day times 2,048 plus hour times 64 plus minute). The rate of turn is always 128, the "not available" value, because the intake does not keep it. The XML output has the header as attributes of the root VESSELS and one self-closing vessel element per vessel, with the same fields as attributes. The CSV output has its own header: TSTAMP, latitude before longitude, no ROT, strings quoted, sent as application/csv.
The station list is at /stations.php with the same username, output and compress, and id for one station. The answer has the same two-element shape, with a header of ERROR, USERNAME and RECORDS, and one object per station: ID, LASTUPDATE (the time of its last data), COUNTRY (always empty), LOCATION (the station name), SHIPS (vessels whose newest position came from this station), DISTINCT (distinct vessels heard since the start of the hour) and CONTRIBUTOR (always empty). No position is given. In XML the root is STATIONS with station elements.
https://api.aiscommons.org/stations.php?username=aisc_your_key&output=json
A wrong key or a key without access is answered as this format does it: status 200 with ERROR true and the message in ERROR_MESSAGE (Invalid username or password!, or a sentence saying that access opens while a station of yours sends data); such a request does not use up the minute. A second request within the minute gets the same envelope with status 429, Retry-After: 60 and the message Too frequent requests!, for example [{"ERROR":true,"USERNAME":"aisc_abcdef","FORMAT":"HUMAN","ERROR_MESSAGE":"Too frequent requests!"}]; in XML the message is an ERROR_MESSAGE element under the root. With compress above 0 the body is the compressed file itself, with no Content-Encoding: data.zip holding data.json (or .xml, .csv) for 1, data.json.gz for 2 and data.json.bz2 for 3, all sent as application/octet-stream.
Limits and errors
The limits are counted per member, not per key, and are the ones in section 10 of the terms:
| Channel | Limit |
|---|---|
| REST, address bindings included | 120 calls a minute |
| WebSocket stream | 5 connections at once, up to 1,000 MMSIs in a subscription |
| Raw NMEA stream, all three ways together | 5 connections at once |
| Polling format | 1 request a minute for the vessel list and 1 for the station list |
We may raise a limit at any time, and we lower one only by changing the terms. If a limit is in your way, please write to hello@aiscommons.org.
REST and the bindings answer errors as JSON with the HTTP status; only a path that does not exist is answered 404 as plain text:
{"error": "This key is not valid. Check that it was copied in full, or issue a new one."}
| Status | Meaning |
|---|---|
| 400 | A parameter could not be read. The message names the parameter group (for a bounding box always all four of latmin, latmax, lonmin and lonmax), not the value at fault. Latitudes run from -90 to 90 and longitudes from -180 to 180, and the two longitudes of a box must differ. |
| 401 | No key, or a key we do not know; the two messages differ. |
| 403 | The key is valid and none of your stations opens access at the moment. |
| 404 | No position for this MMSI in the last 2 hours, or no binding. |
| 409 | Another key holds this address on port 10111 and has used it in the last 10 minutes. |
| 429 | A limit is reached. Retry-After says in how many seconds to try again. An address that has sent 30 wrong keys within a minute is answered 429 for every key until its count falls below the limit again. |
| 503 | We cannot answer at the moment, usually for a minute during a release. Please try again. |
/v1/stream answers with an error frame {"error": "..."} and closes. The raw stream has no safe place for a notice: TCP writes a # comment line and closes, and /v1/nmea answers with the HTTP status before the connection opens and with a # text message afterwards. The raw stream sends no Dropped notice; a client that falls behind for a minute is closed. A stream connection is checked against your access once a minute: a revoked key closes it within a minute, and access that ends because your stations fell silent closes it within a few minutes. REST answers 403 on the same timescale.
REST answers are not compressed; the WebSocket negotiates per-message compression. REST allows browser calls from this website only, for "Try it" on this page; a page on another site cannot call it from the browser. The streams do not accept browser connections.
A change that withdraws a channel or makes access worse is announced under section 13 of the terms. Additions and corrections appear on this page with a new date. Questions and reports of anything that does not match this page are welcome at hello@aiscommons.org.