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
A similar feature "withProducts=false" exists for "location.name" request already.
Do you think this could be done?
Michael
I've checked the technical documentation to see if we missed a parameter, but there are no parameters other than duration and maxJourneys to control the size of the returned response.
You could try out the new Trafiklab realtime API departure board. It does not have any means to control duration or the number of responses yet, but the response objects are significantly smaller (1 hour of departures from Slussen, one of the busiest stations, is 38kb). Here we may be able to add a parameter to limit the number of returned responses in the future.
Regards,
Bert
Michael