API | The responses contain fewer fields than expected

In most of the cases, the reason behind receiving fewer fields than those expected in your API responses has to do with the endpoint URL used. 

If the msgtype parameter is not defined and included in the URL, the response is set to simple by default.

For example, a PS02 - Vessel Positions API call using the following URL

http://services.marinetraffic.com/api/exportvessels/YOUR_API_KEY/timespan:10/protocol:json

would only return the fields contained in the simple response (MMSI, IMO, SHIP_ID, LAT, LON, SPEED, HEADING, COURSE, STATUS, TIMESTAMP, DSRC, UTC_SECONDS). The fields of the extended response would have been omitted (SHIPNAME, SHIPTYPE, CALLSIGN, FLAG, LENGTH, WIDTH, GRT, DWT, YEAR_BUILT, TYPE_NAME and AIS_TYPE_SUMMARY).

So, if you get fewer fields, make sure that the endpoint URL you use for API calling includes the msgtype parameter.

 

The actions mentioned are applicable to the following API Services:

PS02 - Vessel Positions

PS03 - Vessel Positions of a MarineTraffic Fleet

PS04 - Vessel Positions within a Port

PS05 - Vessel Positions in a Predefined Area

PS06 - Vessel Positions in a Custom Area

PS07 - Single Vessel Positions

EV01 - Port Calls

VI01 - Voyage Forecasts

VI02 - Expected Arrivals