ResRobot departureBoard maxJourneys
Hej! När jag använder ResRobot Stolptidstabeller departureBoard så verkar den ignorera värdet i maxJourneys. Försöker begränsa det till 2 avgångar.
Exempelanrop:
https://api.resrobot.se/v2.1/departureBoard?id=740015641&format=xml&accessId=00000&direction=740016306&maxJourneys=2
Exempelanrop:
https://api.resrobot.se/v2.1/departureBoard?id=740015641&format=xml&accessId=00000&direction=740016306&maxJourneys=2
Följ inlägget
2
följare
Hej R,

Ja tyvärr så gör den det när man söker resor inom närmsta tiden. Det var en förändring som skedde med uppdateringen till 2.1 och som finns dokumenterat i länken nedan (eller se bild). Vi brukar rekommendera att använda duration istället för att korta ner antal avgångar.
https://www.trafiklab.se/api/trafiklab-apis/resrobot-v21/timetables/#call
Mvh
Sofie
Is there a reason why the duration parameter doesn't fit your purpose, as the duration parameter should consistently get you the same time span (e.g. all departures within 30 minutes)?
Regards,
Bert
my usecase has limited memory available and big json responses kill the app 😀
I want to be flexible regarding the queried station. So, for 'small' stations it is nice to have as many departures as possible (duration high) but then for 'large' stations there are too many departures if maxJourney is neglected. If I reduce duration, there might be too little departures for 'small' stations. Having a maxJourneys setting always on would be best from my point of view. Hope this helped understanding.
Michael
Depending on your use case, the Trafiklab Realtime APIs may be an alternative. While this API also returns large results (a hardcoded window of 60 minutes) the JSON data itself is a bit more compact compared to Resrobot.
Regards,
Bert
Thanks for your help
Michael