Include

An arrival time doesn't mean much unless you know where the vehicle is arriving and where it's going next. Some objects are defined largely by their relationship to other objects. Those other objects can be included in the results as well.

The following examples of "including" use the schedules call:

schedules?filter... returns a selection of scheduled stops (`stop_times`), which contains the route_id, trip_id, and stop_id, but no information about the corresponding trip, route, or stop.

schedules?include=route&filter... includes each route object referenced by a schedule object, providing the route name, mode, color, etc. The included values are in an `include[]` object and can be looked up from the predictions by their type and id.

schedules?include=prediction&filter... includes real-time predictions (if any) currently being made for the returned scheduled times. In this example URL you're only likely to see predictions if you make the call around 1:30 PM-2:30 PM EST.

This is an example to obtain predictions with useful information about the stops they are related to:

predictions?filter... returns predictions from South Station with direction_id 0. Note the "relationships" fields for each prediction; each prediction has a relationship with a stop which corresponds to the platform the train will be at. The id of the related stop can be cross referenced with the included stops to obtain useful information such as the platform_code that the vehicle for the prediction will be leaving from.