Amarok & NPR :: 13 Years of News Media Now Available at Your Fingertips
05 November 2008
Earlier this summer I had noticed that National Public Radio (NPR) launched a brand new open API based on open source technologies. My initial reaction was at best skeptical. I assumed any sort of “API” released by a major media outlet would turn out to be nothing more than a few customizable RSS feeds. If the company was particularly progressive the RSS feeds might include full articles, rather than the neutered one-sentence teasers you find in all the big name’s syndicated content.
I couldn’t have been more mistaken. NPR’s API is no small potatoes. Just take a look at the comprehensive Query Generator to get an inkling of the types of complex queries you can create. Looking at the Query Generator also sheds some light on the content you can retrieve using the API. The API’s main page says the API exposes the entire NPR archive of content starting from the launch of the NPR website in 1995. Just how big is this archive? Over 250,000 stories including text, images, video, and audio!
This quote from the article announcing the API caught my eye immediately:
There were quite a few questions that we addressed when developing the API, but one thing that was not really in question was the need to open as much of our content as possible. (( NPR API is Live on NPR.org))
This isn’t the first open media API. BBC was the first to offer a public open access API, however BBC’s API is restricted to the content from the past 7-days. Seven days! That’s nothing compared to the (approx.) 4748 days - and counting - that NPR’s API offers. NPR and the BBC are two large companies leading the technological shift towards open and free information.
But that’s only half the story.
After discovering this fantastic API I had to do something with it, and the new service architecture in Amarok 2 provided the perfect platform to build a NPR mashup. That was several months ago, and at the time the scripting API in Amarok was still being flesh out (Thanks to Peter). On Monday I noticed the BBC scriptable service Nikolaj had created for Amarok 2. I happened to have several hours of free time, so I cooked up a similar service for NPR:
You can get it at kde-apps or via the “Get More Scripts” button in Amarok 2’s Script Manager.
There is definitely room for improvement and in fact here are a few things I plan to do with it:
- Display more than 20 stories under a category
- Sort content by date
- Support searching
- Display the full articles, with images, in the context view
Major props and thanks go out to the entire NPR technical team and all the contributors who made API a reality.