AIS signals include a Navigational Status field which is reported by the vessel. This is manually set by the crew.
The possible values and their significance are the following:
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 = reserved for future amendment of navigational status for ships carrying DG, HS, or MP, or IMO hazard or pollutant category C, high-speed craft (HSC)
10 = reserved for future amendment of navigational status for ships carrying dangerous goods (DG), harmful substances (HS) or marine pollutants (MP), or IMO hazard or pollutant category A, wing in ground (WIG)
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 (active), MOB-AIS, EPIRB-AIS
15 = undefined = default (also used by AIS-SART, MOB-AIS and EPIRB-AIS under test)
Note that, if you are using MarineTraffic API Services, it is possible to get STATUS responses such as the following ones (not AIS-derived):
95 = Base Station
β96 = Class B
β97 = SAR Aircraft
β98 = Aid to Navigation
β99 = Class B