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 element is included in the section. Defaults to false. - in: query name: includeSchedule schema: type: boolean description: Determines whether full element is included in the section. Defaults to false. - in: query name: includeStatus schema: type: boolean description: Determines whether the full element is included in the 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 current stop (excluding the current stop). occupancyStatus: type: string description: Current occupancy status of the transit vehicle. predicted: type: boolean description: Indicates if real-time arrival info is available for this trip. predictedArrivalInterval: type: string nullable: true description: Interval for predicted arrival time, if available. predictedArrivalTime: type: integer description: Predicted arrival time, in milliseconds since Unix epoch (zero if no real-time available). predictedDepartureInterval: type: string nullable: true description: Interval for predicted departure time, if available. predictedDepartureTime: type: integer description: Predicted departure time, in milliseconds since Unix epoch (zero if no real-time available). predictedOccupancy: type: string description: Predicted occupancy status of the transit vehicle. routeId: type: string description: The ID of the route for the arriving vehicle. routeLongName: type: string description: Optional route long name that potentially overrides the route long name in the referenced route element. routeShortName: type: string description: Optional route short name that potentially overrides the route short name in the referenced route element. scheduledArrivalInterval: type: string nullable: true description: Interval for scheduled arrival time. scheduledArrivalTime: type: integer description: Scheduled arrival time, in milliseconds since Unix epoch. scheduledDepartureInterval: type: string nullable: true description: Interval for scheduled departure time. scheduledDepartureTime: type: integer description: Scheduled departure time, in milliseconds since Unix epoch. scheduledTrack: type: string description: Scheduled track information of the arriving transit vehicle. serviceDate: type: integer description: Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. situationIds: type: array items: type: string description: References to situation elements (if any) applicable to this arrival. status: type: string description: Current status of the arrival. stopId: type: string description: The ID of the stop the vehicle is arriving at. stopSequence: type: integer description: Index of the stop into the sequence of stops that make up the trip for this arrival. totalStopsInTrip: type: integer description: Total number of stops visited on the trip for this arrival. tripHeadsign: type: string description: Optional trip headsign that potentially overrides the trip headsign in the referenced trip element. tripId: type: string description: The ID of the trip for the arriving vehicle. tripStatus: $ref: '#/components/schemas/TripStatus' vehicleId: type: string description: ID of the transit vehicle serving this trip. required: - stopId - tripId - serviceDate - routeId - scheduledArrivalTime - scheduledDepartureTime - predictedArrivalTime - predictedDepartureTime - stopSequence - totalStopsInTrip - tripHeadsign - vehicleId - blockTripSequence - arrivalEnabled - departureEnabled - numberOfStopsAway TripSchedule: type: object nullable: true properties: frequency: type: string nullable: true nextTripId: type: string previousTripId: type: string stopTimes: type: array items: $ref: '#/components/schemas/StopTime' timeZone: type: string required: - stopTimes - timeZone - nextTripId - previousTripId Config: type: object properties: gitProperties: type: object properties: git.branch: type: string git.build.host: type: string git.build.time: type: string git.build.user.email: type: string git.build.user.name: type: string git.build.version: type: string git.closest.tag.commit.count: type: string git.closest.tag.name: type: string git.commit.id: type: string git.commit.id.abbrev: type: string git.commit.id.describe: type: string git.commit.id.describe-short: type: string git.commit.message.full: type: string git.commit.message.short: type: string git.commit.time: type: string git.commit.user.email: type: string git.commit.user.name: type: string git.dirty: type: string git.remote.origin.url: type: string git.tags: type: string id: type: string name: type: string serviceDateFrom: type: string serviceDateTo: type: string ScheduleEntry: type: object properties: routeId: type: string scheduleDate: type: integer serviceIds: type: array items: type: string stopTripGroupings: type: array items: $ref: '#/components/schemas/StopTripGrouping' required: - routeId - scheduleDate - serviceIds - stopTripGroupings StopTripGrouping: type: object properties: directionId: type: string stopIds: type: array items: type: string tripHeadsigns: type: array items: type: string tripIds: type: array items: type: string tripsWithStopTimes: type: array items: $ref: '#/components/schemas/TripWithStopTimes' required: - directionId - stopIds - tripHeadsigns - tripIds Route: type: object properties: agencyId: type: string color: type: string description: type: string id: type: string longName: type: string nullSafeShortName: type: string shortName: type: string textColor: type: string type: type: integer url: type: string required: - id - type - agencyId TripStatus: type: object description: Trip-specific status for the arriving transit vehicle. properties: activeTripId: type: string description: Trip ID of the trip the vehicle is actively serving. blockTripSequence: type: integer description: Index of the active trip into the sequence of trips for the active block. closestStop: type: string description: ID of the closest stop to the current location of the transit vehicle. closestStopTimeOffset: type: integer description: Time offset from the closest stop to the current position of the transit vehicle (in seconds). distanceAlongTrip: type: number description: Distance, in meters, the transit vehicle has progressed along the active trip. frequency: type: string nullable: true description: Information about frequency-based scheduling, if applicable to the trip. lastKnownDistanceAlongTrip: type: number description: Last known distance along the trip received in real-time from the transit vehicle. lastKnownLocation: type: object nullable: true properties: lat: type: number description: Latitude of the last known location of the transit vehicle. lon: type: number description: Longitude of the last known location of the transit vehicle. description: Last known location of the transit vehicle (optional). lastKnownOrientation: type: number description: Last known orientation value received in real-time from the transit vehicle. lastLocationUpdateTime: type: integer description: Timestamp of the last known real-time location update from the transit vehicle. lastUpdateTime: type: integer description: Timestamp of the last known real-time update from the transit vehicle. nextStop: type: string description: ID of the next stop the transit vehicle is scheduled to arrive at. nextStopTimeOffset: type: integer description: Time offset from the next stop to the current position of the transit vehicle (in seconds). occupancyCapacity: type: integer description: Capacity of the transit vehicle in terms of occupancy. occupancyCount: type: integer description: Current count of occupants in the transit vehicle. occupancyStatus: type: string description: Current occupancy status of the transit vehicle. orientation: type: number description: Orientation of the transit vehicle, represented as an angle in degrees. phase: type: string description: Current journey phase of the trip. position: type: object properties: lat: type: number description: Latitude of the current position of the transit vehicle. lon: type: number description: Longitude of the current position of the transit vehicle. description: Current position of the transit vehicle. predicted: type: boolean description: Indicates if real-time arrival info is available for this trip. scheduleDeviation: type: integer description: Deviation from the schedule in seconds (positive for late, negative for early). scheduledDistanceAlongTrip: type: number description: Distance, in meters, the transit vehicle is scheduled to have progressed along the active trip. serviceDate: type: integer description: Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. situationIds: type: array items: type: string description: References to situation elements (if any) applicable to this trip. status: type: string description: Current status modifiers for the trip. totalDistanceAlongTrip: type: number description: Total length of the trip, in meters. vehicleId: type: string description: ID of the transit vehicle currently serving the trip. required: - activeTripId - blockTripSequence - closestStop - distanceAlongTrip - lastKnownDistanceAlongTrip - lastLocationUpdateTime - lastUpdateTime - occupancyCapacity - occupancyCount - occupancyStatus - phase - predicted - scheduleDeviation - serviceDate - status - totalDistanceAlongTrip TripDetails: type: object properties: frequency: type: string nullable: true serviceDate: type: integer format: int64 situationIds: type: array items: type: string tripId: type: string schedule: $ref: '#/components/schemas/TripSchedule' status: $ref: '#/components/schemas/TripStatus' required: - tripId - schedule - status responses: NotFound: description: Resource not found. content: application/json: schema: $ref: '#/components/schemas/ResponseWrapper' example: code: 404 currentTime: 1723054063108 text: resource not found version: 2 securitySchemes: ApiKeyAuth: type: apiKey in: query name: key