Skip to content
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

/journeys doesnt take destination name #38

Open
nanocraftmr opened this issue Dec 21, 2023 · 6 comments
Open

/journeys doesnt take destination name #38

nanocraftmr opened this issue Dec 21, 2023 · 6 comments
Labels
docs regarding documentation question

Comments

@nanocraftmr
Copy link

i want to give the journeys endpoint the destination name: "to.name = Köln hbf" and not the id code from the station with "to=1389212" .

Im using Insomnia to test it.

In the documentation it seems to be possible, but it doesnt work.

image
image

Am i doing something wrong or is this feature not working right now?

Thanks for helping

@derhuerst
Copy link
Owner

With each of the mentioned options (stop/station ID, POI, address), you need to provide every listed field.

In the documentation it seems to be possible, but it doesnt work.

I think we should clarify the documentation, because it misled you. How would you like it to be phrased?

@derhuerst derhuerst added question docs regarding documentation labels Dec 21, 2023
@nanocraftmr
Copy link
Author

nanocraftmr commented Dec 21, 2023

https://v6.db.transport.rest/api.html#get-journeys
image
by the api documentationi thought i can give it "to.name" (station name) instead of the bahn station id. As a user would want to search for connections from station to station and doesnt know the id.

am i using the api wrong or is it broken? when i just pass the name it says it needs an destination

@derhuerst
Copy link
Owner

If you want to pass a POI, you'll have to pass all of the enumerated parameters; This is a limitation of the underlying HAFAS API. We should make this clear in the docs.

You can find POIs by using /locations?query=…&stops=false&addresses=false (or /locations/nearby).

@nanocraftmr
Copy link
Author

Thanks for the quick help. Love your work 👏

@derhuerst
Copy link
Owner

Others likely also had this question, let's improve the docs.

@derhuerst derhuerst reopened this Dec 23, 2023
@derhuerst
Copy link
Owner

Can you submit a PR that improves the phrasing?

The example is here:

'/journeys': `\
Uses [\`hafasClient.journeys()\`](https://github.com/public-transport/hafas-client/blob/6/docs/journeys.md) to **find journeys from A (\`from\`) to B (\`to\`)**.
\`from\` (A), \`to\` (B), and the optional \`via\` must each have one of these formats:
- as stop/station ID (e.g. \`from=8010159\` for *Halle (Saale) Hbf*)
- as a POI (e.g. \`from.id=991561765&from.latitude=51.48364&from.longitude=11.98084&from.name=Halle+(Saale),+Stadtpark+Halle+(Grünanlagen)\` for *Halle (Saale), Stadtpark Halle (Grünanlagen)*)
- as an address (e.g. \`from.latitude=51.25639&from.longitude=7.46685&from.address=Hansestadt+Breckerfeld,+Hansering+3\` for *Hansestadt Breckerfeld, Hansering 3*)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs regarding documentation question
Projects
None yet
Development

No branches or pull requests

2 participants