OneBusAway default API

The default API from OneBusAway — 13 operation(s) for default.

OpenAPI Specification

onebusaway-default-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: OneBusAway default API
  description: The OneBusAway REST API. For use with servers like https://api.pugetsound.onebusaway.org
  version: 0.0.2
servers:
- url: https://api.pugetsound.onebusaway.org
security:
- ApiKeyAuth: []
tags:
- name: default
paths:
  /api/where/agencies-with-coverage.json:
    get:
      tags:
      - default
      summary: Returns a list of all transit agencies currently supported by OneBusAway along with the center of their coverage area.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/CoverageResponse'
                  required:
                  - data
  /api/where/schedule-for-route/{routeID}.json:
    get:
      tags:
      - default
      summary: Retrieve the full schedule for a route on a particular day
      parameters:
      - name: routeID
        in: path
        description: The route id to request the schedule for
        schema:
          type: string
        example: '1_100223'
        required: true
      - name: date
        in: query
        description: The date for which you want to request a schedule in the format YYYY-MM-DD (optional, defaults to current date)
        schema:
          type: string
          format: date
        example: '2024-08-12'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/ScheduleForRouteResponse'
                  required:
                  - data
        '404':
          $ref: '#/components/responses/NotFound'
  /api/where/routes-for-location.json:
    get:
      tags:
      - default
      summary: routes-for-location
      parameters:
      - name: lat
        in: query
        schema:
          type: number
        example: 47.653435
        required: true
      - name: lon
        in: query
        schema:
          type: number
        example: -122.305641
        required: true
      - name: radius
        in: query
        schema:
          type: number
        required: false
      - name: latSpan
        in: query
        schema:
          type: number
        required: false
      - name: lonSpan
        in: query
        schema:
          type: number
        required: false
      - name: query
        in: query
        schema:
          type: string
        required: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/RoutesForLocationResponse'
                  required:
                  - data
  /api/where/routes-for-agency/{agencyID}.json:
    get:
      tags:
      - default
      summary: Retrieve the list of all routes for a particular agency by id
      parameters:
      - name: agencyID
        in: path
        required: true
        description: The id of the agency
        schema:
          type: string
        example: '40'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/RoutesForAgencyResponse'
                  required:
                  - data
  /api/where/config.json:
    get:
      tags:
      - default
      summary: config
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/ConfigResponse'
                  required:
                  - data
  /api/where/current-time.json:
    get:
      tags:
      - default
      summary: current-time
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/CurrentTimeResponse'
                  required:
                  - data
  /api/where/stops-for-location.json:
    get:
      tags:
      - default
      summary: stops-for-location
      parameters:
      - name: lat
        in: query
        required: true
        schema:
          type: number
        example: 47.656422
      - name: lon
        in: query
        required: true
        schema:
          type: number
        example: -122.305641
      - name: radius
        in: query
        required: false
        description: The radius in meters to search within
        schema:
          type: number
        example: 1000
      - name: latSpan
        in: query
        required: false
        description: An alternative to radius to set the search bounding box (optional)
        schema:
          type: number
        example: 0.01
      - name: lonSpan
        in: query
        required: false
        description: An alternative to radius to set the search bounding box (optional)
        schema:
          type: number
        example: 0.01
      - name: query
        in: query
        required: false
        description: A search query string to filter the results
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/StopsForLocationResponse'
                  required:
                  - data
  /api/where/arrival-and-departure-for-stop/{stopID}.json:
    get:
      tags:
      - default
      summary: arrival-and-departure-for-stop
      parameters:
      - name: stopID
        in: path
        required: true
        schema:
          type: string
        example: '1_75403'
      - name: tripId
        in: query
        required: true
        schema:
          type: string
        example: '1_604670535'
      - name: serviceDate
        in: query
        required: true
        schema:
          type: integer
        example: 1710918000000
      - name: vehicleId
        in: query
        schema:
          type: string
        example: '1_6936'
      - name: stopSequence
        in: query
        schema:
          type: integer
        example: 39
      - name: time
        in: query
        schema:
          type: integer
        example: 1710979086000
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/ArrivalDepartureForStopResponse'
                  required:
                  - data
  /api/where/arrivals-and-departures-for-stop/{stopID}.json:
    get:
      tags:
      - default
      summary: arrivals-and-departures-for-stop
      parameters:
      - name: stopID
        in: path
        required: true
        schema:
          type: string
        example: '1_75403'
      - name: minutesBefore
        in: query
        required: false
        schema:
          type: integer
          default: 5
        description: Include vehicles having arrived or departed in the previous n minutes.
      - name: minutesAfter
        in: query
        required: false
        schema:
          type: integer
          default: 35
        description: Include vehicles arriving or departing in the next n minutes.
      - name: time
        in: query
        required: false
        schema:
          type: string
          format: date-time
        description: The specific time for querying the system status.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/ArrivalsDeparturesForStopResponse'
                  required:
                  - data
  /api/where/arrivals-and-departures-for-location.json:
    get:
      tags:
      - default
      summary: arrivals-and-departures-for-location
      description: Returns real-time arrival and departure data for stops within a bounding box or radius centered on a specific location.
      operationId: getArrivalsAndDeparturesForLocation
      parameters:
      - name: lat
        in: query
        required: true
        description: The latitude coordinate of the search center.
        schema:
          type: number
          format: double
      - name: lon
        in: query
        required: true
        description: The longitude coordinate of the search center.
        schema:
          type: number
          format: double
      - name: radius
        in: query
        required: false
        description: The search radius in meters.
        schema:
          type: number
          format: double
      - name: latSpan
        in: query
        required: false
        description: Sets the latitude limits of the search bounding box.
        schema:
          type: number
          format: double
      - name: lonSpan
        in: query
        required: false
        description: Sets the longitude limits of the search bounding box.
        schema:
          type: number
          format: double
      - name: time
        in: query
        required: false
        description: By default, returns the status right now. Can be queried at a specific time (milliseconds since epoch) for testing.
        schema:
          type: integer
          format: int64
      - name: minutesBefore
        in: query
        required: false
        description: Include arrivals and departures this many minutes before the query time.
        schema:
          type: integer
          default: 5
      - name: minutesAfter
        in: query
        required: false
        description: Include arrivals and departures this many minutes after the query time.
        schema:
          type: integer
          default: 35
      - name: maxCount
        in: query
        required: false
        description: The max size of the list of nearby stops and arrivals to return. Defaults to 250, max 1000.
        schema:
          type: integer
          default: 250
          maximum: 1000
      - name: routeType
        in: query
        required: false
        description: Optional list of GTFS routeTypes to filter by (comma delimited) e.g. "1,2,3".
        schema:
          type: string
      - name: emptyReturnsNotFound
        in: query
        required: false
        description: If true, returns a 404 Not Found error instead of an empty result.
        schema:
          type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/ArrivalsDeparturesForLocationResponse'
                  required:
                  - data
  /api/where/trips-for-route/{routeID}.json:
    get:
      tags:
      - default
      summary: Search for active trips for a specific route.
      parameters:
      - name: routeID
        in: path
        required: true
        description: The ID of the route.
        schema:
          type: string
      - name: includeStatus
        in: query
        required: false
        description: Determine whether full tripStatus elements with real-time information are included. Defaults to false.
        schema:
          type: boolean
      - name: includeSchedule
        in: query
        required: false
        description: Determine whether full schedule elements are included. Defaults to false.
        schema:
          type: boolean
      - name: time
        in: query
        required: false
        description: Query the system at a specific time. Useful for testing.
        schema:
          type: integer
          format: int64
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      type: object
                      properties:
                        limitExceeded:
                          type: boolean
                        list:
                          type: array
                          items:
                            $ref: '#/components/schemas/TripDetails'
                        references:
                          $ref: '#/components/schemas/Reference'
                      required:
                      - list
                      - references
                  required:
                  - data
  /api/where/trip-details/{tripID}.json:
    get:
      tags:
      - default
      summary: Retrieve Trip Details
      parameters:
      - in: path
        name: tripID
        required: true
        schema:
          type: string
        description: ID of the trip to retrieve details for.
      - in: query
        name: serviceDate
        required: false
        schema:
          type: integer
          format: int64
        description: Service date for the trip as Unix time in milliseconds (optional).
      - in: query
        name: includeTrip
        required: false
        schema:
          type: boolean
        description: Whether to include the full trip element in the references section (defaults to true).
      - in: query
        name: includeSchedule
        required: false
        schema:
          type: boolean
        description: Whether to include the full schedule element in the tripDetails section (defaults to true).
      - in: query
        name: includeStatus
        required: false
        schema:
          type: boolean
        description: Whether to include the full status element in the tripDetails section (defaults to true).
      - in: query
        name: time
        required: false
        schema:
          type: integer
          format: int64
        description: Time parameter to query the system at a specific time (optional).
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/TripDetailsResponse'
                  required:
                  - data
  /api/where/trip-for-vehicle/{vehicleID}.json:
    get:
      tags:
      - default
      summary: Retrieve trip for a specific vehicle
      parameters:
      - in: path
        name: vehicleID
        required: true
        schema:
          type: string
        description: ID of the vehicle to retrieve trip details for.
      - in: query
        name: time
        schema:
          type: integer
          format: int64
        description: Time parameter to query the system at a specific time (optional).
      - in: query
        name: includeTrip
        schema:
          type: boolean
        description: Determines whether full <trip/> element is included in the <references/> section. Defaults to false.
      - in: query
        name: includeSchedule
        schema:
          type: boolean
        description: Determines whether full <schedule/> element is included in the <tripDetails/> section. Defaults to false.
      - in: query
        name: includeStatus
        schema:
          type: boolean
        description: Determines whether the full <status/> element is included in the <tripDetails/> section. Defaults to true.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ResponseWrapper'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/TripVehicleResponse'
                  required:
                  - data
