Every station that shares its data gets an API key. With it you can download the latest positions and voyage data of all vessels in the AISHub network, in JSON, XML or CSV, once per minute: a more frequent request returns an error ("Too frequent requests!") instead of data.
Request URL
https://data.aishub.net/ws.php?username=API_KEY
All parameters except username are optional. Add them to the URL as &name=value.
Parameters
| Parameter | Values | Default | Description |
|---|---|---|---|
username |
required | your AISHub API key | |
format |
0, 1 |
0 |
0 raw AIS values, 1 human-readable values |
output |
xml, json, csv |
xml |
response format |
compress |
0, 1, 2, 3 |
0 |
0 none, 1 ZIP, 2 GZIP, 3 BZIP2 |
latmin / latmax |
-90 … 90 | -90 / 90 |
south / north edge of the area |
lonmin / lonmax |
-180 … 180 | -180 / 180 |
west / east edge of the area |
mmsi |
one or more, comma-separated | only these vessels | |
imo |
one or more, comma-separated | only these vessels | |
interval |
minutes | maximum age of the position, in minutes |
Examples
All vessels, human-readable JSON:
https://data.aishub.net/ws.php?username=API_KEY&format=1&output=json
All vessels in an area (Western Mediterranean), GZIP compressed:
https://data.aishub.net/ws.php?username=API_KEY&format=1&output=json&compress=2&latmin=35&latmax=44&lonmin=-6&lonmax=10
Two vessels by MMSI, positions from the last 60 minutes only:
https://data.aishub.net/ws.php?username=API_KEY&format=1&output=json&mmsi=244780543,244710271&interval=60
Vessels by IMO number, CSV:
https://data.aishub.net/ws.php?username=API_KEY&format=1&output=csv&imo=9824253,9481207
Full sample responses: JSON, XML, CSV.
Response fields
JSON: an array of two items, a header (ERROR, FORMAT, RECORDS and, if you set an area, LATITUDE_MIN/MAX and LONGITUDE_MIN/MAX) and the list of vessels.
XML: the same header as attributes of <VESSELS>, one <vessel> per vessel.
CSV: a header line, then one line per vessel.
On error the JSON array holds only the header, with ERROR set to true and the reason in ERROR_MESSAGE:
[{"ERROR":true,"FORMAT":"HUMAN","ERROR_MESSAGE":"Invalid username or password!"}]
| Field | Meaning | format=0 (AIS) |
format=1 (human-readable) |
|---|---|---|---|
MMSI |
vessel MMSI number | 9-digit number | |
TIME |
time of the last position report | UNIX timestamp | UTC, 2026-10-27 09:50:33 GMT |
LONGITUDE |
longitude | degrees × 600000 | degrees |
LATITUDE |
latitude | degrees × 600000 | degrees |
COG |
course over ground | degrees × 10; 3600 = not available |
degrees; 360 = not available |
SOG |
speed over ground | knots × 10; 1023 = not available |
knots; 102.3 = not available |
HEADING |
true heading | degrees; 511 = not available |
|
ROT |
rate of turn, as sent by the transponder | -127 … 127; 0 = not turning; 128 = not available |
|
PAC |
position accuracy | 1 = high (< 10 m), 0 = low |
|
NAVSTAT |
navigational status, see codes | number | |
IMO |
IMO number; 0 = none |
number | |
NAME |
vessel name, max. 20 characters | text | |
CALLSIGN |
call sign | text | |
TYPE |
ship and cargo type, see codes | number | |
A |
distance from the GPS antenna to the bow | meters | |
B |
distance from the GPS antenna to the stern | meters | |
C |
distance from the GPS antenna to the port side | meters | |
D |
distance from the GPS antenna to the starboard side | meters | |
DRAUGHT |
draught | meters × 10 | meters |
DEST |
destination, as entered by the crew | text | |
ETA |
estimated time of arrival (UTC), as entered by the crew | month × 65536 + day × 2048 + hour × 64 + minute; 1596 or 0 = not available (0 is empty in XML and CSV) |
MM-DD HH:MM; 00-00 24:60 or 00-00 00:00 = not available |
CSV differs: the time column is called TSTAMP, LATITUDE comes before
LONGITUDE, and there are no ROT and PAC columns.
Python example
Polls the API once a minute and prints the vessels in an area. Requires the requests library (pip install requests).
import time import requests params = { "username": "API_KEY", "format": 1, "output": "json", "latmin": 35, "latmax": 44, "lonmin": -6, "lonmax": 10, } while True: r = requests.get("https://data.aishub.net/ws.php", params=params, timeout=30) if r.text.strip(): header, *data = r.json() if header["ERROR"]: print(header["ERROR_MESSAGE"]) else: for v in data[0]: print(v["MMSI"], v["NAME"], v["LATITUDE"], v["LONGITUDE"], v["SOG"]) time.sleep(60)
The Stations API returns the list of AISHub stations: location, last update and number of vessels, in JSON, XML or CSV. You can call it once per minute: a more frequent request returns an error ("Too frequent requests!") instead of data.
Request URL
https://data.aishub.net/stations.php?username=API_KEY
All parameters except username are optional. Add them to the URL as &name=value.
Parameters
| Parameter | Values | Default | Description |
|---|---|---|---|
username |
required | your AISHub API key | |
output |
xml, json, csv |
xml |
response format |
compress |
0, 1, 2, 3 |
0 |
0 none, 1 ZIP, 2 GZIP, 3 BZIP2 |
id |
station ID | only this station; the ID is the number in the station page URL (aishub.net/stations/2333) |
Examples
All stations, XML:
https://data.aishub.net/stations.php?username=API_KEY&output=xml
One station (ID 2333), JSON:
https://data.aishub.net/stations.php?username=API_KEY&output=json&id=2333
Full sample responses: JSON, XML, CSV.
Response fields
Same structure as the AIS API: a header and the list of stations.
| Field | Meaning |
|---|---|
ID |
station ID |
LASTUPDATE |
time of the last data from the station, UTC (2026-10-27 09:50:01 GMT) |
COUNTRY |
country name |
LOCATION |
place name, as given by the station owner |
SHIPS |
number of vessels the station currently receives |
DISTINCT |
number of vessels received only by this station |
CONTRIBUTOR |
name of the contributor; empty if not public |
Errors
On error ERROR is true and the reason is in ERROR_MESSAGE. JSON:
[{"ERROR":true,"ERROR_MESSAGE":"Invalid station ID!"}]
XML:
<STATIONS ERROR="true"> <ERROR_MESSAGE>Invalid station ID!</ERROR_MESSAGE> </STATIONS>
CSV: only the message, as plain text.
Messages: Invalid username or password!, Blocked account!, Expired account!,
Too frequent requests!, Invalid station ID!.
Values of NAVSTAT and TYPE as defined in ITU-R M.1371-5.
NAVSTAT: navigational status
| Code | Status |
|---|---|
0 | under way using engine |
1 | at anchor |
2 | not under command |
3 | restricted maneuverability |
4 | constrained by her draught |
5 | moored |
6 | aground |
7 | engaged in fishing |
8 | under way sailing |
9, 10 | reserved |
11 | power-driven vessel towing astern (regional use) |
12 | power-driven vessel pushing ahead or towing alongside (regional use) |
13 | reserved |
14 | AIS-SART, MOB-AIS or EPIRB-AIS active |
15 | not defined (default) |
TYPE: ship and cargo type
| Code | Type |
|---|---|
0 | not available |
1–19 | reserved |
20–29 | wing in ground (WIG) craft |
30 | fishing |
31 | towing |
32 | towing, tow longer than 200 m or wider than 25 m |
33 | dredging or underwater operations |
34 | diving operations |
35 | military operations |
36 | sailing |
37 | pleasure craft |
38, 39 | reserved |
40–49 | high-speed craft (HSC) |
50 | pilot vessel |
51 | search and rescue vessel |
52 | tug |
53 | port tender |
54 | anti-pollution vessel |
55 | law enforcement |
56, 57 | spare, for local use |
58 | medical transport |
59 | ship of a State not party to an armed conflict |
60–69 | passenger |
70–79 | cargo |
80–89 | tanker |
90–99 | other |
For WIG, HSC, passenger, cargo, tanker and other (20–29, 40–49, 60–99) the second digit tells the cargo:
| Second digit | Cargo |
|---|---|
0 | all ships of this type |
1 | dangerous goods, harmful substances or marine pollutants, category X (formerly A) |
2 | same, category Y (formerly B) |
3 | same, category Z (formerly C) |
4 | same, category OS (formerly D) |
5–8 | reserved |
9 | no additional information |
Example: 71 is a cargo ship carrying category X goods, 80 is a tanker.
JSON
AIS API
[ {"ERROR":false,"FORMAT":"HUMAN","LATITUDE_MIN":51.85,"LATITUDE_MAX":51.95,"LONGITUDE_MIN":4.2,"LONGITUDE_MAX":4.5,"RECORDS":5}, [ {"MMSI":244700312,"TIME":"2026-10-27 09:50:30 GMT","LONGITUDE":4.20272,"LATITUDE":51.90663,"COG":312.6,"SOG":10.4,"HEADING":511,"ROT":128,"PAC":1,"NAVSTAT":0,"IMO":0,"NAME":"MICHAELANGELO","CALLSIGN":"PD2483","TYPE":79,"A":3,"B":151,"C":18,"D":6,"DRAUGHT":2,"DEST":"DINTELHAVEN","ETA":"10-27 09:00"}, {"MMSI":311000516,"TIME":"2026-10-27 09:47:10 GMT","LONGITUDE":4.20169,"LATITUDE":51.92124,"COG":189,"SOG":0,"HEADING":359,"ROT":0,"PAC":1,"NAVSTAT":5,"IMO":9741815,"NAME":"PRIMERO","CALLSIGN":"C6CM9","TYPE":80,"A":197,"B":31,"C":16,"D":26,"DRAUGHT":14.7,"DEST":" NLRTM","ETA":"10-26 20:30"}, {"MMSI":636019020,"TIME":"2026-10-27 09:48:29 GMT","LONGITUDE":4.20694,"LATITUDE":51.92726,"COG":18.7,"SOG":0,"HEADING":308,"ROT":0,"PAC":0,"NAVSTAT":5,"IMO":9560390,"NAME":"CAPE CONDOR","CALLSIGN":"D5SO6","TYPE":70,"A":251,"B":38,"C":27,"D":18,"DRAUGHT":17.5,"DEST":"ROTTERDAM","ETA":"10-10 10:00"}, {"MMSI":538005187,"TIME":"2026-10-27 09:49:41 GMT","LONGITUDE":4.22068,"LATITUDE":51.91454,"COG":27.8,"SOG":0.1,"HEADING":325,"ROT":0,"PAC":1,"NAVSTAT":1,"IMO":9697624,"NAME":"SEAWAYS DWARKA","CALLSIGN":"V7BQ6","TYPE":89,"A":150,"B":33,"C":18,"D":14,"DRAUGHT":10.3,"DEST":"BEGNE","ETA":"10-18 20:00"}, {"MMSI":244002094,"TIME":"2026-10-27 09:50:28 GMT","LONGITUDE":4.21773,"LATITUDE":51.89503,"COG":360,"SOG":2.5,"HEADING":511,"ROT":128,"PAC":0,"NAVSTAT":15,"IMO":0,"NAME":"MAARTJE","CALLSIGN":"PH5667","TYPE":37,"A":7,"B":7,"C":2,"D":2,"DRAUGHT":0,"DEST":"","ETA":"00-00 00:00"} ] ]
STATIONS API
[ {"ERROR":false,"RECORDS":1}, [ {"ID":2145,"LASTUPDATE":"2026-10-27 09:50:01 GMT","COUNTRY":"Belgium","LOCATION":"Antwerp","SHIPS":525,"DISTINCT":51,"CONTRIBUTOR":"Tresco Engineering"} ] ]
XML
AIS API
<?xml version="1.0" encoding="iso-8859-1"?> <VESSELS ERROR="false" LATITUDE_MIN="51.85" LATITUDE_MAX="51.95" LONGITUDE_MIN="4.2" LONGITUDE_MAX="4.5" FORMAT="AIS" RECORDS="5"> <vessel MMSI="244700312" TIME="1793094630" LONGITUDE="2521634" LATITUDE="31143977" COG="3126" SOG="104" HEADING="511" PAC="1" ROT="128" NAVSTAT="0" IMO="0" NAME="MICHAELANGELO" CALLSIGN="PD2483" TYPE="79" A="3" B="151" C="18" D="6" DRAUGHT="20" DEST="DINTELHAVEN" ETA="711232"/> <vessel MMSI="311000516" TIME="1793094430" LONGITUDE="2521013" LATITUDE="31152746" COG="1890" SOG="0" HEADING="359" PAC="1" ROT="0" NAVSTAT="5" IMO="9741815" NAME="PRIMERO" CALLSIGN="C6CM9" TYPE="80" A="197" B="31" C="16" D="26" DRAUGHT="147" DEST=" NLRTM" ETA="709918"/> <vessel MMSI="636019020" TIME="1793094509" LONGITUDE="2524162" LATITUDE="31156355" COG="187" SOG="0" HEADING="308" PAC="0" ROT="0" NAVSTAT="5" IMO="9560390" NAME="CAPE CONDOR" CALLSIGN="D5SO6" TYPE="70" A="251" B="38" C="27" D="18" DRAUGHT="175" DEST="ROTTERDAM" ETA="676480"/> <vessel MMSI="538005187" TIME="1793094581" LONGITUDE="2532406" LATITUDE="31148726" COG="278" SOG="1" HEADING="325" PAC="1" ROT="0" NAVSTAT="1" IMO="9697624" NAME="SEAWAYS DWARKA" CALLSIGN="V7BQ6" TYPE="89" A="150" B="33" C="18" D="14" DRAUGHT="103" DEST="BEGNE" ETA="693504"/> <vessel MMSI="244002094" TIME="1793094628" LONGITUDE="2530636" LATITUDE="31137019" COG="3600" SOG="25" HEADING="511" PAC="0" ROT="128" NAVSTAT="15" IMO="0" NAME="MAARTJE" CALLSIGN="PH5667" TYPE="37" A="7" B="7" C="2" D="2" DRAUGHT="0" DEST="" ETA=""/> </VESSELS>
STATIONS API
<?xml version="1.0" encoding="iso-8859-1"?> <STATIONS ERROR="false" RECORDS="1"> <station ID="2145" LASTUPDATE="2026-10-27 09:50:01 GMT" COUNTRY="Belgium" LOCATION="Antwerp" SHIPS="525" DISTINCT="51" CONTRIBUTOR="Tresco Engineering"/> </STATIONS>
CSV
AIS API
"MMSI","TSTAMP","LATITUDE","LONGITUDE","COG","SOG","HEADING","NAVSTAT","IMO","NAME","CALLSIGN","TYPE","A","B","C","D","DRAUGHT","DEST","ETA" 244700312,1793094630,31143977,2521634,3126,104,511,0,0,"MICHAELANGELO","PD2483",79,3,151,18,6,20,"DINTELHAVEN",711232 311000516,1793094430,31152746,2521013,1890,0,359,5,9741815,"PRIMERO","C6CM9",80,197,31,16,26,147," NLRTM",709918 636019020,1793094509,31156355,2524162,187,0,308,5,9560390,"CAPE CONDOR","D5SO6",70,251,38,27,18,175,"ROTTERDAM",676480 538005187,1793094581,31148726,2532406,278,1,325,1,9697624,"SEAWAYS DWARKA","V7BQ6",89,150,33,18,14,103,"BEGNE",693504 244002094,1793094628,31137019,2530636,3600,25,511,15,0,"MAARTJE","PH5667",37,7,7,2,2,0,"",
STATIONS API
"ID","LASTUPDATE","COUNTRY","LOCATION","SHIPS","DISTINCT","CONTRIBUTOR" 2145,"2026-10-27 09:50:01 GMT","Belgium","Antwerp",525,51,"Tresco Engineering"