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

Getting departures from stop via API? #264

Closed
jamesmacwhite opened this issue Feb 3, 2024 · 3 comments
Closed

Getting departures from stop via API? #264

jamesmacwhite opened this issue Feb 3, 2024 · 3 comments

Comments

@jamesmacwhite
Copy link

Hi @jclgoodwin

Thanks for your work on bustimes.org!

I was wondering if the current API allows for obtaining the departures from a specific stop through the API i.e. JSON, rather than the web interface?

I can see there's this path: https://bustimes.org/stops/9400ZZNOLCM2/departures within the JavaScript resources for the main website, but this is HTML formatted as a part that gets included in the main web interface overall and refreshes a div element.

I can do this: https://bustimes.org/api/stops/9400ZZNOLCM2/, but adding the depatures path throws a 404 Not Found, so I'm not sure if it is intended to be used this way?

Thank you!

@jclgoodwin
Copy link
Owner

There is – undocumented but used by a few things:

https://bustimes.org/stops/9400ZZNOLCM2/times.json
https://bustimes.org/stops/9400ZZNOLCM2/times.json?limit=3
https://bustimes.org/stops/9400ZZNOLCM2/times.json?when=2024-02-03T12:30:00Z

@jamesmacwhite
Copy link
Author

Ah thank you! That makes sense.

In terms of external applications using this API, is this within the terms of service/usage or would you require further discussion around this area?

@ukslim
Copy link

ukslim commented Apr 10, 2024

I have used this API in https://github.com/ukslim/my-bus-stops - letting you know as a courtesy, and to say thank you.

Please do let me know if this is a problem or there's a different endpoint you'd prefer me to use. I don't realistically expect it to become heavily used.

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

No branches or pull requests

3 participants