Hacking Chicago’s Unofficial Transit API

Kevin Farnham, January 27th, 2009

Chicago Transit AuthorityRecently, in our post on the Unofficial Chicago Transit Authority API we reported on this unofficial transit API for the CTA. The API enables developers to build applications that present CTA bus routes, schedules, and arrival predictions. This API is “unofficial” because it is not officially documented by the Chicago Transit Authority, but comes to us by virtue of developer Harper Reed.

Over at Ryan Graves’ site, Daniel X. O’Neil, co-founder of the terrific Everyblock, has written an interesting article describing how the CTA bus tracking mashup was hacked by Harper which lead to the exposure of the underlying API:

Harper Reed … saw every bus, everywhere, forevermore. And he wanted that data. “The power is not the mashup. It’s the data. The data is the answer,” says Harper. So he set out to separate the data from the mashup. He used Firebug, the nifty Firefox add-on, to monitor that network traffic (the communication that goes between the browser window and the server) that was driving the data to the page. This way, he found the URLs of the “endpoints” … that control the entire Bus Tracker system.

Daniel’s post describes in detail the reverse-engineering process Harper applied to derive the API from the CTA Bus Tracker web site. And besides the uncovering the existing endpoints and documenting them, Harper created some enhanced services and tools on top of the core service like caching and developing Bus Tracker widgets.

Harper set up a system for making regular queries to Bus Tracker and caching (storing) the results in a separate, stand-alone database over on a server that goes by the name of http://chicago.transitapi.com. This allows other developers to have a reliable database to ask questions of (see above) without having to ask the CTA all the time, and perhaps tax their servers or otherwise bother them. Like having a record of every instance of the river, stored forever.

The Chicago Bus Tracker Widget uses the Chicago Transit API to do cool things with this data. See also Chicago’s CTA Bus Tracker for iPhone and iPod Touch. I’d like to see more apps that use some of the more obscure data in the API. A “which bus should I take” app would be cool — just click to show where I am on a map and all the nearby bus stops with arriving buses (hat tip: Paul Smith).

Chicago Transit Authority Bus Tracker

For additional information on the API Harper ultimately derived, see our Chicago Transit Authority API profile and Harper’s CTA Bus Tracker Mashup for more.

Both comments and pings are currently closed.

3 Responses to “Hacking Chicago’s Unofficial Transit API”

January 27th, 2009
at 10:01 am
Comment by: links for 2009-01-27 « Brent Sordyl’s Blog

[...] Hacking Chicago’s Unofficial Transit API Harper Reed … saw every bus, everywhere, forevermore. And he wanted that data. “The power is not the mashup. It’s the data. The data is the answer,” says Harper. So he set out to separate the data from the mashup. He used Firebug, the nifty Firefox add-on, to monitor that network traffic (the communication that goes between the browser window and the server) that was driving the data to the page. This way, he found the URLs of the “endpoints” … that control the entire Bus Tracker system. (tags: api chicago transit) [...]

January 27th, 2009
at 10:24 am
Comment by: Ryan Graves

Thanks for the link, it truly was a great post from Daniel. Phenomenal how he explained the technical process so smoothly.

July 24th, 2009
at 12:11 am
Comment by: 4 Hip Transit Authorities With APIs

[...] This API is not an official from the Chicago Transit Authority (our CTA API profile). It is, however, data from the CTA. Harper Reed reverse engineered a CTA mashup. [...]

Follow the PW team on Twitter

ProgrammableWeb
APIs, mashups and code. Because the world's your programmable oyster.

John Musser
Founder, ProgrammableWeb

Adam DuVander
Executive Editor, ProgrammableWeb. Author, Map Scripting 101. Lover, APIs.