Transport
Transport copied to clipboard
Some trains missing from API
I just noticed that some trains seem to have disappeared from the API recently, even though they're still reported by the SBB website.
One that's reproducable is the S 4 from Bern to Thun at 23:46 (bottom one in screenshot):

The output of http://transport.opendata.ch/v1/connections?from=bern&to=thun&time=23:40 contains the S 1 train and a later IC, but not the S 4.
This problem likely roots in the search.ch API, which doesn't report any S 4 for the corresponding request: https://fahrplan.search.ch/api/route.json?from=Bern&to=Thun&time=23:40
Since when?
As it happens, I think the missing connection was still reported correctly on July 10, so a regression must have been introduced with a change in that time frame since then.
A wild guess
The S 1 and the S 4 look quite similar data-wise, e.g. both depart at the same time. Maybe some duplicate removal mechanism kicked in too eagerly.
S4 is still there (see departure table) just not for this query because you are 30% slower and seems to have no benefit at all compared to S1.
@helbling Ok, so it's filtered out. It might have benefits in some occasions, e.g. if occupation is higher in the S1, or if the traveler prefers one route over the other (e.g. for sightseeing).