> ## 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.

# Get LIRR departures

> Get upcoming LIRR departures with realtime trip updates.



## OpenAPI

````yaml /openapi.json get /api/v1/lirr/departures
openapi: 3.1.2
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: path
    description: PATH realtime arrivals for New Jersey stations
  - name: nj-transit-rail
    description: NJ Transit RailData realtime data
  - name: nyc-ferry
    description: NYC Ferry GTFS and GTFS-Realtime data
  - name: citi-bike
    description: Citi Bike GBFS station and service data
  - name: lirr
    description: Long Island Rail Road GTFS and GTFS-Realtime data
  - name: metro-north
    description: Metro-North Railroad GTFS and GTFS-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/lirr/departures:
    get:
      tags:
        - lirr
      summary: Get LIRR departures
      description: Get upcoming LIRR departures with realtime trip updates.
      operationId: getApiV1LirrDepartures
      parameters:
        - name: stop
          in: query
          required: true
          schema:
            minLength: 1
            description: Station ID, stop code, or exact name.
            type: string
        - name: route
          in: query
          required: false
          schema:
            minLength: 1
            type: string
        - name: limit
          in: query
          required: false
          schema:
            minimum: 1
            maximum: 100
            type: number
      responses:
        '200':
          description: Response for status 200
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                    - route
                    - stop
                    - direction
                    - time
                    - minutes
                    - realtime
                    - source
                  properties:
                    route:
                      type: object
                      required:
                        - id
                        - name
                        - mode
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        color:
                          type: string
                        mode:
                          type: string
                          enum:
                            - lirr
                            - metro-north
                    stop:
                      type: object
                      required:
                        - id
                        - name
                        - lat
                        - lon
                        - mode
                      properties:
                        id:
                          type: string
                        code:
                          type: string
                        name:
                          type: string
                        lat:
                          type: number
                        lon:
                          type: number
                        mode:
                          type: string
                          enum:
                            - lirr
                            - metro-north
                    trainNumber:
                      type: string
                    headsign:
                      type: string
                    destination:
                      type: string
                    direction:
                      type: string
                    peak:
                      type: string
                    time:
                      type: string
                    minutes:
                      type: number
                    delaySeconds:
                      type: number
                    tripId:
                      type: string
                    realtime:
                      const: true
                      type: boolean
                    source:
                      type: string
      x-codeSamples:
        - lang: typescript
          label: mta-js
          source: >-
            import { MTA } from "mta-js";

            const mta = new MTA({ apiKey: process.env.MTA_API_KEY });

            const data = await mta.lirr.departures({ stop: "Penn Station",
            route: "1", limit: 5 });
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.