Day: September 9, 2007

  • Accidental APIs: NFL edition

    NFL flash app powered by JSON

    These days whenever I find an interesting interactive/updating flash app I tend to fire up Firebug and see where the data is coming from. Quite often there’s an XML data feed somewhere that the flash app is being fed with. For example, you can get an XML feed of parking space availability or a list of airlines with gate information at Kansas City International Airport. As with many XML feeds designed for consumption with Flash, these feeds aren’t always well-formed but the data is there for the taking.

    I went on a similar quest after checking in on my Redskins at NFL.com. I was pleasantly suprised to find JSON driving the live game update instead of XML. There are three JSON feeds exposed on the live game update page.

    The first is the game-specific updates. This feed includes a score breakdown by quarter, who has possesion, time left, and the last few recent plays, along with a few other things that weren’t obvious at first glance.

    The second drives the league-wide scoreboard at the top of the page. This includes game date/time, the teams involved, what quarter they’re in, who has the ball, and what the score is. From time to time this feed will also include extra information such as a recent score change.

    The third feed includes information about weekly leaders in the NFL. This includes the top five passing, rushing, receiving, and scoring players this week. That sounds like great information to have programmatic access to if you’re in to fantasy football.

    It makes me happy to see big companies use XML and JSON feeds for their flash apps rather than a proprietary alternative. It’s also fun to see things like Prototype and Sciptaculous on a site like NFL.com. These feeds are rarely documented, but for the large part are self-documenting. Some of the subtitles in teh NFL feeds can most likely be determined by watching the feed and the flash display over time.