Skip to content

Getting Started

Eddy Ionescu edited this page Oct 3, 2020 · 8 revisions

OpenTransit's API uses GraphQL. Read more about GraphQL here: http://graphql.org/

What can I access?

You can access the locations of all Muni (San Francisco) and TTC (Toronto) vehicles during any time interval (December 2017 - now).

When should I use the API?

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.

When should I not use the API?

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.

How big can the time interval be?

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.

What timezone should I use?

Note that API input must be in UTC epoch in milliseconds. API output (the vtime fields) is in UTC, as are our datasets.

How granular can I be?

Currently you can set the transit agency and routes. We plan on adding requesting by vehicle ID and a geofence soon.

Can I get speed and reliability data?

Stay tuned!

How do I start?

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.