Why is it that sometimes when i make an API call it returns NULL and is there any way I can make sure each call returns information?

Comments

1 comment

  • Avatar
    Valia Gelasiou

    Dear Angel,

    Thank you for your comment.

    I would suggest you to use the maximum timespan of the service (2880 minutes). This way the API will look for the latest position received in the last two days from the time of the call.

    As I could see, in some cases you have omitted the timespan parameter and the default (2 minutes) was applied. Most probably the vessel has not transmitted any newer position in those two minutes hence the null values.

    Please have a look at our technical documentation for further details:https://www.marinetraffic.com/en/ais-api-services/documentation/api-service:ps07

    Kind regards,

    0
    Comment actions Permalink

Please sign in to leave a comment.