This endpoint lets you get data about bus routes, schedules, stops, locations, and predicted arrival times. The data is provided by NextBus, which monitors buses and gives the data to us via their API. We think our API is easier to use, but our data might be behind NextBus by a few seconds. If your app requires to-the-second bus location info, you can go right to the source.
All bus data is copyright University of Maryland 2015.
List all the bus routes. Returns the route ids and the names of the routes.
Returns: Array of the bus routes as JSON Objects with ‘route_id’ and ‘title’ fields.
The route object
The route object represents a bus route. The properties of a route are:
route_id – a unique three digit route number. Examples: “115”, “701”.
title – string name of the route. Examples: “115 Orange”, “701 UMB BioPark”
stops – Array of bus stops on a route. Stops have a unique string stop_id, a full title, and lon (longitude) and lat (latitude) coordinates. Routes have a lot of stops, so this might look a little messy.
directions – Array of directions the bus travels. A direction has a unique string direction_id, a title, and an array of stops specifying the stops along the route in that direction. Many buses only have one direction, ‘loop’ , which has all stops on the route. Otherwise, there are usually two directions, mostly named for the final stop in that direction.
paths – When you want to draw the route on the map, you use the paths. These are several arrays (an array of arrays) of latitude and longitude coordinates (points). According to NextBus, connect the points in array separately, and you will end up with a nice outline of the route. Don’t try to connect the points between the arrays of points, because they won’t match up. There are a lot of points (a few hundred) for each route.
The next four are useful if you are trying to fit the route in a map window.
lat_max – Maximum latitude of the bus route.
lat_min – Minimum latitude of the bus route.
lon_max – Maximum longitude of the bus route.
lon_min – Minimum longitude of the bus route.
Sample route object
(trimmed for space - there are more stops and path data)
Returns: Specified route objects, where route_ids is a comma-separated list of route_ids, like 115,118,701.
The stop object represents a bus stop.
stop_id – unique string identifier for a stop, like ‘laplat’. NextBus came up with these names, and most of the time, you can decipher what stop they mean. ‘laplat’ is the Laplata Hall stop. ‘guilrowa_out’ is Guilford Drive and Rowalt Drive (Outbound).
Returns: Predicted arrivals for a stop on the route.
Get route schedules
Get the schedules for a route.
Each route has multiple schedules, because buses run differently on different days of the week. umdio can’t guarantee that the buses will arrive at the scheduled times, but we’ll try to get the schedules to you.
Returns: Array of bus schedules for the specified route.
Each schedule has the days that schedule runs - ‘f’ for friday, ‘th’ for tuesday and thursday. Also, the direction of the route, route number, an array of the stops on the schedule, and an array of trips. The stops on the schedule are not all of the stops on the route, just the ones that are scheduled. The trips are each arrays of stops and the times the bus is scheduled to stop, in two formats: arrival_time, which is the ISO 8601 extended time format - hh:mm:ss - and a count of UNIX seconds since the beginning of the day - a number like 21600000, for 6:00 AM. All times are EST, since that’s local.