Skip to main content
All CollectionsResources & MethodologyAPI Services Methodology
API | The responses contain fewer fields than expected (old versions)
API | The responses contain fewer fields than expected (old versions)
V
Written by Vasilis Kontas
Updated over a month ago

If your API responses include fewer fields than expected, the issue is likely related to the msgtype Parameter used in your API call.

• If the msgtype parameter is not defined in the URL, the response defaults to simple mode.
• The simple response includes only a basic set of fields.

Example of a Default Simple Response
A Vessel Positions API call using the following URL:http://services.marinetraffic.com/api/exportvessels/YOUR_API_KEY/timespan:10/protocol:json…would return fields from the simple response: MMSI, IMO, SHIP_ID, LAT, LON, SPEED, HEADING, COURSE, STATUS, TIMESTAMP, DSRC, UTC_SECONDS Fields from the extended response would be omitted.

These omitted fields include: SHIPNAME, SHIPTYPE, CALLSIGN, FLAG, LENGTH, WIDTH, GRT, DWT, YEAR_BUILT, TYPE_NAME, AIS_TYPE_SUMMARY

Solution: Include the msgtype Parameter

• To receive additional fields in the response, explicitly include the msgtype parameter in your endpoint URL.
• For example:http://services.marinetraffic.com/api/exportvessels/YOUR_API_KEY/msgtype:extended/timespan:10/protocol:json

Quick Recap
Fewer fields? Ensure the msgtype parameter is included in your API request.
• Refer to the API documentation for more details about parameter usage and response types.

Still facing issues? Contact support for further assistance!

Did this answer your question?