Solution to access machine readable AIS Data. This solution uses the free web solutions to crawl the data and returns them in json.
As this repo is a successor to the ais-api, lecacy parts are added (see legacy) Those will be removed in future versions.
Requirements: npm & nodejs.
-
clone this repo
-
run
npm install
-
run
npm run dev
All locations are returned in this format: { timestamp: ISO 8601 latitude: longitude: course: in deg speed: in kn source: source_type: e.g. ais raw_data: (contains all the raw data) }
As this repo is a successor to the ais-api, some legacy paths are added. Those will be removed in future versions
Takes position from MT and from VT and returns the newest example: http://localhost:5000/legacy/getLastPosition/211879870
Returns position from VF example: http://localhost:5000/legacy/getLastPositionFromVF/211281610
Returns position from MT example: http://localhost:5000/legacy/getLastPositionFromMT/211281610
Returns all vessels in area, defined by a list of area keywords example: http://localhost:5000/legacy/getVesselsInArea/WMED,EMED
Returns all vessels near me, defined by a location in latitude, longitude, and distance example: http://localhost:5000/legacy/getVesselsNearMe/51.74190/3.89773/2
[{
name: vessel.SHIPNAME,
id: vessel.SHIP_ID,
lat: Number(vessel.LAT),
lon: Number(vessel.LON),
timestamp: vessel.LAST_POS,
mmsi: vessel.MMSI,
imo: vessel.IMO,
callsign: vessel.CALLSIGN,
speed: Number(vessel.SPEED),
area: vessel.AREA_CODE,
type: vessel.TYPE_SUMMARY,
country: vessel.COUNTRY,
destination: vessel.DESTINATION,
port_current_id: vessel.PORT_ID,
port_current: vessel.CURRENT_PORT,
port_next_id: vessel.NEXT_PORT_ID,
port_next: vessel.NEXT_PORT_NAME,
},…]
Returns all vessels in a port, named after the MT nomenclature example: http://localhost:5000/legacy/getVesselsInPort/piraeus
Output format identical to getVesselsInArea
find latest position for vehicle for specified sourcetype and source example: http://localhost:5000/ais/mt/211281610/location/latest