-
Notifications
You must be signed in to change notification settings - Fork 6
Getting Started
OpenTransit's API uses GraphQL. Read more about GraphQL here: http://graphql.org/
You can access the locations of all Muni (San Francisco) and TTC (Toronto) vehicles during any time interval (December 2017 - now).
When you're looking to make interactive dynamic visualizations that are generated on-the-fly. One such example (in development) is our web-app - https://github.com/trynmaps/opentransit-map.
If you're looking to analyze data of more than a few hours, or are looking for something specific (eg. all Muni 14 trips in the past year). Just contact us (create an issue called dataset request in this repo) for instructions on accessing our daily and monthly datasets.
We don't have any set limit, but we also don't have any pagination or streaming set up. If it times out in our database (over 10 seconds), then the response will be empty. For San Francisco, time intervals of up to a few hours will succeed, and will return tens of thousands of vehicles. For larger intervals, see the previous question.
Note that API input must be in UTC epoch in milliseconds. API output (the vtime fields) is in UTC, as are our datasets.
Currently you can set the transit agency and routes. We plan on adding requesting by vehicle ID and a geofence soon.
Stay tuned!
Try out a query here: https://bit.ly/2Os81Qv
It returns all Muni buses running on the 14, 14R, and 49 routes between 4pm and 6pm (US/Pacific) on March 28, 2018.
You can learn more about our GraphQL types and schema by clicking on Docs at the top-right of the page.