> ## Documentation Index
> Fetch the complete documentation index at: https://mtaapi.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# mta.bus.routeStops() — ordered stops on a route

> Reference for GET /api/v1/bus/routes/{route}/stops. Get the ordered stops a bus route serves, optionally hydrated with arrivals.

Returns the ordered stops a bus route serves. Pass the route in the path (for example `M23`) and an optional `direction` filter. Set `includeArrivals=true` to attach live arrivals to each stop (bounded by `limitArrivals` and `limitStops`).

The response is a `RouteStopsResponse`: `{ route, mode, directions: [{ direction, headsigns?, stops: [...] }] }`, where each stop carries an optional `arrivals` array when hydrated.

### SDK

```typescript theme={null}
const routeStops = await mta.bus.routeStops({ route: 'M23' })

for (const pattern of routeStops.directions) {
  console.log(pattern.direction, pattern.stops.length, 'stops')
}
```

See the [Routes & Stations guide](/guides/routes-and-stations).


## OpenAPI

````yaml GET /api/v1/bus/routes/{route}/stops
openapi: 3.0.3
info:
  title: MTA API
  description: Managed, API-key protected access to MTA realtime and static data.
  version: 0.1.0
servers:
  - url: https://www.mtaapi.dev
    description: Production
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: subway
    description: Subway realtime data
  - name: bus
    description: BusTime realtime data
  - name: alerts
    description: Service alerts
  - name: stops
    description: Route-aware static GTFS stop lookup
  - name: system
    description: Health and database status
paths:
  /api/v1/bus/routes/{route}/stops:
    get:
      tags:
        - bus
      summary: Get ordered bus stops for a route
      operationId: getApiV1BusRoutesByRouteStops
      parameters:
        - name: route
          in: path
          required: true
          schema:
            minLength: 1
            type: string
        - name: direction
          in: query
          required: false
          schema:
            minLength: 1
            type: string
        - name: includeArrivals
          in: query
          required: false
          schema:
            type: boolean
        - name: limitArrivals
          in: query
          required: false
          schema:
            minimum: 1
            maximum: 10
            type: number
        - name: limitStops
          in: query
          required: false
          schema:
            minimum: 1
            maximum: 20
            description: Maximum total stops to hydrate when includeArrivals=true.
            type: number
        - name: includeRaw
          in: query
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Response for status 200
          content:
            application/json:
              schema:
                type: object
                required:
                  - route
                  - mode
                  - directions
                properties:
                  route:
                    type: object
                    required:
                      - id
                    properties:
                      id:
                        type: string
                      shortName:
                        type: string
                      longName:
                        type: string
                      type:
                        type: number
                      color:
                        type: string
                      textColor:
                        type: string
                  mode:
                    enum:
                      - subway
                      - bus
                    type: string
                  directions:
                    type: array
                    items:
                      type: object
                      required:
                        - direction
                        - stops
                      properties:
                        direction:
                          type: string
                        headsigns:
                          type: array
                          items:
                            type: string
                        stops:
                          type: array
                          items:
                            type: object
                            required:
                              - id
                              - name
                            properties:
                              id:
                                type: string
                              name:
                                type: string
                              displayName:
                                type: string
                              lat:
                                type: number
                              lon:
                                type: number
                              mode:
                                enum:
                                  - subway
                                  - bus
                                type: string
                              parentId:
                                type: string
                              arrivals:
                                type: array
                                items:
                                  type: object
                                  required:
                                    - mode
                                    - route
                                    - stop
                                    - direction
                                    - arrivalTime
                                    - minutes
                                    - realtime
                                    - source
                                  properties:
                                    mode:
                                      type: string
                                      enum:
                                        - subway
                                        - bus
                                        - lirr
                                        - metro-north
                                    route:
                                      type: object
                                      required:
                                        - id
                                      properties:
                                        id:
                                          type: string
                                        shortName:
                                          type: string
                                        longName:
                                          type: string
                                        type:
                                          type: number
                                        color:
                                          type: string
                                        textColor:
                                          type: string
                                    stop:
                                      type: object
                                      required:
                                        - id
                                        - name
                                      properties:
                                        id:
                                          type: string
                                        name:
                                          type: string
                                        displayName:
                                          type: string
                                        lat:
                                          type: number
                                        lon:
                                          type: number
                                        mode:
                                          enum:
                                            - subway
                                            - bus
                                          type: string
                                        parentId:
                                          type: string
                                    direction:
                                      type: string
                                      enum:
                                        - north
                                        - south
                                        - east
                                        - west
                                        - unknown
                                        - uptown
                                        - downtown
                                    destination:
                                      type: string
                                    displayDirection:
                                      type: string
                                    headsign:
                                      type: string
                                    arrivalTime:
                                      type: string
                                    departureTime:
                                      type: string
                                    minutes:
                                      type: number
                                    tripId:
                                      type: string
                                    realtime:
                                      type: boolean
                                    source:
                                      type: string
                                    raw: {}
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````