I Want My MTV API! λ
Just a few weeks back, I was in the middle of a rather spirited discussion about MTV and its fall from grace over the years.
“In the early days, it was all about the music”, I had reminisced (never mind the fact that it would be another 6 years until I was born when MTV first launched in 1981).
Over the decades, though, the old girl’s lost her edge. Now if you tune into channel 29 (around here, anyway), just pray you don’t stumble across any of MTV’s recent reality programming, like “Paris Hilton’s My New BFF”, “Sex … with Mom and Dad”, or shudder “My Super Sweet 16”. Even MTV2, the channel they spun off to get back to their music video roots, has turned into a kind of X Games-themed version of the original, dedicating huge blocks to reruns of “Pimp My Ride” and “Jackass”.
Perhaps realizing this themselves, the good folks over at Viacom recently launched MTV Music, a website that offers untethered access to their entire music video collection. Overall, the site is a polished throwback to the early days of MTV, with all of the focus being put on the videos themselves.
They also released an API, which I’ve been playing with for a couple weeks.
The Rundown
![]() |
| |
|---|---|---|
| Protocols | REST | REST |
| Formats | mRSS, Atom | XML, JSON, RSS |
| API Groups | Artist, Genre, Video | Artist, Category, Image, Rating, Release, Station, Track, Video |
| Dev Key Required? | No | Yes |
| Usage Limit | “Reasonable Usage” (See Terms of Service) |
5,000 reqs / day / App ID |
| Number of Music Videos | 20886 | 47561 |
Just like the MTV Music site itself, its API is all about the music videos. So, unlike other APIs like Last.fm and Yahoo! Music, there’s just enough information about artists and genres to get you to the main attraction: every music video MTV ever aired. Certainly, that’s a compelling reason to check it out, but how does it stack up against Yahoo! Music, which also boasts a huge collection of music videos?
It turns out that Yahoo! Music has more than double the number of videos as MTV Music, which might come as a surprise, considering MTV’s synonymy with music videos. As for the rest of the chart, it’s clear that MTV and Yahoo! are geared for different purposes. So, to get a better idea about what the MTV API is all about, read on for a more detailed overview.
Reading the Fine Print
For developers out there who are interested in building on top of the MTV API, you should carefully read through the Terms of Service. Here are two parts that are potentially deal-breakers:
3.(f) MTVN API Usage Quotas. MTVN may, in its sole discretion, restrict your use of the MTVN APIs at any time for any reason, including, without limitation, establishing quotas on the number of daily calls you may make from Your Website(s) to the MTVN APIs. Without limiting the generality of the foregoing, you may not use the MTVN APIs in any manner that exceeds reasonable request volume, constitutes excessive or abusive usage, or otherwise fails to comply or is inconsistent with the Specifications, all as determined by MTVN in its sole discretion. You shall not attempt to aggregate use of the MTVN APIs or representation of multiple MTVN API IDs, if applicable, for the purpose of circumventing any such usage quotas.
Usage quotas were an especially sore point for me in developing my Ruby library around the API (oh yes, there’s code at the end…funny how that seems to be the trend lately). While soft rate limits might sound good at first, a lack of agreed-upon rules up-front can lead to major awkwardness later. From my experience, MTV won’t get mad if you keep it below 1 request / second.
3. (c) Personal Use Only. Your access to and use of the MTVN APIs and MTVN API Content are limited for personal, non-commercial use only, which may include, without limitation, (i) use of the MTVN APIs to display MTVN API Content on Your Website(s) to the extent the same does not recreate or duplicate a material portion of any end user experience provided via any web sites or online programming service owned or controlled by MTVN or its affiliates and (ii) the sale or distribution of any device that provides access to or use of Your Website(s). You may not derive income from the use or provision of the MTVN APIs and/or MTVN API Content, whether for direct commercial or monetary gain or otherwise including, without limitation, income derived from the sale or access to the MTVN API Content or any advertising, sponsorships, promotions or any other content displayed, served or otherwise made available within or adjacent to the display of MTVN API Content via Your Website(s).
Limiting use to personal and non-commercial purposes means that you can’t do much beyond embedding videos on your blog—at least that’s my take. Even blogging might be going too far for the ToS if you have banner ads. Really, you might be better off just with YouTube. Throwing caution to the wind, I thought I’d add in a video that I had stuck in my head while writing this post:
Assorted API Beef
Beyond some of the bigger issues, there are some other minor quirks that you should know about the API. Once again, this is beta software, so this could all be fixed really soon. I’ve been in contact with the lead developer over there, and it seems that they’re working hard to push new releases to address these issues. In the meantime, though, here’s some random beef about the API:
- Sparse Developer Resources
- It might just be the page design, but something about their developer site just feels…empty. There’s about as much documentation about the API as needed, but it lacks an overall cohesiveness and vision of how it should be used. There are message boards, which are encouraged for requesting features and bug reports, but there’s not much incentive to use it. There’s a blog, which has the latest information about the API, but it only gets updated once a month. Despite all of this, I can’t help but thank developer Justin Tormey, for responding to my e-mails and answering questions on the message boards. Unfortunately, it looks like it’s all on him to take care of whiny developers like me.
- No Flash Player Events
- Currently, there’s no way to communicate with the flash player for the music videos. There’s no way to tell if it’s playing or not, if the video has loaded, played through, or even what the video is. Contrast this with the Y! Music Video Player, which gives you all the control you could ask for.
- No XML or JSON-formatted Responses
- One of the more interesting choices made by the MTV Music API is to provide responses only in formatted feeds. Normally, web services have a few formats to choose from, like JSON or XML, but not in this case. While I applaud the appropriate choice of mRSS for video results, it ends up feeling out of place when returning results for artists, or genres.
- Incomplete Error Handling
- Remember that rate limit mentioned in the Terms of Service? If you go over, here’s what you get back:
<h1>403 Developer Over Qps</h1>
What’s most confusing is that this isn’t in the documentation at all. A recent update added error responses to the API, but not for this. - Limited Meta Information
- Like I mentioned above, there’s only as much information about artists as necessary to then access their videos. Either as a consequence or the mRSS format or a design constraint, simple information like the album title that corresponds to a given music video just isn’t there.
- Huge Collection of Videos
- Although the Y! Music video collection has twice the number of videos, MTV’s 20,000+ videos are definitely nothing to scoff at. Although it had less success with some of the fringe genres I listen to, it had a good selection for the mainstream stuff I tried out.
- No Ads (yet…)
- Perhaps the biggest competitive advantage the MTV Music API has over Yahoo! is that its music videos don’t have ads. Ads are one of my biggest gripes about Y! Music videos, so it’s a breath of fresh air to be able to rickroll someone without being foiled by an ad for Nissan.
- mRSS and OpenSearch
- Somebody at MTV has a good head on their shoulders for making use of these technologies, even if not the best use. Despite my mild protestation, the MTV API is exactly what mRSS was spec’d for. Adding OpenSearch into the mix was also in good taste.
Selling Points
Now that I’ve vented my frustrations about the API, I’d be remiss in talking about some of the things that it really has going for it:
The Verdict
The MTV Music API, as it currently stands, is a bit of a mixed bag. It’s still in beta, so it still has some room to grow before its release proper, but for now, it leaves a lot left to be desired. What I’m most concerned about, though, are the constrictive Terms of Service, which are enough to make me wary of choosing to develop with their technologies.
Either way, you can check out http://developer.mtvnservices.com/ for everything you need to get started. Or, if you’re a Rubyist, read on for an even easier way to get started…
require ‘mtv-music.rb’
Following the “You can only know an API once you’ve walked a mile in its shoes” tradition, I’ve fashioned a Ruby wrapper around the API.
If the code samples below entice, go ahead and try it out.
require 'mtv-music'
include MTV::Music
artist = Artist.new("Radiohead")
puts artist.name
puts artist.website
puts '*' * 40
puts
puts 'Videos'
artist.videos.each do |video|
puts "\t- %s" % video.title
end
video = Video.new("hznHivqrbHHZBZNXB") # Radiohead's "There There"
# The MTV Music API makes it easy to embed videos into any webpage
puts video.embed_code
# <embed src="http://media.mtvnservices.com/mgid:uma:video:api.mtvnservices.com:202930"
# width="448" height="366" type="application/x-shockwave-flash"
# allowFullScreen="true" allowScriptAccess="always" flashvars="autoPlay=false" />
