Detta inlägg är gammalt och kan innehålla inaktuell information.

SL Reseplanerare 2

In the previous version of API was able to get previous and next time the route:

"HafasResponse": {
"Queries": {
"CurrentQuery": "",
"PrevQuery": "",
"NextQuery": ""

How to do it in the new API?


  • Hello,

    You can make the same travelsearch but change the date and time. In the responses first trip you will get an departure time. If you want trips before that you can simply set queryparam searchForArrival = 1, and set datetime to 1 min before the departure time in the first trip.
    You would then get trips that arrive atleast 1 min before the first suggested trip.

    And if you want trips after the last trip suggestion in the first search. Then you can search for trips that depart 1min after that trip.

    //Daniel A


Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post visas aldrig publikt.