API out soon or do we create our own ugly hacks?
I assume there will be an API for getting currently playing song title/artist/URI/album/song length etc. The question is WHEN? We need it for twitter, IRC and so on, and we need it NOW :)
How about an API call for adding a spotify URI to playlist X, to queue or to play it right away? (you don't always want to play an URI right away you know, a choice would be nice)
How about an API call for adding a spotify URI to playlist X, to queue or to play it right away? (you don't always want to play an URI right away you know, a choice would be nice)
91
people have this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The best answers from the company
-
Today we launched libspotify, our first API. If you're interested in details visit our blog.
http://www.spotify.com/blog/archives/...
3 people say
this answers the question
-
The APIs are definitely coming, but unfortunately I can't give you a specific time frame. You're stuck with the ugly hacks for now, but on the flip side, it's really impressive what people have been building anyway.
I'm collecting names for a mailing list about the Spotify platform that we'll launch once we're ready to talk about specifics. If you want to be on it, please send an email to ehn+platform@spotify.com about it!
Cheers,
Andreas
The company and 12 other people say
this answers the question
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?The APIs are definitely coming, but unfortunately I can't give you a specific time frame. You're stuck with the ugly hacks for now, but on the flip side, it's really impressive what people have been building anyway.
I'm collecting names for a mailing list about the Spotify platform that we'll launch once we're ready to talk about specifics. If you want to be on it, please send an email to ehn+platform@spotify.com about it!
Cheers,
Andreas
The company and 12 other people say
this answers the question
-
Inappropriate?I'm also highly interested in this topic, as I'm dying to have my last.fm profile updated with all the songs I'm listening to on Spotify!
-
Have you tried scrobblify? (works with windows and wine)
http://code.google.com/p/scrobblify/ -
No... I use OS X, so not a lot of luck there... but thanks for the link anyway! -
Spotify has a last.fm function if you check your settings. -
Inappropriate?Will it be a API towards the Spotify client? Or will the API have functionality for communicating direct with the Spotify streaming server and database so we can make our own clients?
-
Inappropriate?Would love it if Spotify offered an official API (closed for partners only or open for everyone) so that could could get a plugin for Boxee.
http://getsatisfaction.com/spotify/to...
I’m hopeful
-
In the absence of an official API, I've gone ahead and made a really nasty hack.
AppleScript tells Spotify to quit or start playing a song (based on whether it's running or not), and on my Mac Mini (which I use for HTPC purposes with Plex) the pre-selected playlist is one called Plex. It's randomized etc, of course, and here's the cool thing.
The Plex helper daemon only looks for the application it launched from within Plex (i.e., the AppleScript). It's not aware that Spotify launches in the background, so Plex starts running fullscreen again as soon as Spotify starts playing (or quits), because the AppleScript terminates.
This means that after a short while, the Plex screensaver kicks in, and the music is still on.
Song changes are announced via Growl, and still works fine.
I do wish the API were out though, because it would be sweet to be able to query and control Spotify directly instead of relying on silly hacks -
@Oscar Rylin: would you mind sharing your AppleScript hacks with us? I'm trying to write a plugin for Xchat but I'm not getting very far. -
Inappropriate?I don't want a client control API... I want a spotify server communication API for c/c++ so I can make my own client.
I’m starting to feel unhappy if there just going to be a client control API
-
I strongly doubt that's going to happen (as in "never", even though never is a pretty long time).
First and foremost, you'd need to be able to play the encrypted music files.
I seriously doubt Spotify will just hand out the decryption key, as it's most likely an integral part of the licensing agreement with the studios to guarantee future income -- otherwise there's nothing stopping you from simply downloading one of the biggest music libraries in the world for your own purposes.
You'd also be able to kill the ads, robbing Spotify of one of their income sources.
Why, exactly would they want anyone to write a third-party client, when their business revolves around their own client and clever techniques?
(Hint, have a look at the console output and look at when and how it does things)
I'd be very happy if the API gave me access to the actual decrypted audio stream (meaning I could play the Audio on platforms not supported by Spotify), but I'd definitely be OK with having to have Spotify be responsible for playing the stream if that's the only option.
As for what the API will allow for, well, that's up to Spotify.
I'm assuming the first version of the API will be basic read/write communications with the player, allowing us to integrate Spotify into other products (namely things like XBMC, Boxee etc).
The second iteration might very well be to extend Spotify with plugins.
I could easily see plugins being made with quicklinks to the artists' websites, street teams and other easily accessible information.
Modifying the ad-stream? Nope. Reading the unencrypted audio stream? Nope.
Writing an equalizer? Sure, so long as you know that it'll be Spotify applying it to the audio streams (i.e., you don't get to touch the actual audio streams at all, but you might be able to write filters for it).
Modifying the appearance of the client?
Sure (/Applications/Spotify.app/Contents/Resources).
If all you want to do is change the colors, you could probably apply a CoreGraphics filter to the application (or the equivalent on the lesser platforms).
Basically, in the long run, the API will probably allow you to do anything except mess with their revenue stream. -
Ok.. I admit that I haven't really looked into how the streaming is done in Spotify. But why would the music stream be encrypted? There is no meaning in hiding the stream from others since it don't contain any vital personal data, and if they are afraid of the stream getting it ripped or edited it wont help since the music will pass unencrypted through the audio device at some point. And I guess that the ads are part of the stream, so those would come anyway (even though it would be possible to make some kind of stream analyzer that stopped the stream when a ad starts.)
The main reason that I want a server API is for making client on other platforms. I'm using and programing on Amiga as a hobby, and I would like a native client to both AmigaOS4.1 on my AmigaOne and AmigaOS3.9 on my Amiga1200.
For the moment I'm reading the sound stream from the sound device on my linux computer where I'm running spotify with wine. The program I have written sets up a socket against another program that I run on the Amiga1200 and the send the sounddata it reads from the sound device from the linux computer to the amiga. This works really fine, and if I had a client API I guess I could have changed track and so on from the Amiga.
So the part of not being able to read the unencrypted sound stream is already not true, since I'm able to do this. :)
This solution force me to use my own computer as a relay server that alway have to be on... and this is one of the things I want to avoid. Otherwise I could just set up my own streaming server from my own music archive instead of using spotify (Since the music I listen to on spotify is the same as the one I have in my own music archive...). -
It's not so much making it impossible to rip the Spotify collection as making it infeasible.
The actual cached songs are stored encrypted on disk to make sure everyone and their grandma don't just copy the songs to their iPods, sharing the music with others etc. -- especially now that during the past month or so, there's been a fair bit of exclusive content on Spotify.
Of course you can read the actual stream as sent from the soundcard, but it includes system sound and sound from other apps as well, making it very time consuming to rip the 2088985 songs currently in Spotify's index.
Under OS X you can limit stream rippers to only grab the sound for various apps, and I'm confident some of the sound frameworks available for the various Linux distros can do it as well, so fair enough -- it can be ripped at 1:1, but you end up with a higher bitrate file (i.e uncompressed audio based on already compressed Vorbis audio). Compressing that again wouldn't be too nice ;)
Of course, the EULA (whether or not it's a legal document is a wholly different discussion) states (or did, in closed beta atleast) that we're not allowed to use stream rippers, disassemble the code etc.
I totally understand the purpose and idea behind what you want to do though, but I just don't see Spotify favoring the hacker community over the music label contract they're working so hard to get, as ultimately, 95% of the users won't give a good god damn about plugins or other ways to use Spotify.
There was a person a while ago who wanted Spotify to port the app to the original Xbox so he could use it in XBMC, refusing to listen to reason (i.e., why would Spotify pay for an SDK for an EOL platform, where the only potential users have proven themselves to in most cases not care about copyright -- though there are still those who only use it for strictly legal purposes).
In other words, there's a lot of people asking similar questions, so I guess I just expect the worst whenever I see one :-P
There is a possibility that Spotify could release a small player-only app which takes the encrypted files and plays them, with ads intact), but that means a minimal codebase, making it very dificult to hide the decryption key, defeating the entire purpose ;)
Personally, I always have at least one computer on (in this case my iMac), hooked up to way too much storage, serving Plex (fork of XBMC for OS X).
While I can control Spotify to some degree unofficially with AppleScript, it would be more productive to have read/write access to parts of the application (i.e., read and write playlists, do searches, play/pause, next song, change playlist etc.).
Ideally exposed as a webservice, making it platform agnostic (Spotify remote on the iPhone? No probs. Spotify controller on the XBOX? Sure, so long as you write a XBMC plugin or a dedicated app with an unlicensed, EOL SDK ;) )
The best thing you can do is sign up for the mailinglist Andreas Ehn mentioned and wait for it to launch. I think it's pretty safe to say that they'll be listening to our input from a beta API access, and you're not alone in wanting to be able to handle the actual audiostream -- it's just that the majority are more interested in being able to integrate it with current products (Last.fm scrobblers, MediaCenter-like products as different in-software interfaces etc.), and it would increase the big S' marketshare.
In other words, so long as people remember that Spotify is a for-profit entity, it's somewhat possible to figure out what the future might hold in store for us. -
Aha.. I see... I haven't realized that spotify actually cache the song locally on the computer (I probably would have known this if I looked in the configuration menu earlier... did that just now :) ). That sets the whole thing in another perspective. Of course they don't want people to be able to play the files right from the computer.
Well I guess I'll just have to settle with improving my stream relay then. As I wrote earlier. If they give us a client control API it will not be any problem for me to remote control the spotify client on the linux computer from the stream reader on the other computer. :) -
Inappropriate?@zmurf
Would you like to share some info on how you hooked into the sound stream from Wine? I've thought of doing the same thing, but I've not given it top priority.
Cheers,
david at divideandconquer dot se. -
Oh... I didn't control read my comment. I don't use wine, I use VMware. VMware uses the /dev/dsp device in linux and I just open the /dev/dsp and read the raw datastream.
I tried with wine at first... but it seems like wine don't use the dsp device. So I don't really understand how Wine plays the sound... :/ -
Inappropriate?I just have to say. That I would love to integrate Spotify with my Boxee client, and iPhone aswell..
I love that I automatically have the same playlist on every computer that i login to Spotify with.
Keep up the good work.. -
Inappropriate?Everyone, what would you expect from a official Spotify web service? (Both in terms of functionality and technicalities)
-
As a first revision, just basically being able to control an existing Spotify session
Log in / out, list playlists and their contents
Control play/pause, next, prev, volume etc... and note that it should be possible to play a playlist
get currently playing song, get next song in the play queue (or just in general, being able to get the itemnumber of the currently playing song in a playlist)
In other words, basic remote control functionality.
For a more advanced revision, be able to query the spotify search api and be able to manipulate playlists ( $playlists->create('foo'); $playlists->getPlaylist('foo')->addSong( hashid ) ), allowing for actual automation of the client.
Now, since my primary interest is in the first part, i'll flesh that out.
Metadata that would be nice to have access to is:
Playlist
-Name
-Created
-Last played
Song
-Name
-Playcount
-Artist (incl. hashid)
--AMG data/biography?
--Similar artists?
-Album (incl. hashid)
--Label?
--AMG data?
--Cover-art
-Year
-Length
That's off the top of my head.
I'd imagine there'll be quite a few plugins for XBMC, Plex, Boxee etc., so the general idea would be to expose enough data to more or less wrap the Spotify functionality inside them. -
Actually, I think it'd be best if the mailinglist Andreas Ehn talked about were launched.
It'd be easier to read through comprehensive ideas, do traditional mailinglist voting etc ;)
Basically, I'm pretty sure you guys know what we'd like to see in an API.. after all, it's probably what you'd like to see as well.
Along those lines, Andreas Setterlind's comment below regarding the documentation is a major point.
All in all, it's probably better if you guys write an initial spec, and we throw lots of feedback at it.
I don't think anyone's expecting the API to be full-fledged from day one, so start off with the basics, release that and look at what the community needs to be able to improve. -
And it will be. Sorry about the delay, and thanks to everyone who has signed up! I haven't been able to reply personally to all of you, but your names are noted. -
Youtube URL:s has the same "problem" as Spotify URI:s; there is no way of knowing what the content behind the link:
http://www.youtube.com/watch?v=_jIJDO...
Youtube offers access to all meta data through http://gdata.youtube.com
An example for the youtube URL above would be:
http://gdata.youtube.com/feeds/api/vi...
Querying for Artist/Song/Album/Popularity/Genre using a Spotify URL like that would make life a lot easier and it shouldn't take too long to implement. I guess the amount of data transmitted could be cut down by offering the most common stuff (probably artist/song name) in one request and complete meta data in another.
XML is well known and easy to understand for most people.
I was hoping for an API where 3:rd party apps could query the client for "currently playing" and for "add x to playlist y" but I understand you're going for a webservice first. I guess maybe it would be possible to authenticate with the service to be able to get currently playing track from there, depending on the architecture of your system ofc. -
I think it would also be nice if we could get the songs of a playlist from the playlist's HTTP link. It would be very interesting for web developers, because by now people can't see the playlist content except if they open it with Spotify... -
I agree with mrc2407 - the most useful API would be to fetch content of playlists. Perhaps you could be inspired by Last.fm's API for Playlists? http://www.lastfm.se/api/show?service... -
I would really love official API as well, but before we're getting one, I've written a little software that gets metadata using despotify gateway. It was originally for IRC bot use only, and it still has some bugs and "features", but I've been requested turning it into a web service. We'll see, but at least despotify gateway is a good starting point if someone wants to get metadata from Spotify URLs. The IDs in URLs are base62 encoded by the way, in case that helps someone. -
Here's Rasmus's own code to convert between UUIDs and Spotify URIs, useful in combination with despotify.
http://github.com/rsms/snippets/blob/...
+1 on playlist/meta data API. I for one would like to create a service where you could backup your playlist or track modifications. It's been a few times where I've had my playlists deleted or emptied. -
Inappropriate?An well documented open API with ability to send username/password authentication so that if a user have paid for a premium they should be able to develop their own third-party front-end that can connect to spotify.com via that API to be able to search and play streams over HTTP without having to have Spotify's own client software installed
Kind of like Last.fm http://www.last.fm/api
http://www.programmableweb.com/api/la...
So basically have all Spotify functions available via this API, control and stream all music. Also getting the listings for similar artists and similar songs, etc.
I’m hopeful
-
To much mess to close the listings inside a closed closet. Better would it thought to let users to browse spotify before they join so they see what they paying for. It is the streaming that is needed to be licensed. Otherwize, all catalouge sites would be illegal (last.fm,discogs, all music guide etc.). Giving the spotify resource out without authentication is also not illegal since you need to use a spotify client to listen to the stream -
Inappropriate?XBMC has its own HTTP based API like this which makes it possible to fully control it remote control it and also get covers/thumbnails, artist pictures, etc. That API is open source and documented in the XBMC wiki if you like to get a few ideas, checkout this article:
http://xbmc.org/wiki/?title=HTTPAPI
as well as these separate articles related with different control commands:
http://xbmc.org/wiki/?title=Category:...
and also:
http://home.no.net/thor918/xbmc/xbmcH...
and:
http://prdownloads.sourceforge.net/xb...
Again, just to get some ideas ;)
I’m excited
-
Inappropriate?When will the mailing list about the Spotify platform (API) come???
We really waiting for this one!
I’m a little frustrated
-
Inappropriate?Come on guys, it's been four months.
Even I'm getting impatient
I know it's only been roughly a month since Mr. Ehn apologized for the delays, but it's been a long one with way too much snow, ice and cold, and not enough hot cocoa and late night hacking :(
I’m tapping my foot
-
2 people say
this answers the question
-
Awesome.
Hadn't heard bout that :D -
I sure hope that the "Legal Department" over at Spotify looks at this the right way and realize that it's a Good ThingTM and that they should support hacking of this kind, especially when it doesn't hurt their core business model. -
I agree Peter, in the future their business is hopefully payment routines, signing contracts with record companies and supplying a vanilla client and then leave it up to the users in what way (with what software) they wish to connect to Spotify (using valid user accounts ofc). The whole API thing doesn't seem to happen anyway, I guess they have enough to do anyway. -
I too am hoping that Spotify will choose to co-exist peacefully with open clients. At least let paying premium users connect with unofficial players. A pure text-based interface is truly a dream-come-true for my lightweight desktop. -
There's a Java port out since a few day ago called Jotify. It's apparently based off despotify.
http://github.com/fxb/jotify/tree/master
Haven't tried it myself but others claim success. -
Inappropriate?Today we launched libspotify, our first API. If you're interested in details visit our blog.
http://www.spotify.com/blog/archives/...
3 people say
this answers the question
-
Any thought about a PHP API? -
that's cool...but it sucks that you have to be a premium user to use it. I am more interested in an API that controls the official player -- for example, methods to get the properties of the current track, to browse to a page, to switch the track, manage playlists, etc. (even searching?) -
Just that thing I seek for -
I agree denton29. It's very disappointing if you're only interested in extending functionality of the existing player. I have to buy a premium account, to extend the Spotify product, something which would (hopefully) benefit Spotify's userbase. Really? -
Inappropriate?Please make an add-on gallery like Firefox has. This would be wonderful.
Loading Profile...



EMPLOYEE



EMPLOYEE
EMPLOYEE