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": "https://api.trafiklab.se/sl/reseplanerare/curre...",
"PrevQuery": "https://api.trafiklab.se/sl/reseplanerare/prev/...",
"NextQuery": "https://api.trafiklab.se/sl/reseplanerare/next/..."
},

How to do it in the new API?

Kommentarer

  • 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

    SL

Kommentera eller skriv ett nytt inlägg

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