GET actrealtime/prediction?stpid={stpid}&rt={rt}&vid={vid}&top={top}&tmres={tmres}&callback={callback}&showocprd={showocprd}

Use the getpredictions request to retrieve predictions for one or more stops or one or more vehicles. Predictions are always returned in ascending order according to prdtm. Use the vid parameter to retrieve predictions for one or more vehicles currently being tracked. A maximum of 10 vehicles can be specified. Use the stpid parameter to retrieve predictions for one or more stops. A maximum of 10 stops can be specified. Note: The vid and stpid parameters cannot be combined in one request. If both parameters are specified on a request to getpredictions, only the first parameter specified on the request will be processed. Calls to getpredictions without specifying the vid or stpid parameters are not allowed. Use the top parameter to specify the maximum number of predictions to return. If top is not specified, then all predictions matching the specified parameters will be returned nBus only appears if the Transit Authority has the service gap feature enabled. If nBus would have a value less than the configured minimum gap of time (default 120 minutes), the element is empty. If nBus is “-1”, then this prediction is the last bus of the day for this route.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
stpid

comma-delimited list of stop IDs(not available with vid parameter).

string

None.

rt

comma-delimited list of route designators (optional, available with stpid parameter)

string

None.

vid

comma-delimited list of vehicle IDs(not available with stpid parameter)

string

None.

top

Maximum number of predictions to be returned.

integer

None.

tmres

Resolution of time stamps. Set to “s” to get time resolution to the second. Set to “m” to get time resolution to the minute. If omitted, defaults to “m”. Date and time is represented in the following format: If specified as “s” YYYYMMDD HH:MM:SS If specified as “m” YYYYMMDD HH:MM Month is represented as two digits where January is equal to “01” and December is equal to “12”. Time is represented using a 24-hour clock.

string

None.

callback

string

None.

showocprd

boolean

None.

Body Parameters

None.

Response Information

Resource Description

RequestResponseOfPredictionRequestResponse
NameDescriptionTypeAdditional information
bustime-response

PredictionRequestResponse

None.

Response Formats

application/json, text/json

Sample:
{
  "bustime-response": {
    "prd": [
      {
        "tmstmp": "sample string 2",
        "typ": "sample string 3",
        "stpnm": "sample string 4",
        "stpid": "sample string 5",
        "vid": "sample string 6",
        "dstp": 7,
        "rt": "sample string 8",
        "rtdd": "sample string 9",
        "rtdir": "sample string 10",
        "des": "sample string 11",
        "prdtm": "sample string 12",
        "tablockid": "sample string 13",
        "tatripid": "sample string 14",
        "origtatripno": "sample string 15",
        "dly": true,
        "dyn": 17,
        "prdctdn": "sample string 18",
        "zone": "sample string 19",
        "rid": "sample string 20",
        "tripid": "sample string 21",
        "tripdyn": 22,
        "schdtm": "sample string 23",
        "geoid": "sample string 24",
        "seq": 25,
        "psgld": "sample string 26",
        "stst": 27,
        "stsd": "sample string 28",
        "flagstop": 29
      },
      {
        "tmstmp": "sample string 2",
        "typ": "sample string 3",
        "stpnm": "sample string 4",
        "stpid": "sample string 5",
        "vid": "sample string 6",
        "dstp": 7,
        "rt": "sample string 8",
        "rtdd": "sample string 9",
        "rtdir": "sample string 10",
        "des": "sample string 11",
        "prdtm": "sample string 12",
        "tablockid": "sample string 13",
        "tatripid": "sample string 14",
        "origtatripno": "sample string 15",
        "dly": true,
        "dyn": 17,
        "prdctdn": "sample string 18",
        "zone": "sample string 19",
        "rid": "sample string 20",
        "tripid": "sample string 21",
        "tripdyn": 22,
        "schdtm": "sample string 23",
        "geoid": "sample string 24",
        "seq": 25,
        "psgld": "sample string 26",
        "stst": 27,
        "stsd": "sample string 28",
        "flagstop": 29
      }
    ],
    "error": [
      {
        "rtpidatafeed": "sample string 1",
        "stpid": "sample string 2",
        "rt": "sample string 3",
        "vid": "sample string 4",
        "msg": "sample string 5"
      },
      {
        "rtpidatafeed": "sample string 1",
        "stpid": "sample string 2",
        "rt": "sample string 3",
        "vid": "sample string 4",
        "msg": "sample string 5"
      }
    ]
  }
}

text/html

Sample:
{"bustime-response":{"prd":[{"tmstmp":"sample string 2","typ":"sample string 3","stpnm":"sample string 4","stpid":"sample string 5","vid":"sample string 6","dstp":7,"rt":"sample string 8","rtdd":"sample string 9","rtdir":"sample string 10","des":"sample string 11","prdtm":"sample string 12","tablockid":"sample string 13","tatripid":"sample string 14","origtatripno":"sample string 15","dly":true,"dyn":17,"prdctdn":"sample string 18","zone":"sample string 19","rid":"sample string 20","tripid":"sample string 21","tripdyn":22,"schdtm":"sample string 23","geoid":"sample string 24","seq":25,"psgld":"sample string 26","stst":27,"stsd":"sample string 28","flagstop":29},{"tmstmp":"sample string 2","typ":"sample string 3","stpnm":"sample string 4","stpid":"sample string 5","vid":"sample string 6","dstp":7,"rt":"sample string 8","rtdd":"sample string 9","rtdir":"sample string 10","des":"sample string 11","prdtm":"sample string 12","tablockid":"sample string 13","tatripid":"sample string 14","origtatripno":"sample string 15","dly":true,"dyn":17,"prdctdn":"sample string 18","zone":"sample string 19","rid":"sample string 20","tripid":"sample string 21","tripdyn":22,"schdtm":"sample string 23","geoid":"sample string 24","seq":25,"psgld":"sample string 26","stst":27,"stsd":"sample string 28","flagstop":29}],"error":[{"rtpidatafeed":"sample string 1","stpid":"sample string 2","rt":"sample string 3","vid":"sample string 4","msg":"sample string 5"},{"rtpidatafeed":"sample string 1","stpid":"sample string 2","rt":"sample string 3","vid":"sample string 4","msg":"sample string 5"}]}}

application/xml, text/xml

Sample:
<RequestResponseOfPredictionRequestResponseV_SDPij9I xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ACTransit.Transit.Domain.Models">
  <Response>
    <Error>
      <RequestErrorResponse.BusTimeError>
        <Msg>sample string 5</Msg>
        <Rt>sample string 3</Rt>
        <RtpiDataFeed>sample string 1</RtpiDataFeed>
        <StpId>sample string 2</StpId>
        <VId>sample string 4</VId>
      </RequestErrorResponse.BusTimeError>
      <RequestErrorResponse.BusTimeError>
        <Msg>sample string 5</Msg>
        <Rt>sample string 3</Rt>
        <RtpiDataFeed>sample string 1</RtpiDataFeed>
        <StpId>sample string 2</StpId>
        <VId>sample string 4</VId>
      </RequestErrorResponse.BusTimeError>
    </Error>
    <Predictions>
      <PredictionRequestResponse.Prediction>
        <Des>sample string 11</Des>
        <Dly>true</Dly>
        <Dstp>7</Dstp>
        <Dyn>17</Dyn>
        <FlagStop>29</FlagStop>
        <Geoid>sample string 24</Geoid>
        <Origtatripno>sample string 15</Origtatripno>
        <Prdctdn>sample string 18</Prdctdn>
        <Prdtm>sample string 12</Prdtm>
        <Psgld>sample string 26</Psgld>
        <Rid>sample string 20</Rid>
        <Rt>sample string 8</Rt>
        <Rtdd>sample string 9</Rtdd>
        <Rtdir>sample string 10</Rtdir>
        <Schdtm>sample string 23</Schdtm>
        <Seq>25</Seq>
        <Stpid>sample string 5</Stpid>
        <Stpnm>sample string 4</Stpnm>
        <Stsd>sample string 28</Stsd>
        <Stst>27</Stst>
        <Tablockid>sample string 13</Tablockid>
        <Tatripid>sample string 14</Tatripid>
        <Tmstmp>sample string 2</Tmstmp>
        <Tripdyn>22</Tripdyn>
        <Tripid>sample string 21</Tripid>
        <Typ>sample string 3</Typ>
        <VehicleId>sample string 6</VehicleId>
        <Vid>sample string 6</Vid>
        <Zone>sample string 19</Zone>
      </PredictionRequestResponse.Prediction>
      <PredictionRequestResponse.Prediction>
        <Des>sample string 11</Des>
        <Dly>true</Dly>
        <Dstp>7</Dstp>
        <Dyn>17</Dyn>
        <FlagStop>29</FlagStop>
        <Geoid>sample string 24</Geoid>
        <Origtatripno>sample string 15</Origtatripno>
        <Prdctdn>sample string 18</Prdctdn>
        <Prdtm>sample string 12</Prdtm>
        <Psgld>sample string 26</Psgld>
        <Rid>sample string 20</Rid>
        <Rt>sample string 8</Rt>
        <Rtdd>sample string 9</Rtdd>
        <Rtdir>sample string 10</Rtdir>
        <Schdtm>sample string 23</Schdtm>
        <Seq>25</Seq>
        <Stpid>sample string 5</Stpid>
        <Stpnm>sample string 4</Stpnm>
        <Stsd>sample string 28</Stsd>
        <Stst>27</Stst>
        <Tablockid>sample string 13</Tablockid>
        <Tatripid>sample string 14</Tatripid>
        <Tmstmp>sample string 2</Tmstmp>
        <Tripdyn>22</Tripdyn>
        <Tripid>sample string 21</Tripid>
        <Typ>sample string 3</Typ>
        <VehicleId>sample string 6</VehicleId>
        <Vid>sample string 6</Vid>
        <Zone>sample string 19</Zone>
      </PredictionRequestResponse.Prediction>
    </Predictions>
  </Response>
</RequestResponseOfPredictionRequestResponseV_SDPij9I>