public-transport/hafas-client

Internal workings of the API

Open

#327 opened on Oct 14, 2024

View on GitHub
 (3 comments) (0 reactions) (0 assignees)JavaScript (60 forks)github user discovery
help wantedprofile:dbquestion

Repository metrics

Stars
 (353 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Hello,

I'm using your API through https://v5.db.transport.rest and I have some questions about its internal workings if you don't mind.

I'm looking for all reachable destinations from Paris Gare du Nord: https://v5.db.transport.rest/stops/reachable-from?latitude=48.880697&longitude=2.354598&address=%27%27&maxDuration=300 I get London St Pancras associated with a duration of 79 min.

Now, if looking for all reachable destinations from London St Pancras: https://v5.db.transport.rest/stops/reachable-from?latitude=51.531922&longitude=-0.126361&address=%27%27&maxDuration=300 I get Paris Nord Eurostar associated with a duration of... 199 min!

Why is that? The 1 hour time difference between Paris and London doesn't explain the 2 hour difference. My questions are the following: when computing the trip durations, are time differences taken into account? Moreover, does the API take into account the difference between the current time and the time departure of the train (so if the train will leave in 4 hours, will these 4 hours be added to the total duration)? And is the current search based on the current time (in other words if I run a search at 3:00 am for instance, won't the API return anything)?

Thanks in advance, Mark

Contributor guide