trip-for-vehicle Method
Get extended trip details for a specific transit vehicle. That is, given a vehicle id for a transit vehicle currently operating in the field, return extended trips details about the current trip for the vehicle.
Example Request
https://api.pugetsound.onebusaway.org/api/where/trip-for-vehicle/1_4531.json?key=TEST
Example Response
{"code":200,"currentTime":1710978537103,"data":{"entry":{"frequency":null,"serviceDate":1710918000000,"situationIds":[],"status":{"activeTripId":"1_562510085","blockTripSequence":10,"closestStop":"1_29236","closestStopTimeOffset":-3,"distanceAlongTrip":5906.7955564843,"frequency":null,"lastKnownDistanceAlongTrip":0,"lastKnownLocation":{"lat":47.66135025024414,"lon":-122.32627868652344},"lastKnownOrientation":0,"lastLocationUpdateTime":1710978488000,"lastUpdateTime":1710978488000,"nextStop":"1_29865","nextStopTimeOffset":190,"occupancyCapacity":0,"occupancyCount":0,"occupancyStatus":"","orientation":0.0,"phase":"in_progress","position":{"lat":47.661346,"lon":-122.32620387298789},"predicted":true,"scheduleDeviation":-81,"scheduledDistanceAlongTrip":5906.7955564843,"serviceDate":1710918000000,"situationIds":[],"status":"SCHEDULED","totalDistanceAlongTrip":8462.521770450538,"vehicleId":"1_4531"},"tripId":"1_562510085"},"references":{"agencies":[{"disclaimer":"","email":"","fareUrl":"https://kingcounty.gov/en/dept/metro/fares-and-payment/prices","id":"1","lang":"EN","name":"Metro Transit","phone":"206-553-3000","privateService":false,"timezone":"America/Los_Angeles","url":"https://kingcounty.gov/en/dept/metro"},{"disclaimer":"","email":"main@soundtransit.org","fareUrl":"https://www.soundtransit.org/ride-with-us/how-to-pay/fares","id":"40","lang":"en","name":"Sound Transit","phone":"1-888-889-6368","privateService":false,"timezone":"America/Los_Angeles","url":"https://www.soundtransit.org"}],"routes":[{"agencyId":"1","color":"","description":"Ballard - Montlake","id":"1_100224","longName":"","nullSafeShortName":"44","shortName":"44","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/044.html"},{"agencyId":"1","color":"","description":"Lake City - Northgate - University District","id":"1_102730","longName":"","nullSafeShortName":"20","shortName":"20","textColor":"","type":3,"url":"https://kingcounty.gov/en/dept/metro/routes-and-service/schedules-and-maps/020.html"},{"agencyId":"40","color":"2b376e","description":"","id":"40_586","longName":"Tacoma - U. District","nullSafeShortName":"586","shortName":"586","textColor":"ffffff","type":3,"url":"https://www.soundtransit.org/586"}],"situations":[],"stopTimes":[],"stops":[{"code":"29236","direction":"E","id":"1_29236","lat":47.661278,"locationType":0,"lon":-122.326347,"name":"NE 45th St & Thackeray Pl NE","parent":"","routeIds":["1_100224"],"staticRouteIds":["1_100224"],"wheelchairBoarding":"ACCESSIBLE"},{"code":"29865","direction":"E","id":"1_29865","lat":47.661236,"locationType":0,"lon":-122.317291,"name":"NE 45th St & Roosevelt Way NE","parent":"","routeIds":["1_102730","1_100224","40_586"],"staticRouteIds":["1_102730","1_100224","40_586"],"wheelchairBoarding":"ACCESSIBLE"}],"trips":[{"blockId":"1_7085271","directionId":"1","id":"1_562510085","peakOffpeak":0,"routeId":"1_100224","routeShortName":"","serviceId":"1_45626","shapeId":"1_20044006","timeZone":"","tripHeadsign":"University Of Washington Medical Center Wallingford","tripShortName":""}]}},"text":"OK","version":2}
Request Parameters
id
- the id of the vehicle, encoded directly in the URL:http://api.pugetsound.onebusaway.org/api/where/trip-for-vehicle/[ID GOES HERE].xml
includeTrip
- Can be true/false to determine whether full<trip/>
element is included in the<references/>
section. Defaults to false.includeSchedule
- Can be true/false to determine whether full<schedule/>
element is included in the<tripDetails/>
section. Defaults to fale.includeStatus
- Can be true/false to determine whether the full<status/>
element is include in the<tripDetails/>
section. Defaults to true.time
- by default, the method returns the status of the system right now. However, the system can also be queried at a specific time. This can be useful for testing. See timestamps for details on the format of thetime
parameter.
Response
The respone <entry/>
element is a <tripDetails/>
element that captures extended details about a trip.