-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get a list of all trains at a station in a given time frame? #17
Comments
follow-up of ee38f7c related: public-transport/transport.rest#17
I assume you're referring to the
Indeed, you'd have fetch both sets of trains/trips and combine them. You can use the curl 'https://v6.db.transport.rest/stops/8000263/departures?when=2023-02-14T10%3A43%2B01%3A00' -fsSL -I | grep link
# link: […] <?when=2023-02-14T10%3A53%2B01%3A00>; rel=next
This is an unfortunate combination of two issues:
I would like to, but as I said: I don't know either what its limitations are. |
Excuse me for not specifying it but yes, I am referring to One minor request: What do you think of adding an example request to both
– but feel free to use a better one. I haven't played around with the other endpoint. |
Example using some more features, not using
This means "give me all trains meeting the following criteria":
This is actually pretty close to what I originally wanted to achieve. If cautiously used with additionally filtering out everything that's not a train ( |
Yes, please submit a PR with example URLs! Just add multiple, with a comment on each explaining what it does. You'll have to adapt |
The more I'm playing around with this, the weirder it gets. I don't want to give unhelpful information, so expect this to take some time. Also, I've never really used Node, but I'm happy to execute this one command if it's just that. |
If it's about not "polluting" your system with a toolchain that you usually don't need, you can do it in Docker: If it's about getting used to a new toolchain: Let me know if you encounter any issues! (Preferably, in the aforementioned PR.) |
Well. Both. Excuse me if I'm stupid, but I can't execute this either way. The Docker command (with |
True, the command specified can't work.
Did you run it inside the |
Summing this up: Unfortunately, AFAICT, the very network-centric use case "give me all trips in a certain time frame connecting A and B" is not well-served by the underlying HAFAS API, as it has always been mainly user-/routing-centric. HAFAS' If you do find out more helpful information about it, please don't hesitate to comment in derhuerst/BahnhofsAbfahrten#1, so that others can benefit from this knowledge, too! It would also be great to add documentation about As a workaround, you can of course always use Please re-open this Issues if you have more related questions. |
For a personal project I'd like to get a list of all trains at a station in a certain time frame such as provided by bahn.expert and DBF. I can't use one of
/stops/:id/arrivals
or/stops/:id/departures
, at least not with only one query, since AFAIK/stops/:id/departures
misses the data of trains that end at the station queried and/stops/:id/arrivals
misses the trains that start at this station. I tried to use/trips
with a station ID and a time frame, but every request that I have tried has returned a 400.Is there any easy way to achieve my goal? And could you maybe extend the documentation for
/trips
, because I really don't understand how to use this?The text was updated successfully, but these errors were encountered: