swagger: "2.0"
schemes:
  - http
  - https
host: api.wmata.com
basePath: /StationPrediction.svc
info:
  description: Real-time rail prediction methods.
  title: Real-Time Rail Predictions
  version: "1.0"
  x-apisguru-categories:
    - transport
  x-logo:
    url: https://twitter.com/wmata/profile_image?size=original
  x-origin:
    - format: swagger
      url: https://developer.wmata.com/docs/services/547636a6f9182302184cda78/export?DocumentFormat=Swagger
      version: "2.0"
  x-providerName: wmata.com
  x-serviceName: rail-realtime
securityDefinitions:
  apiKeyHeader:
    in: header
    name: api_key
    type: apiKey
  apiKeyQuery:
    in: query
    name: api_key
    type: apiKey
security:
  - apiKeyHeader: []
  - apiKeyQuery: []
tags: []
paths:
  "/GetPrediction/{StationCodes}":
    get:
      description: "<h4 class=\"text-primary\">Description</h4>\r

        \r

        <p>Returns next train arrival information for one or more stations. Will return\r

        an empty set of results when no predictions are available. Use <span class=\r

        \"text-info\">All</span> for the StationCodes parameter to return predictions for\r

        all stations.</p>\r

        \r

        <p>For terminal stations (e.g.: Greenbelt, Shady Grove, etc.), predictions may\r

        be displayed twice.</p>\r

        \r

        <p>Some stations have two platforms (e.g.: Gallery Place, Fort Totten, L'Enfant\r

        Plaza, and Metro Center). To retrieve complete predictions for these stations,\r

        be sure to pass in both StationCodes.</p>\r

        \r

        <p>For trains with no passengers, the DestinationName will be <span class=\r

        \"text-info\">No Passenger</span>.</p>\r

        \r

        <p>Next train arrival information is refreshed once every 20 to 30 seconds approximately.</p>\r

        \r

        <h4 class=\"text-primary\">Response Elements</h4>\r

        \r

        <table class=\"table table-condensed table-hover\">\r

        <thead>\r

        <tr>\r

        <th class=\"col-md-3\">Element</th>\r

        \r

        <th>Description</th>\r

        </tr>\r

        </thead>\r

        \r

        <tbody>\r

        <tr>\r

        <td>Trains</td>\r

        \r

        <td>\r

        Array containing train prediction information (<a href=\r

        \"#AIMPredictionTrainInfo\">AIMPredictionTrainInfo</a>).\r

        </td>\r

        </tr>\r

        \r

        <tr>\r

        <td colspan=\"2\">\r

        <div class=\"text-primary\" style=\"margin-top: 1em\">\r

        <a id=\"AIMPredictionTrainInfo\" name=\r

        \"AIMPredictionTrainInfo\">AIMPredictionTrainInfo\r

        Elements</a>\r

        </div>\r

        </td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Car</td>\r

        \r

        <td>Number of cars on a train, usually 6 or 8, but might also\r

        return <span class=\"text-info\">-</span> or NULL.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Destination</td>\r

        \r

        <td>Abbreviated version of the final destination for a train. This\r

        is similar to what is displayed on the signs at stations.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>DestinationCode</td>\r

        \r

        <td>Destination station code. Can be NULL. Use this value in other\r

        rail-related APIs to retrieve data about a station.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>DestinationName</td>\r

        \r

        <td>When DestinationCode is populated, this is the full name of the\r

        destination station, as shown on the WMATA website.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Group</td>\r

        \r

        <td>Denotes the track this train is on, but does not necessarily\r

        equate to Track 1 or Track 2. With the exception of terminal\r

        stations, predictions at the same station with different Group\r

        values refer to trains on different tracks.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Line</td>\r

        \r

        <td>Two-letter abbreviation for the line (e.g.: RD, BL, YL, OR, GR,\r

        or SV). May also be blank or <span class=\"text-info\">No</span> for\r

        trains with no passengers.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>LocationCode</td>\r

        \r

        <td>Station code for where the train is arriving. Useful when\r

        passing in <span class=\"text-info\">All</span> as the StationCodes\r

        parameter. Use this value in other rail-related APIs to retrieve\r

        data about a station.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>LocationName</td>\r

        \r

        <td>Full name of the station where the train is arriving. Useful\r

        when passing in <span class=\"text-info\">All</span> as the\r

        StationCodes parameter.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Min</td>\r

        \r

        <td>Minutes until arrival. Can be a numeric value, <span class=\r

        \"text-info\">ARR</span> (arriving), <span class=\r

        \"text-info\">BRD</span> (boarding), <span class=\r

        \"text-info\">---</span>, or empty.</td>\r

        </tr>\r

        </tbody>\r

        </table>\r

        <hr>"
      operationId: 547636a6f918230da8553640
      parameters:
        - default: B03
          description: Comma-separated list of station codes.  For all predictions, use "All".
          enum:
            - B03
            - All
          in: path
          name: StationCodes
          required: true
          type: string
      produces:
        - text/xml
      responses:
        "200":
          description: Default return code.
          examples:
            text/xml: |-
              <AIMPredictionResp
                  xmlns="http://www.wmata.com"
                  xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                  <Trains>
                      <AIMPredictionTrainInfo>
                          <Car>8</Car>
                          <Destination>Glenmont</Destination>
                          <DestinationCode>B11</DestinationCode>
                          <DestinationName>Glenmont</DestinationName>
                          <Group>1</Group>
                          <Line>RD</Line>
                          <LocationCode>A01</LocationCode>
                          <LocationName>Metro Center</LocationName>
                          <Min>1</Min>
                      </AIMPredictionTrainInfo>
                      <AIMPredictionTrainInfo>
                          <Car>8</Car>
                          <Destination>Shady Gr</Destination>
                          <DestinationCode>A15</DestinationCode>
                          <DestinationName>Shady Grove</DestinationName>
                          <Group>2</Group>
                          <Line>RD</Line>
                          <LocationCode>A01</LocationCode>
                          <LocationName>Metro Center</LocationName>
                          <Min>1</Min>
                      </AIMPredictionTrainInfo>
                      <AIMPredictionTrainInfo>
                          <Car>6</Car>
                          <Destination>SilvrSpg</Destination>
                          <DestinationCode>B08</DestinationCode>
                          <DestinationName>Silver Spring</DestinationName>
                          <Group>1</Group>
                          <Line>RD</Line>
                          <LocationCode>A01</LocationCode>
                          <LocationName>Metro Center</LocationName>
                          <Min>3</Min>
                      </AIMPredictionTrainInfo>
                      <AIMPredictionTrainInfo>
                          <Car>6</Car>
                          <Destination>Grsvnor</Destination>
                          <DestinationCode>A11</DestinationCode>
                          <DestinationName>Grosvenor-Strathmore</DestinationName>
                          <Group>2</Group>
                          <Line>RD</Line>
                          <LocationCode>A01</LocationCode>
                          <LocationName>Metro Center</LocationName>
                          <Min>4</Min>
                      </AIMPredictionTrainInfo>
                      <AIMPredictionTrainInfo>
                          <Car>6</Car>
                          <Destination>Glenmont</Destination>
                          <DestinationCode>B11</DestinationCode>
                          <DestinationName>Glenmont</DestinationName>
                          <Group>1</Group>
                          <Line>RD</Line>
                          <LocationCode>A01</LocationCode>
                          <LocationName>Metro Center</LocationName>
                          <Min>5</Min>
                      </AIMPredictionTrainInfo>
                      <AIMPredictionTrainInfo>
                          <Car>8</Car>
                          <Destination>Shady Gr</Destination>
                          <DestinationCode>A15</DestinationCode>
                          <DestinationName>Shady Grove</DestinationName>
                          <Group>2</Group>
                          <Line>RD</Line>
                          <LocationCode>A01</LocationCode>
                          <LocationName>Metro Center</LocationName>
                          <Min>6</Min>
                      </AIMPredictionTrainInfo>
                  </Trains>
              </AIMPredictionResp>
      summary: XML - Next Trains
  "/json/GetPrediction/{StationCodes}":
    get:
      description: "<h4 class=\"text-primary\">Description</h4>\r

        \r

        <p>Returns next train arrival information for one or more stations. Will return\r

        an empty set of results when no predictions are available. Use <span class=\r

        \"text-info\">All</span> for the StationCodes parameter to return predictions for\r

        all stations.</p>\r

        \r

        <p>For terminal stations (e.g.: Greenbelt, Shady Grove, etc.), predictions may\r

        be displayed twice.</p>\r

        \r

        <p>Some stations have two platforms (e.g.: Gallery Place, Fort Totten, L'Enfant\r

        Plaza, and Metro Center). To retrieve complete predictions for these stations,\r

        be sure to pass in both StationCodes.</p>\r

        \r

        <p>For trains with no passengers, the DestinationName will be <span class=\r

        \"text-info\">No Passenger</span>.</p>\r

        \r

        <p>Next train arrival information is refreshed once every 20 to 30 seconds approximately.</p>\r

        \r

        <h4 class=\"text-primary\">Response Elements</h4>\r

        \r

        <table class=\"table table-condensed table-hover\">\r

        <thead>\r

        <tr>\r

        <th class=\"col-md-3\">Element</th>\r

        \r

        <th>Description</th>\r

        </tr>\r

        </thead>\r

        \r

        <tbody>\r

        <tr>\r

        <td>Trains</td>\r

        \r

        <td>\r

        Array containing train prediction information (<a href=\r

        \"#AIMPredictionTrainInfo\">AIMPredictionTrainInfo</a>).\r

        </td>\r

        </tr>\r

        \r

        <tr>\r

        <td colspan=\"2\">\r

        <div class=\"text-primary\" style=\"margin-top: 1em\">\r

        <a id=\"AIMPredictionTrainInfo\" name=\r

        \"AIMPredictionTrainInfo\">AIMPredictionTrainInfo\r

        Elements</a>\r

        </div>\r

        </td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Car</td>\r

        \r

        <td>Number of cars on a train, usually 6 or 8, but might also\r

        return <span class=\"text-info\">-</span> or NULL.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Destination</td>\r

        \r

        <td>Abbreviated version of the final destination for a train. This\r

        is similar to what is displayed on the signs at stations.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>DestinationCode</td>\r

        \r

        <td>Destination station code. Can be NULL. Use this value in other\r

        rail-related APIs to retrieve data about a station.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>DestinationName</td>\r

        \r

        <td>When DestinationCode is populated, this is the full name of the\r

        destination station, as shown on the WMATA website.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Group</td>\r

        \r

        <td>Denotes the track this train is on, but does not necessarily\r

        equate to Track 1 or Track 2. With the exception of terminal\r

        stations, predictions at the same station with different Group\r

        values refer to trains on different tracks.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Line</td>\r

        \r

        <td>Two-letter abbreviation for the line (e.g.: RD, BL, YL, OR, GR,\r

        or SV). May also be blank or <span class=\"text-info\">No</span> for\r

        trains with no passengers.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>LocationCode</td>\r

        \r

        <td>Station code for where the train is arriving. Useful when\r

        passing in <span class=\"text-info\">All</span> as the StationCodes\r

        parameter. Use this value in other rail-related APIs to retrieve\r

        data about a station.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>LocationName</td>\r

        \r

        <td>Full name of the station where the train is arriving. Useful\r

        when passing in <span class=\"text-info\">All</span> as the\r

        StationCodes parameter.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Min</td>\r

        \r

        <td>Minutes until arrival. Can be a numeric value, <span class=\r

        \"text-info\">ARR</span> (arriving), <span class=\r

        \"text-info\">BRD</span> (boarding), <span class=\r

        \"text-info\">---</span>, or empty.</td>\r

        </tr>\r

        </tbody>\r

        </table>\r

        <hr>"
      operationId: 547636a6f918230da855363f
      parameters:
        - default: B03
          description: Comma-separated list of station codes.  For all predictions, use "All".
          enum:
            - B03
            - All
          in: path
          name: StationCodes
          required: true
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: Default return code.
          examples:
            application/json: '{"Trains":[{"Car":"6","Destination":"SilvrSpg","DestinationCode":"B08","DestinationName":"Silver Spring","Group":"1","Line":"RD","LocationCode":"A01","LocationName":"Metro Center","Min":"3"},{"Car":"6","Destination":"Grsvnor","DestinationCode":"A11","DestinationName":"Grosvenor-Strathmore","Group":"2","Line":"RD","LocationCode":"A01","LocationName":"Metro Center","Min":"4"},{"Car":"6","Destination":"Shady Gr","DestinationCode":"A15","DestinationName":"Shady Grove","Group":"2","Line":"RD","LocationCode":"A01","LocationName":"Metro Center","Min":"6"},{"Car":"8","Destination":"Glenmont","DestinationCode":"B11","DestinationName":"Glenmont","Group":"1","Line":"RD","LocationCode":"A01","LocationName":"Metro Center","Min":"8"},{"Car":"6","Destination":"SilvrSpg","DestinationCode":"B08","DestinationName":"Silver Spring","Group":"1","Line":"RD","LocationCode":"A01","LocationName":"Metro Center","Min":"9"},{"Car":"6","Destination":"Grsvnor","DestinationCode":"A11","DestinationName":"Grosvenor-Strathmore","Group":"2","Line":"RD","LocationCode":"A01","LocationName":"Metro Center","Min":"9"}]}'
      summary: JSON - Next Trains
