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 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 project represents the first SIRI implementation that is public-facing and free to access.
SIRI is not a simple standard, but it has a degree of elegance in it's complexity. Unlike GTFS and GTFS-RT, SIRI objects include layers of elements that are primarily designed to provide small pieces of 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. 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 project. 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 routes that are served by Bus Time.
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 plan improvements to this API. It may be worth noting that the body/committee which manages the SIRI standard has adopted many of the changes/extension we made for this project into SIRI 2.0 specification, including: inclusion of "distance-away" values, RESTful request-response, and non-XML encodings.
Other API's
MTA Bus Time uses SIRI to expose real-time information about buses serving the routes and stops covered by the system. MTA Bus Time also exposes a modified version of the OneBusAway RESTful API for so-called "discovery" services. This API will allow you to "discover" static/baseline information about the bus services covered under MTA Bus Time. It is, effectively, a set of web services that gives you convenient HTTP-based access to selected subsets of information otherwise available from the GTFS files.