It is possible to call the AIS Decoder web service online through a HTTP/JSON-based API.
Do an HTTP POST like this (to
http://ais.tbsalling.dk/decode
) to perform decoding:
POST /decode HTTP/1.1 ... Content-Type: application/json Accept: application/json ... {"nmea":"!AIVDM,1,1,,A,18UG;P0012G?Uq4EdHa=c;7@051@,0*53"}which would respond with this:
HTTP/1.1 200 OK ... Content-Type: application/json ... [{"navigationStatus":"UnderwayUsingEngine","rateOfTurn":0,"speedOverGround":6.6,"positionAccurate":false,"latitude":37.912167,"longitude":-122.42299,"courseOverGround":350.0,"trueHeading":355,"second":40,"maneuverIndicator":"NotAvailable","raimFlag":false,"metadata":{"source":"SRC1","category":"AIS","processedAt":1349874686600,"processedIn":146,"decoderVersion":"1.0"},"messageType":"PositionReportClassAScheduled","repeatIndicator":0,"sourceMmsi":{"mmsi":576048000}}]Multiple NMEA strings are supplied like this in your post (separated by newlines):
{"nmea":"!AIVDM,1,1,,A,18UG;P0012G?Uq4EdHa=c;7@051@,0*53\n!AIVDM,2,1,0,B,539S:k40000000c3G04PPh63<00000000080000o1PVG2uGD:00000000000,0*34\n!AIVDM,2,2,0,B,00000000000,2*27"}