Introduction to SIRI
MTA is dedicated to providing free real-time developer API's to the MTA Bus Time system, but did not want to develop Yet Another real time transit data standard. After some research and consultation with the local developer community, we identified the SIRI standard and are using it in this pilot project.
SIRI (Service Interface for Real Time Information) is a standard covering a wide range of types of real-time information for public transportation. This standard has been adopted by the European standards-setting body CEN, and is not owned by any one vendor, public transportation agency or operator. It has been implemented in a growing number of different projects by vendors and agencies around Europe.
SIRI for the MTA Bus Time Developer API
The open nature of this standard and its growing adoption were the two primary selling points to MTA in the context of the open-architecture, standards-based MTA Bus Time project. Based on our research, this pilot project represents the first SIRI implementation that is public-facing and free to access.
SIRI is not a simple standard. It has different web service calls and data types covering all sorts of real-time and scheduled public transportation information. SIRI can be thought of as a menu; having picked a few items from that menu, we feel the results are simple and legible, if a bit verbose. We don't necessarily recommend it, but if you are curious to read about all of the features of SIRI, the SIRI Handbook makes for a bit of light reading.
One thing SIRI did not cover is the "distance away" (rather than time-based predictions) concept that we have introduced in this pilot. Fortunately, SIRI is an extensible standard so we were able to make it work for this project. As well, while SIRI requests are typically SOAP requests sent via HTTP POST, in this case we implemented a slimmed-down RESTful interface using HTTP GET requests.
The SIRI web service calls implemented by MTA Bus Time are:
- VehicleMonitoring: real-time information about one, many, or all vehicles tracked by the system.
- StopMonitoring: real-time information about vehicles serving a particular stop.
These results of these two calls have many of the same elements; they simply represent different slices through the same pie.
JSON and XML
While the SIRI standard specifies XML as an interchange format, it incurs a substantial penalty in data-transfer and processing requirements. In contrast, JSON (Javascript Object Notation) is a lightweight data-interchange format. Human-readable, lightweight, and easy to parse, JSON offers an alternative. Thus, MTA Bus Time provides both XML and JSON versions of its API.
GTFS Reference Data
These two SIRI calls use the MTA's GTFS data as a reference, for example for stop ID's and names. The OneBusAway software that powers MTA Bus Time comes with a free utility to strip down a GTFS file to only the data relevant to a given route.
Developers can use this utility to generate the GTFS for only the B63 route. To help you get started, we have posted the B63-only GTFS that powered MTA Bus Time at the time of its launch.
SIRI Going Forward
Please let us know what you think of this API by posting to the MTA Developer Resources Google Group. Your feedback can help us decide whether to use SIRI for any future deployments of MTA Bus Time, and/or for other real-time data we may release for any of our other public transportation services.