components:
  schemas:
    TripEntry:
      type: object
      properties:
        frequency:
          type: string
          nullable: true
        schedule:
          $ref: '#/components/schemas/TripSchedule'
        serviceDate:
          type: integer
        situationIds:
          type: array
          items:
            type: string
        status:
          $ref: '#/components/schemas/TripStatus'
        tripId:
          type: string
      required:
      - tripId
    ArrivalDepartureForStopResponse:
      type: object
      properties:
        entry:
          $ref: '#/components/schemas/ArrivalDepartureForStop'
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - entry
      - references
    TripVehicleResponse:
      type: object
      properties:
        entry:
          $ref: '#/components/schemas/TripEntry'
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - entry
      - references
    TimeWindow:
      type: object
      properties:
        from:
          type: integer
          format: int64
          description: Start time of the time window as a Unix timestamp.
        to:
          type: integer
          format: int64
          description: End time of the time window as a Unix timestamp.
      required:
      - from
      - to
    StopTime:
      type: object
      properties:
        arrivalTime:
          type: integer
        departureTime:
          type: integer
        distanceAlongTrip:
          type: number
        historicalOccupancy:
          type: string
        stopHeadsign:
          type: string
        stopId:
          type: string
    ResponseWrapper:
      type: object
      properties:
        code:
          type: integer
        currentTime:
          type: integer
        text:
          type: string
        version:
          type: integer
      required:
      - code
      - currentTime
      - text
      - version
    Reference:
      type: object
      properties:
        agencies:
          type: array
          items:
            $ref: '#/components/schemas/Agency'
        routes:
          type: array
          items:
            $ref: '#/components/schemas/Route'
        situations:
          type: array
          items:
            $ref: '#/components/schemas/Situation'
        stopTimes:
          type: array
          items:
            $ref: '#/components/schemas/StopTime'
        stops:
          type: array
          items:
            $ref: '#/components/schemas/Stop'
        trips:
          type: array
          items:
            $ref: '#/components/schemas/Trip'
      required:
      - agencies
      - routes
      - situations
      - stopTimes
      - stops
      - trips
    ConfigResponse:
      type: object
      properties:
        entry:
          $ref: '#/components/schemas/Config'
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - entry
      - references
    CurrentTime:
      type: object
      properties:
        readableTime:
          type: string
        time:
          type: integer
    DetailedScheduleStopTime:
      type: object
      properties:
        arrivalEnabled:
          type: boolean
        arrivalTime:
          type: integer
        departureEnabled:
          type: boolean
        departureTime:
          type: integer
        serviceId:
          type: string
        stopHeadsign:
          type: string
        stopId:
          type: string
        tripId:
          type: string
      required:
      - arrivalEnabled
      - arrivalTime
      - departureEnabled
      - departureTime
      - stopId
      - tripId
    Coverage:
      type: object
      properties:
        agencyId:
          type: string
        lat:
          type: number
        latSpan:
          type: number
        lon:
          type: number
        lonSpan:
          type: number
      required:
      - agencyId
      - lat
      - latSpan
      - lon
      - lonSpan
    Situation:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the situation.
        creationTime:
          type: integer
          format: int64
          description: Unix timestamp of when this situation was created.
        reason:
          type: string
          description: Reason for the service alert, taken from TPEG codes.
        summary:
          type: object
          properties:
            lang:
              type: string
              description: Language of the summary.
            value:
              type: string
              description: Short summary of the situation.
        description:
          type: object
          properties:
            lang:
              type: string
              description: Language of the description.
            value:
              type: string
              description: Longer description of the situation.
        url:
          type: object
          properties:
            lang:
              type: string
              description: Language of the URL.
            value:
              type: string
              description: URL for more information about the situation.
        activeWindows:
          type: array
          items:
            type: object
            properties:
              from:
                type: integer
                format: int64
                description: Start time of the active window as a Unix timestamp.
              to:
                type: integer
                format: int64
                description: End time of the active window as a Unix timestamp.
        allAffects:
          type: array
          items:
            type: object
            properties:
              agencyId:
                type: string
                description: Identifier for the agency.
              applicationId:
                type: string
                description: Identifier for the application.
              directionId:
                type: string
                description: Identifier for the direction.
              routeId:
                type: string
                description: Identifier for the route.
              stopId:
                type: string
                description: Identifier for the stop.
              tripId:
                type: string
                description: Identifier for the trip.
        consequences:
          type: array
          items:
            type: object
            properties:
              condition:
                type: string
                description: Condition of the consequence.
              conditionDetails:
                type: object
                properties:
                  diversionPath:
                    type: object
                    properties:
                      length:
                        type: integer
                        description: Length of the diversion path.
                      levels:
                        type: string
                        description: Levels of the diversion path.
                      points:
                        type: string
                        description: Points of the diversion path.
                  diversionStopIds:
                    type: array
                    items:
                      type: string
                      description: List of stop IDs affected by the diversion.
        publicationWindows:
          type: array
          items:
            $ref: '#/components/schemas/TimeWindow'
        severity:
          type: string
          description: Severity of the situation.
        consequenceMessage:
          type: string
          description: Message regarding the consequence of the situation.
      required:
      - id
      - creationTime
    ScheduleForRouteResponse:
      type: object
      properties:
        entry:
          $ref: '#/components/schemas/ScheduleEntry'
      required:
      - entry
    RoutesForLocationResponse:
      type: object
      properties:
        limitExceeded:
          type: boolean
        list:
          type: array
          items:
            $ref: '#/components/schemas/Route'
        outOfRange:
          type: boolean
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - list
      - references
      - outOfRange
    Agency:
      type: object
      properties:
        disclaimer:
          type: string
        email:
          type: string
        fareUrl:
          type: string
        id:
          type: string
        lang:
          type: string
        name:
          type: string
        phone:
          type: string
        privateService:
          type: boolean
        timezone:
          type: string
        url:
          type: string
      required:
      - id
      - name
      - timezone
      - url
    ArrivalsDeparturesForStopResponse:
      type: object
      properties:
        entry:
          type: object
          properties:
            arrivalsAndDepartures:
              type: array
              items:
                $ref: '#/components/schemas/ArrivalDepartureForStop'
          required:
          - arrivalsAndDepartures
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - entry
      - references
    StopsForLocationResponse:
      type: object
      properties:
        limitExceeded:
          type: boolean
        outOfRange:
          type: boolean
        list:
          type: array
          items:
            $ref: '#/components/schemas/Stop'
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - list
      - references
    TripWithStopTimes:
      type: object
      properties:
        tripId:
          type: string
        stopTimes:
          type: array
          items:
            $ref: '#/components/schemas/DetailedScheduleStopTime'
      required:
      - tripId
      - stopTimes
    ArrivalsDeparturesForLocationResponse:
      type: object
      properties:
        entry:
          type: object
          properties:
            stopIds:
              type: array
              items:
                type: string
            arrivalsAndDepartures:
              type: array
              items:
                $ref: '#/components/schemas/ArrivalDepartureForStop'
            nearbyStopIds:
              type: array
              items:
                type: object
                properties:
                  stopId:
                    type: string
                  distanceFromQuery:
                    type: number
                    format: double
            situationIds:
              type: array
              items:
                type: string
            limitExceeded:
              type: boolean
          required:
          - stopIds
          - arrivalsAndDepartures
          - nearbyStopIds
          - limitExceeded
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - entry
      - references
    Trip:
      type: object
      properties:
        blockId:
          type: string
        directionId:
          type: string
        id:
          type: string
        peakOffpeak:
          type: integer
        routeId:
          type: string
        routeShortName:
          type: string
        serviceId:
          type: string
        shapeId:
          type: string
        timeZone:
          type: string
        tripHeadsign:
          type: string
        tripShortName:
          type: string
      required:
      - id
      - routeId
      - serviceId
    CurrentTimeResponse:
      type: object
      properties:
        entry:
          $ref: '#/components/schemas/CurrentTime'
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - entry
      - references
    TripDetailsResponse:
      type: object
      properties:
        entry:
          $ref: '#/components/schemas/TripEntry'
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - entry
      - references
    CoverageResponse:
      type: object
      properties:
        limitExceeded:
          type: boolean
        list:
          type: array
          items:
            $ref: '#/components/schemas/Coverage'
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - list
      - references
    RoutesForAgencyResponse:
      type: object
      properties:
        limitExceeded:
          type: boolean
        list:
          type: array
          items:
            $ref: '#/components/schemas/Route'
        references:
          $ref: '#/components/schemas/Reference'
      required:
      - list
      - references
    Stop:
      type: object
      properties:
        code:
          type: string
        direction:
          type: string
        id:
          type: string
        lat:
          type: number
        locationType:
          type: integer
        lon:
          type: number
        name:
          type: string
        parent:
          type: string
        routeIds:
          type: array
          items:
            type: string
        staticRouteIds:
          type: array
          items:
            type: string
        wheelchairBoarding:
          type: string
      required:
      - id
      - lat
      - lon
      - name
      - parent
      - routeIds
      - staticRouteIds
      - locationType
    ArrivalDepartureForStop:
      type: object
      properties:
        actualTrack:
          type: string
          description: The actual track information of the arriving transit vehicle.
        arrivalEnabled:
          type: boolean
          description: Indicates if riders can arrive on this transit vehicle.
        blockTripSequence:
          type: integer
          description: Index of this arrival’s trip into the sequence of trips for the active block.
        departureEnabled:
          type: boolean
          description: Indicates if riders can depart from this transit vehicle.
        distanceFromStop:
          type: number
          description: Distance of the arriving transit vehicle from the stop, in meters.
        frequency:
          type: string
          nullable: true
          description: Information about frequency-based scheduling, if applicable to the trip.
        historicalOccupancy:
          type: string
          description: Historical occupancy information of the transit vehicle.
        lastUpdateTime:
          type: integer
          description: Timestamp of the last update time for this arrival.
        numberOfStopsAway:
          type: integer
          description: Number of stops between the arriving transit vehicle and the 

# --- truncated at 32 KB (44 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/onebusaway/refs/heads/main/openapi/onebusaway-default-api-openapi.yml