The world feed, by API.
Qualifying stations get a key to the whole AISMesh feed. Parameters keep the AISHub names. A script you already run switches by changing one address. The rest is ours: a fresh picture every minute, changes only, raw NMEA and clean JSON. Steady stations also get every message in hourly files.
KEY stands for that key; the vessels in the samples are invented.Quick start
Ask for an area and you get the vessels in it, newest position first. Call again after a minute with since and you get only the vessels that changed.
curl -s --compressed "https://api.aismesh.com/ws.php?username=KEY&latmin=50&latmax=52&lonmin=0&lonmax=3"
import time, requests
URL = "https://api.aismesh.com/ws.php"
params = {"username": "KEY", "latmin": 50, "latmax": 52, "lonmin": 0, "lonmax": 3}
while True:
r = requests.get(URL, params=params, timeout=20)
if r.status_code == 429:
time.sleep(int(r.headers.get("Retry-After", 60)))
continue
r.raise_for_status()
data = r.json()
for v in data["vessels"]:
print(v["mmsi"], v["name"], v["lat"], v["lon"], v["sog_kn"])
params["since"] = data["next_since"] # next call: only what changed
time.sleep(60)const url = new URL("https://api.aismesh.com/ws.php");
url.search = new URLSearchParams({ username: "KEY", output: "geojson",
latmin: 50, latmax: 52, lonmin: 0, lonmax: 3 });
const res = await fetch(url);
if (res.status === 429) {
console.log("Too soon, retry in", res.headers.get("Retry-After"), "s");
} else if (!res.ok) {
const { error } = await res.json();
throw new Error(error.code + ": " + error.message);
} else {
const geo = await res.json(); // a FeatureCollection, ready for common map libraries
console.log(geo.features.length, "vessels");
}Request
https://api.aismesh.com/ws.php?username=KEY&output=json- One snapshot every minute. The world picture is rebuilt every 60 seconds. Calling more often returns the same picture. The API answers
429with the seconds to wait. - HTTPS only, with gzip when your client asks for it.
- Positions thinned to one per vessel per minute. Static, voyage and safety data are passed in full. Every message, not thinned, is in the hourly files.
- Each reply carries
generated(the time of the picture) andnext_since(the value for your next call).
Parameters
All optional except username. Names and values match the AISHub web service where it has them; new marks what AISMesh adds.
| Parameter | Default | What it does |
|---|---|---|
username | Required | Your station feed key. Same name as on AISHub. Existing scripts only change the address. |
output | json | json, xml, csv, geojson or nmea. new geojson and nmea. |
format | not set | Leave it out for the clean AISMesh layout. 1 gives the AISHub style layout with readable values, 0 the AISHub style layout with values in AIS units. Only for json, xml and csv. |
compress | 0 | 0 none, 1 zip, 2 gzip, as on AISHub. Simpler: send Accept-Encoding: gzip and leave it at 0. |
latmin latmaxlonmin lonmax | whole world | Area in decimal degrees, south and west negative. A box that crosses 180° works: set lonmin greater than lonmax. |
mmsi | all | One MMSI or up to 100, separated by commas. |
imo | all | One IMO number or up to 100, separated by commas. |
interval | all | Only vessels whose last position is at most this many minutes old. |
since new | not set | Only vessels changed after this time. Pass next_since from the last reply (ISO 8601 UTC or Unix seconds). Saves most of the transfer on each call after the first. |
Fields
The clean layout uses plain objects, decimal degrees, ISO 8601 UTC times and null for anything the vessel does not send; units sit in the field name. With format=1 or 0 the same data comes under the AISHub names in the second column.
| Field | AISHub name | Type | Unit | Meaning |
|---|---|---|---|---|
mmsi | MMSI | integer | Maritime Mobile Service Identity, 9 digits. | |
time | TIME | ISO 8601 UTC | When the last position report was received. | |
lat | LATITUDE | number | degrees | WGS 84, north positive. null when the vessel sends none (91 in AIS). |
lon | LONGITUDE | number | degrees | WGS 84, east positive. null when the vessel sends none (181 in AIS). |
sog_kn | SOG | number | knots | Speed over ground, 0 to 102.2. null for not available. |
cog_deg | COG | number | degrees | Course over ground, true, 0 to 359.9. null for not available (360 in AIS). |
heading_deg | HEADING | integer | degrees | True heading, 0 to 359. null for not available (511 in AIS). |
rot_deg_min | ROT | number | °/min | Rate of turn, decoded from the AIS value; right positive, left negative. null when not sent. |
accuracy_high | PAC | boolean | Position accuracy flag: true is better than 10 m. | |
navstat | NAVSTAT | integer | Navigational status, see codes. | |
imo | IMO | integer | IMO number. null when not sent. | |
name | NAME | text | Vessel name, up to 20 characters, trailing @ removed. | |
callsign | CALLSIGN | text | Radio call sign, up to 7 characters. | |
type | TYPE | integer | Type of ship and cargo, see codes. | |
class | none | text | A or B. new | |
dim_m.a b c d | A B C D | integer | metres | From the position reference to bow (A), stern (B), port (C) and starboard (D). |
length_m, beam_m | none | integer | metres | A + B and C + D, worked out for you. new |
draught_m | DRAUGHT | number | metres | Present static draught, 0.1 m steps. |
dest | DEST | text | Destination as typed on board, up to 20 characters. | |
eta | ETA | text | UTC | Month, day, hour and minute as sent: MM-DDTHH:MMZ. AIS carries no year. |
With format=0 values stay in AIS units, as AISHub gives them: positions in 1/10 000 minute, speed, course and draught in tenths, rate of turn and ETA as transmitted.
Codes
From Recommendation ITU-R M.1371-5, the technical standard for AIS.
Navigational status navstat
| Code | Meaning |
|---|---|
0 | Under way using engine |
1 | At anchor |
2 | Not under command |
3 | Restricted manoeuvrability |
4 | Constrained by her draught |
5 | Moored |
6 | Aground |
7 | Engaged in fishing |
8 | Under way sailing |
9 | Reserved for a future status for high speed craft carrying dangerous goods, harmful substances or marine pollutants (IMO hazard or pollutant category C) |
10 | Reserved for a future status for wing in ground craft carrying dangerous goods, harmful substances or marine pollutants (IMO hazard or pollutant category A) |
11 | Power driven vessel towing astern (regional use) |
12 | Power driven vessel pushing ahead or towing alongside (regional use) |
13 | Reserved for future use |
14 | AIS-SART, MOB-AIS or EPIRB-AIS, active |
15 | Not defined (default; also AIS-SART, MOB-AIS and EPIRB-AIS under test) |
Type of ship and cargo type
| Code | Meaning |
|---|---|
0 | Not available or no ship |
1 to 19 | Reserved for future use |
20 to 29 | Wing in ground craft (second digit below) |
30 | Fishing |
31 | Towing |
32 | Towing, length of tow over 200 m or breadth over 25 m |
33 | Dredging or underwater operations |
34 | Diving operations |
35 | Military operations |
36 | Sailing |
37 | Pleasure craft |
38, 39 | Reserved for future use |
40 to 49 | High speed craft (second digit below) |
50 | Pilot vessel |
51 | Search and rescue vessel |
52 | Tug |
53 | Port tender |
54 | Anti-pollution equipment |
55 | Law enforcement |
56, 57 | Spare, for assignment to local vessels |
58 | Medical transport |
59 | Noncombatant ship (RR Resolution No. 18) |
60 to 69 | Passenger ship (second digit below) |
70 to 79 | Cargo ship (second digit below) |
80 to 89 | Tanker (second digit below) |
90 to 99 | Other type of ship (second digit below) |
Second digit for 20s, 40s, 60s, 70s, 80s and 90s
For example 71 is a cargo ship carrying category X goods, 80 a tanker with the category not given (all ships of this type) and 89 a tanker with no additional information.
| Digit | Meaning |
|---|---|
0 | All ships of this type |
1 | Carrying DG, HS or MP, IMO hazard or pollutant category X |
2 | Category Y |
3 | Category Z |
4 | Category OS |
5 to 8 | Reserved for future use |
9 | No additional information |
Samples
The same three invented vessels in each output. Vessel B lies at anchor. It has no course and no rate of turn.
{
"generated": "2026-11-21T21:40:12Z",
"next_since": "2026-11-21T21:40:12Z",
"vessels": [
{
"mmsi": 219000101,
"time": "2026-11-21T21:39:58Z",
"lat": 57.84105,
"lon": 10.88214,
"sog_kn": 12.6,
"cog_deg": 62.4,
"heading_deg": 63,
"rot_deg_min": 0.0,
"accuracy_high": true,
"navstat": 0,
"imo": null,
"name": "DEMO VESSEL A",
"callsign": "DEMOA",
"type": 70,
"class": "A",
"dim_m": {
"a": 120,
"b": 24,
"c": 12,
"d": 11
},
"length_m": 144,
"beam_m": 23,
"draught_m": 7.4,
"dest": "SE GOT",
"eta": "11-22T06:30Z"
},
{
"mmsi": 563000202,
"time": "2026-11-21T21:39:47Z",
"lat": 1.18322,
"lon": 103.92031,
"sog_kn": 0.1,
"cog_deg": null,
"heading_deg": 247,
"rot_deg_min": null,
"accuracy_high": false,
"navstat": 1,
"imo": null,
"name": "DEMO VESSEL B",
"callsign": "DEMOB",
"type": 80,
"class": "A",
"dim_m": {
"a": 150,
"b": 33,
"c": 16,
"d": 16
},
"length_m": 183,
"beam_m": 32,
"draught_m": 11.2,
"dest": "SG SIN",
"eta": "11-22T08:00Z"
},
{
"mmsi": 367000303,
"time": "2026-11-21T21:40:03Z",
"lat": 28.9124,
"lon": -89.42118,
"sog_kn": 7.1,
"cog_deg": 341.0,
"heading_deg": 340,
"rot_deg_min": -3.6,
"accuracy_high": true,
"navstat": 0,
"imo": null,
"name": "DEMO VESSEL C",
"callsign": "DEMOC",
"type": 31,
"class": "A",
"dim_m": {
"a": 22,
"b": 8,
"c": 5,
"d": 5
},
"length_m": 30,
"beam_m": 10,
"draught_m": 3.6,
"dest": "US MSY",
"eta": "11-22T02:15Z"
}
]
}{
"type": "FeatureCollection",
"generated": "2026-11-21T21:40:12Z",
"features": [
{
"type": "Feature",
"id": 219000101,
"geometry": {
"type": "Point",
"coordinates": [
10.88214,
57.84105
]
},
"properties": {
"mmsi": 219000101,
"time": "2026-11-21T21:39:58Z",
"sog_kn": 12.6,
"cog_deg": 62.4,
"heading_deg": 63,
"rot_deg_min": 0.0,
"accuracy_high": true,
"navstat": 0,
"imo": null,
"name": "DEMO VESSEL A",
"callsign": "DEMOA",
"type": 70,
"class": "A",
"length_m": 144,
"beam_m": 23,
"draught_m": 7.4,
"dest": "SE GOT",
"eta": "11-22T06:30Z"
}
},
{
"type": "Feature",
"id": 563000202,
"geometry": {
"type": "Point",
"coordinates": [
103.92031,
1.18322
]
},
"properties": {
"mmsi": 563000202,
"time": "2026-11-21T21:39:47Z",
"sog_kn": 0.1,
"cog_deg": null,
"heading_deg": 247,
"rot_deg_min": null,
"accuracy_high": false,
"navstat": 1,
"imo": null,
"name": "DEMO VESSEL B",
"callsign": "DEMOB",
"type": 80,
"class": "A",
"length_m": 183,
"beam_m": 32,
"draught_m": 11.2,
"dest": "SG SIN",
"eta": "11-22T08:00Z"
}
}
]
}!AIVDM,1,1,,A,13@ne9@01vPil88Q6<uRL1wl0000,0*2E !AIVDM,2,1,1,B,53@ne9H00000@Dlt400@Dlv1HE=<Dj0400000016?0H<;6s6NBTiH1km0000,0*40 !AIVDM,2,2,1,B,00000000000,2*26 !AIVDM,1,1,,A,18HrkRQP017KeIl0cE;>47gN0000,0*29 !AIVDM,2,1,2,B,58HrkR`00000@Dlt800@Dlv1HE=<Dj080000001@BhQ@@6s80L4ip4jCP000,0*30 !AIVDM,2,2,2,B,00000000000,2*25 !AIVDM,1,1,,A,15Mwrshui7qVbHp@RkL=Db`60000,0*5F !AIVDM,2,1,3,B,55Mwrsp00000@Dlt<00@Dlv1HE=<Dj0<0000000O2h8556s2?95Dp3Dn@000,0*4B !AIVDM,2,2,3,B,00000000000,2*24
<?xml version="1.0" encoding="UTF-8"?> <vessels generated="2026-11-21T21:40:12Z"> <vessel mmsi="219000101" time="2026-11-21T21:39:58Z" lat="57.84105" lon="10.88214" sog_kn="12.6" cog_deg="62.4" heading_deg="63" rot_deg_min="0.0" navstat="0" name="DEMO VESSEL A" callsign="DEMOA" type="70" a="120" b="24" c="12" d="11" draught_m="7.4" dest="SE GOT" eta="11-22T06:30Z"/> <vessel mmsi="563000202" time="2026-11-21T21:39:47Z" lat="1.18322" lon="103.92031" sog_kn="0.1" heading_deg="247" navstat="1" name="DEMO VESSEL B" callsign="DEMOB" type="80" a="150" b="33" c="16" d="16" draught_m="11.2" dest="SG SIN" eta="11-22T08:00Z"/> <vessel mmsi="367000303" time="2026-11-21T21:40:03Z" lat="28.9124" lon="-89.42118" sog_kn="7.1" cog_deg="341.0" heading_deg="340" rot_deg_min="-3.6" navstat="0" name="DEMO VESSEL C" callsign="DEMOC" type="31" a="22" b="8" c="5" d="5" draught_m="3.6" dest="US MSY" eta="11-22T02:15Z"/> </vessels>
mmsi,time,lat,lon,sog_kn,cog_deg,heading_deg,rot_deg_min,navstat,imo,name,callsign,type,a,b,c,d,draught_m,dest,eta 219000101,2026-11-21T21:39:58Z,57.84105,10.88214,12.6,62.4,63,0.0,0,,"DEMO VESSEL A",DEMOA,70,120,24,12,11,7.4,"SE GOT",11-22T06:30Z 563000202,2026-11-21T21:39:47Z,1.18322,103.92031,0.1,,247,,1,,"DEMO VESSEL B",DEMOB,80,150,33,16,16,11.2,"SG SIN",11-22T08:00Z 367000303,2026-11-21T21:40:03Z,28.9124,-89.42118,7.1,341.0,340,-3.6,0,,"DEMO VESSEL C",DEMOC,31,22,8,5,5,3.6,"US MSY",11-22T02:15Z
[
{
"ERROR": false,
"USERNAME": "KEY",
"FORMAT": "HUMAN"
},
[
{
"MMSI": 219000101,
"TIME": "2026-11-21 21:39:58 GMT",
"LONGITUDE": 10.88214,
"LATITUDE": 57.84105,
"COG": 62.4,
"SOG": 12.6,
"HEADING": 63,
"ROT": 0.0,
"NAVSTAT": 0,
"IMO": 0,
"NAME": "DEMO VESSEL A",
"CALLSIGN": "DEMOA",
"TYPE": 70,
"A": 120,
"B": 24,
"C": 12,
"D": 11,
"DRAUGHT": 7.4,
"DEST": "SE GOT",
"ETA": "11/22 06:30"
},
{
"MMSI": 563000202,
"TIME": "2026-11-21 21:39:47 GMT",
"LONGITUDE": 103.92031,
"LATITUDE": 1.18322,
"COG": 360,
"SOG": 0.1,
"HEADING": 247,
"ROT": 128,
"NAVSTAT": 1,
"IMO": 0,
"NAME": "DEMO VESSEL B",
"CALLSIGN": "DEMOB",
"TYPE": 80,
"A": 150,
"B": 33,
"C": 16,
"D": 16,
"DRAUGHT": 11.2,
"DEST": "SG SIN",
"ETA": "11/22 08:00"
},
{
"MMSI": 367000303,
"TIME": "2026-11-21 21:40:03 GMT",
"LONGITUDE": -89.42118,
"LATITUDE": 28.9124,
"COG": 341.0,
"SOG": 7.1,
"HEADING": 340,
"ROT": -3.6,
"NAVSTAT": 0,
"IMO": 0,
"NAME": "DEMO VESSEL C",
"CALLSIGN": "DEMOC",
"TYPE": 31,
"A": 22,
"B": 8,
"C": 5,
"D": 5,
"DRAUGHT": 3.6,
"DEST": "US MSY",
"ETA": "11/22 02:15"
}
]
][
{
"ERROR": false,
"USERNAME": "KEY",
"FORMAT": "AIS"
},
[
{
"MMSI": 219000101,
"TIME": "2026-11-21 21:39:58 GMT",
"LONGITUDE": 6529284,
"LATITUDE": 34704630,
"COG": 624,
"SOG": 126,
"HEADING": 63,
"ROT": 0,
"NAVSTAT": 0,
"IMO": 0,
"NAME": "DEMO VESSEL A",
"CALLSIGN": "DEMOA",
"TYPE": 70,
"A": 120,
"B": 24,
"C": 12,
"D": 11,
"DRAUGHT": 74,
"DEST": "SE GOT",
"ETA": 383198
},
{
"MMSI": 563000202,
"TIME": "2026-11-21 21:39:47 GMT",
"LONGITUDE": 62352186,
"LATITUDE": 709932,
"COG": 3600,
"SOG": 1,
"HEADING": 247,
"ROT": -128,
"NAVSTAT": 1,
"IMO": 0,
"NAME": "DEMO VESSEL B",
"CALLSIGN": "DEMOB",
"TYPE": 80,
"A": 150,
"B": 33,
"C": 16,
"D": 16,
"DRAUGHT": 112,
"DEST": "SG SIN",
"ETA": 383232
},
{
"MMSI": 367000303,
"TIME": "2026-11-21 21:40:03 GMT",
"LONGITUDE": -53652708,
"LATITUDE": 17347440,
"COG": 3410,
"SOG": 71,
"HEADING": 340,
"ROT": -9,
"NAVSTAT": 0,
"IMO": 0,
"NAME": "DEMO VESSEL C",
"CALLSIGN": "DEMOC",
"TYPE": 31,
"A": 22,
"B": 8,
"C": 5,
"D": 5,
"DRAUGHT": 36,
"DEST": "US MSY",
"ETA": 383055
}
]
]output=nmea gives the sentences as received, one per line: positions thinned to one per vessel per minute, static, voyage and safety messages in full, multi part messages kept together.
Hourly files
The complete feed: every message from every AISMesh station, not thinned, each with the time it was received. One gzip file for each UTC hour, ready 15 minutes after the hour ends. Positions, static, voyage and safety messages, base stations and aids to navigation: all of it, one copy of each transmission when several stations hear it.
- For steady stations. Your key opens the files once your station has fed steadily for 30 days: online at least 90 % of the time with a median delay of 10 seconds or less over those 30 days, on top of the 7 day rules. My station shows how close it is.
- Kept 7 days. The list shows every hour still there. Each file never changes once made: its name carries the hour and the list gives its size and SHA-256.
- 30 files a day per key. Every hour of the day once with room to spare. The rest of a broken download (a
Rangerequest) does not count again.
https://api.aismesh.com/v1/hourly?username=KEY{
"files": [
{
"hour": "2026-11-23T14:00:00Z",
"name": "aismesh-2026-11-23T14Z.nmea.gz",
"url": "https://api.aismesh.com/v1/hourly/aismesh-2026-11-23T14Z.nmea.gz",
"size": 48213377,
"sha256": "9f2c4e81a07d55b3c1e6f0a2b8d94c37e15a6b0d2f8c41e93a7b6d05c2e81f4a"
}
],
"downloads_today": 3,
"downloads_per_day": 30,
"downloads_left_today": 27,
"next_file_at": "2026-11-23T15:15:00Z",
"delay_minutes": 15,
"kept_hours": 168
}https://api.aismesh.com/v1/hourly/aismesh-2026-11-23T14Z.nmea.gz?username=KEYThe download may answer with a redirect to a short lived storage address. Follow it: curl -L does, and so do most libraries. The key also works as Authorization: Bearer KEY.
curl -fL -o aismesh-2026-11-23T14Z.nmea.gz \ "https://api.aismesh.com/v1/hourly/aismesh-2026-11-23T14Z.nmea.gz?username=KEY" sha256sum aismesh-2026-11-23T14Z.nmea.gz # compare with the list
Inside, one sentence per line. Each line starts with an NMEA 4 TAG block that carries the receive time in Unix seconds (c:); multi part messages stay together. Most decoders read TAG blocks. If yours does not, cut them off:
\c:1795442400*55\!AIVDM,1,1,,A,13@ne9@01vPil88Q6<uRL1wl0000,0*2E \c:1795442401*54\!AIVDM,2,1,1,B,53@ne9H00000@Dlt400@Dlv1HE=<Dj0400000016?0H<;6s6NBTiH1km0000,0*40 \c:1795442401*54\!AIVDM,2,2,1,B,00000000000,2*26
zcat aismesh-2026-11-23T14Z.nmea.gz | sed 's/^\\[^\\]*\\//' > hour.nmea
Stations API
Your own station, as your station page shows it: health, records, rank, boards, ribbons and badges. Use it for a display at home, a club screen or your own alerts.
https://api.aismesh.com/station?username=KEY{
"station": {
"id": "DEMO-0612",
"name": "Demo Station",
"sea": "North Sea",
"online": true,
"last_message": "2026-11-21T21:40:11Z",
"now": {
"vessels": 36,
"messages_per_min": 208
},
"today": {
"farthest_nm": 104.2
},
"online_30d_pct": 99.2,
"delay_median_s": 1.8,
"feed_key": {
"state": "active",
"qualified_since": "2026-11-14"
},
"rank": {
"name": "Chief Officer",
"watches": 612,
"next": "Master",
"watches_to_next": 483
},
"boards": {
"sea_week": 1,
"world_week": 23
},
"streak_days": 41,
"ribbons": [
"plank-owner",
"first-light",
"shipmate-b",
"sea-time-1m",
"sea-time-6m"
],
"badges": [
"long-range",
"first-sighting",
"rare-catch",
"night-watch"
]
}
}The Stations API shows your station only. Station positions stay private and no list of stations is published.
Errors
Real HTTP status codes and a short JSON body that says what to do. Nothing hides in a header.
| Status | Code | What to do |
|---|---|---|
| 400 | bad_parameter | A parameter is out of range or not understood. The message names it. |
| 401 | unknown_key | No station has this key, or it was replaced. Copy it again from My station. |
| 403 | key_paused | Your station has been silent for more than 48 hours. The key works again by itself a few minutes after your feed returns. |
| 403 | not_qualified | The station has not met the 7 day rules yet. My station shows how close it is. |
| 403 | not_steady | Hourly files only. The station has not fed steadily for 30 days yet. My station shows how close it is. |
| 404 | not_found | Hourly files only. No file for that hour: it is not ready yet or it is older than 7 days. The list shows what is there. |
| 429 | too_soon | Less than a minute since your last call. Retry-After gives the seconds to wait. |
| 429 | daily_volume | The key has taken its 600 MB for today. Retry-After gives the seconds to midnight UTC. |
| 429 | daily_limit | Hourly files only. The key has taken its 30 files for today. Retry-After gives the seconds to midnight UTC. |
| 503 | maintenance | Short planned work. Retry-After says when to come back. |
{
"error": {
"status": 429,
"code": "too_soon",
"message": "One call per 60 seconds per key. Try again in 18 seconds.",
"retry_after_s": 18
}
}With format=1 or 0 the first object also carries "ERROR": true and "ERROR_MESSAGE": AISHub style scripts see the error where they look for it.
Limits and fair use
Given after 7 days on watch: 10 vessels or more, 90 % online, messages within 10 seconds, your own antenna.
Per key. A new picture is only made every minute.
Per key, counted as sent: gzip counts compressed. An area or since keeps each call small.
After 30 steady days. 30 files a day per key, each kept 7 days.
For you and your own projects. No passing the data or the key on.
If your station stops sending for 48 hours the key pauses and it comes back by itself when your feed does.
The full rules are in the contributor terms.
Coming from AISHub
- Change the address to
https://api.aismesh.com/ws.phpand theusernameto your AISMesh key. - Keep
format=1orformat=0and your script reads the same field names as before. The header has noRECORDSfield. Count the rows if your script needs a number. - When you have time: drop
formatfor the clean layout, addsinceand call once a minute.
AISMesh asks for no exclusivity: keep feeding AISHub and the other networks you feed today. The AISMesh Relay sends to all of them at once.