Chicago's Transit Authority recently released a couple webapps that allow people to track bus locations and routes. It is awesome. This is the documentation of the API they have exposed to power their apps.
This documentation is NOT affiliated with CTA, Chicago or anything else official.
I have created a proxy for this API. It caches requests, and should be a LOT faster than accessing the API directly. The proxy is: http://chicago.transitapi.com.
PLEASE USE THE PROXY TO ACCESS THIS API IN YOUR APPLICATIONS.
To use the proxy, you will just need to replace ctabustracker.com with chicago.transitapi.com in the urls for your requests.
I will be adding various other API helper endpoints to chicago.transitapi.com. stay tuned.
If you have questions, fixes or additions - email harper@nata2.org. If you are bored, check out my blog.
Subscribe to the mailing list to stay up to date: http://groups.google.com/group/transitapi
List of endpoints
General Notes: key is passed to all the endpoints - however it will work without the key.
getRoutePoints
Description: Returns latitude/longitude, stop IDs, and stop names for bus stops along a particular route.
Proxy Endpoint: http://chicago.transitapi.com/bustime/map/getRoutePoints.jsp
Original Endpoint: http://ctabustracker.com/bustime/map/getRoutePoints.jsp
Required: Route
Example Request: http://chicago.transitapi.com/bustime/map/getRoutePoints.jsp?route=49
Result Set:
- route
- id
- shortName
- name
- description
- serviceBulletins
- color
- patterns
- pattern (pattern element returned for each trip direction)
- id
- length
- direction
- point
- latitude
- longitude
- busStop
- id
- stopName
- pattern (pattern element returned for each trip direction)
getPatternPoints
Description:
Proxy Endpoint: http://chicago.transitapi.com/bustime/map/getPatternPoints.jsp
Original Endpoint: http://ctabustracker.com/bustime/map/getPatternPoints.jsp
Required: pattern, route
Example Request: http://chicago.transitapi.com/bustime/map/getPatternPoints.jsp?route=20&pattern=959
Notes:
Result Set:
- route
- id
- shortName
- name
- description
- paterns
getStopPredictions
Description: Gets stop predictions. Timing and whatnot.
Proxy Endpoint: http://chicago.transitapi.com/bustime/map/getStopPredictions.jsp
Original Endpoint: http://ctabustracker.com/bustime/map/getStopPredictions.jsp
Required: stop, route
Example Request: http://chicago.transitapi.com/bustime/map/getStopPredictions.jsp?stop=8207&route=49
Notes: route can be stacked. ie: route=50-92. which would give you stop predictions for stops that have both foster and damen.
Result Set:
- stop
- id
- stopName
- stopRouteInfo
- route
- direction
- serviceBulletins
- colorRoute
- prediction
- predictionTime
- finalDestination
- vehicle
- routeName
getBusPredictions
Description: Returns arrival predictions for a particular bus.
Proxy Endpoint: http://chicago.transitapi.com/bustime/map/getBusPredictions.jsp
Orginal Endpoint: http://ctabustracker.com/bustime/map/getBusPredictions.jsp
Required: bus
Example Request: http://chicago.transitapi.com/bustime/map/getBusPredictions.jsp?bus=6654
Notes:
Result Set:
- bus
- prediction
- predictionTime
- stop
- prediction
getBusesForRoute
Description: Gets buses for specific route
Proxy Endpoint: http://chicago.transitapi.com/bustime/map/getBusesForRoute.jsp
Original Endpoint: http://ctabustracker.com/bustime/map/getBusesForRoute.jsp
Required: route
Example Request: http://chicago.transitapi.com/bustime/map/getBusesForRoute.jsp?route=49
Notes:
Result Set:
- buses
- bus
- id (the bus number)
- route (returns "OR" if bus is off-route)
- status
- revenue (true or false)
- offRoute (true or false)
- direction (direction the bus is currently facing)
- latitude
- longitude
- pattern
- patternDirection (overall direction of travel on route)
- run
- finalStop
- operator
- distanceIntoPattern
- bus
getBusesForRouteAll
Description: Gets information about every bus in the system.
Proxy Endpoint: http://chicago.transitapi.com/bustime/map/getBusesForRouteAll.jsp
Original Endpoint: http://ctabustracker.com/bustime/map/getBusesForRouteAll.jsp
Required:
Example Request: http://chicago.transitapi.com/bustime/map/getBusesForRouteAll.jsp
Notes:
Result Set:
- buses
- bus
- id (the bus number)
- route (returns "OR" if bus is off-route)
- color
- revenue (true or false)
- direction (direction the bus is currently facing)
- latitude
- longitude
- pattern
- patternDirection (overall direction of travel on route)
- run
- finalStop
- operator
- bus
Schedule
Description: Download the Schedule
Proxy Endpoint: http://chicago.transitapi.com/bustime/map/schedules.jsp
Original Endpoint: http://ctabustracker.com/bustime/map/schedules.jsp
Required: agency, route
Example Request: http://chicago.transitapi.com/bustime/map/schedules.jsp?agency=1&route=92
Notes: agency must be set to 1
getTimeAndTemp
Description: Outputs the current time and temp
Proxy Endpoint: http://chicago.transitapi.com/bustime/map/getTimeAndTemp.jsp
Original Endpoint: http://ctabustracker.com/bustime/map/getTimeAndTemp.jsp
Required:
Example Request:http://chicago.transitapi.com/bustime/map/getTimeAndTemp.jsp
Notes: Obviously this is chicago time
Result Set:
- timeAndTemperature
- time
- temperature
NEW ENDPOINTS
These endpoints are created by me. Most of them will be a mash of various endpoints to create a new compelling endpoint. Let me know if you have any ideas?
Community Upoc alerts
Description: Outputs the last alert sent from the UPOC group
Proxy Endpoint: http://chicago.transitapi.com/api/alerts/upoc/latest/
Required:
Example Request:http://chicago.transitapi.com/api/alerts/upoc/latest/
Notes: JSON response of the last alert - including the time and the user who sent the alert.
Result Set:
- body
- date
- sender
routeDirectionStopAsXML
Description: Outputs the Direction that routes go and the stops of that route
Proxy Endpoint: http://chicago.transitapi.com/bustime/eta/routeDirectionStopAsXML.jsp
Required: route, direction is optional
Example Request:http://chicago.transitapi.com/bustime/eta/routeDirectionStopAsXML.jsp
Example Request:http://chicago.transitapi.com/bustime/eta/routeDirectionStopAsXML.jsp?route=147
Example Request:http://chicago.transitapi.com/bustime/eta/routeDirectionStopAsXML.jsp?route=147&direction=north%20bound
Notes: Outputs the direction if you exclude the direction, outputs the stops if you include both
Result Set:
(If you pass all sorts of info)
- route-list
- route
(If you exclude the direction)
- direction-list
- direction
(With both direction and route)
- stop-list
- stop