swagger: "2.0"
schemes:
  - http
  - https
host: api.wmata.com
basePath: /NextBusService.svc
info:
  description: Real-time bus prediction methods.
  title: Real-Time Bus 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/5476365e031f590f38092508/export?DocumentFormat=Swagger
      version: "2.0"
  x-providerName: wmata.com
  x-serviceName: bus-realtime
securityDefinitions:
  apiKeyHeader:
    in: header
    name: api_key
    type: apiKey
  apiKeyQuery:
    in: query
    name: api_key
    type: apiKey
security:
  - apiKeyHeader: []
  - apiKeyQuery: []
tags: []
paths:
  /Predictions:
    get:
      description: "<h4 class=\"text-primary\">Description</h4>\r

        \r

        <p>Returns next bus arrival times at a stop.</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>Predictions</td>\r

        \r

        <td>\r

        Array containing bus predictions (<a href=\r

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

        </td>\r

        </tr>\r

        \r

        <tr>\r

        <td>StopName</td>\r

        \r

        <td>Full name of the given StopID.</td>\r

        </tr>\r

        \r

        <tr>\r

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

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

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

        \"NextBusPrediction\">NextBusPrediction Elements</a>\r

        </div>\r

        </td>\r

        </tr>\r

        \r

        <tr>\r

        <td>DirectionNum</td>\r

        \r

        <td>Denotes a binary direction (0 or 1) of the bus. There is no\r

        specific mapping to direction, but a different value for the same\r

        route signifies that the buses are traveling in opposite\r

        directions. Use the DirectionText element to show the actual\r

        destination of the bus.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>DirectionText</td>\r

        \r

        <td>Customer-friendly description of direction and destination for\r

        a bus.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Minutes</td>\r

        \r

        <td>Minutes until bus arrival at this stop. Numeric value.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>RouteID</td>\r

        \r

        <td>Base route name as shown on the bus. This can be used in other\r

        bus-related methods. Note that all variants will be shown as their\r

        base route names (i.e.: 10Av1 and 10Av2 will be shown as 10A).</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>TripID</td>\r

        \r

        <td>Trip identifier. This can be correlated with the data in our\r

        bus schedule information as well as bus positions.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>VehicleID</td>\r

        \r

        <td>Bus identifier. This can be correlated with results returned\r

        from bus positions.</td>\r

        </tr>\r

        </tbody>\r

        </table>"
      operationId: 5476365e031f5909e4fe331e
      parameters:
        - default: "1001195"
          description: 7-digit regional stop ID.
          enum:
            - "1001195"
          in: query
          name: StopID
          required: true
          type: string
      produces:
        - text/xml
        - application/xml
      responses:
        "200":
          description: Default response code.
          examples:
            text/xml: |-
              <NextBusResponse
                  xmlns="http://www.wmata.com"
                  xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                  <Predictions>
                      <NextBusPrediction>
                          <DirectionNum>0</DirectionNum>
                          <DirectionText>North to Bwi - Thurgood Marshall Airport</DirectionText>
                          <Minutes>8</Minutes>
                          <RouteID>B30</RouteID>
                          <TripID>6794838</TripID>
                          <VehicleID>6217</VehicleID>
                      </NextBusPrediction>
                      <NextBusPrediction>
                          <DirectionNum>1</DirectionNum>
                          <DirectionText>South to Greenbelt Station</DirectionText>
                          <Minutes>37</Minutes>
                          <RouteID>B30</RouteID>
                          <TripID>6794868</TripID>
                          <VehicleID>6217</VehicleID>
                      </NextBusPrediction>
                      <NextBusPrediction>
                          <DirectionNum>0</DirectionNum>
                          <DirectionText>North to Bwi - Thurgood Marshall Airport</DirectionText>
                          <Minutes>48</Minutes>
                          <RouteID>B30</RouteID>
                          <TripID>6794839</TripID>
                          <VehicleID>6213</VehicleID>
                      </NextBusPrediction>
                      <NextBusPrediction>
                          <DirectionNum>1</DirectionNum>
                          <DirectionText>South to Greenbelt Station</DirectionText>
                          <Minutes>77</Minutes>
                          <RouteID>B30</RouteID>
                          <TripID>6794869</TripID>
                          <VehicleID>6213</VehicleID>
                      </NextBusPrediction>
                  </Predictions>
                  <StopName>Bwi Airport + Stop 2</StopName>
              </NextBusResponse>
        "400":
          description: Response from invalid Stop ID.
          examples:
            application/xml: <Error><Message>Stop Id not specified, invalid, or does not exist.</Message></Error>
      summary: XML - Next Buses
  /json/jPredictions:
    get:
      description: "<h4 class=\"text-primary\">Description</h4>\r

        \r

        <p>Returns next bus arrival times at a stop.</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>Predictions</td>\r

        \r

        <td>\r

        Array containing bus predictions (<a href=\r

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

        </td>\r

        </tr>\r

        \r

        <tr>\r

        <td>StopName</td>\r

        \r

        <td>Full name of the given StopID.</td>\r

        </tr>\r

        \r

        <tr>\r

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

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

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

        \"NextBusPrediction\">NextBusPrediction Elements</a>\r

        </div>\r

        </td>\r

        </tr>\r

        \r

        <tr>\r

        <td>DirectionNum</td>\r

        \r

        <td>Denotes a binary direction (0 or 1) of the bus. There is no\r

        specific mapping to direction, but a different value for the same\r

        route signifies that the buses are traveling in opposite\r

        directions. Use the DirectionText element to show the actual\r

        destination of the bus.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>DirectionText</td>\r

        \r

        <td>Customer-friendly description of direction and destination for\r

        a bus.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>Minutes</td>\r

        \r

        <td>Minutes until bus arrival at this stop. Numeric value.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>RouteID</td>\r

        \r

        <td>Base route name as shown on the bus. This can be used in other\r

        bus-related methods. Note that all variants will be shown as their\r

        base route names (i.e.: 10Av1 and 10Av2 will be shown as 10A).</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>TripID</td>\r

        \r

        <td>Trip identifier. This can be correlated with the data in our\r

        bus schedule information as well as bus positions.</td>\r

        </tr>\r

        \r

        <tr>\r

        <td>VehicleID</td>\r

        \r

        <td>Bus identifier. This can be correlated with results returned\r

        from bus positions.</td>\r

        </tr>\r

        </tbody>\r

        </table>"
      operationId: 5476365e031f5909e4fe331d
      parameters:
        - default: "1001195"
          description: 7-digit regional stop ID.
          enum:
            - "1001195"
          in: query
          name: StopID
          required: true
          type: string
      produces:
        - application/json
      responses:
        "200":
          description: Default response type.
          examples:
            application/json: |-
              {
                  "Predictions": [
                      {
                          "DirectionNum": "0",
                          "DirectionText": "North to Bwi - Thurgood Marshall Airport",
                          "Minutes": 8,
                          "RouteID": "B30",
                          "TripID": "6794838",
                          "VehicleID": "6217"
                      },
                      {
                          "DirectionNum": "1",
                          "DirectionText": "South to Greenbelt Station",
                          "Minutes": 37,
                          "RouteID": "B30",
                          "TripID": "6794868",
                          "VehicleID": "6217"
                      },
                      {
                          "DirectionNum": "0",
                          "DirectionText": "North to Bwi - Thurgood Marshall Airport",
                          "Minutes": 48,
                          "RouteID": "B30",
                          "TripID": "6794839",
                          "VehicleID": "6213"
                      },
                      {
                          "DirectionNum": "1",
                          "DirectionText": "South to Greenbelt Station",
                          "Minutes": 77,
                          "RouteID": "B30",
                          "TripID": "6794869",
                          "VehicleID": "6213"
                      }
                  ],
                  "StopName": "Bwi Airport + Stop 2"
              }
        "400":
          description: Response from invalid Stop ID.
          examples:
            application/json: '{"Message":"Stop Id not specified, invalid, or does not exist."}'
      summary: JSON - Next Buses
