Skip to content

Latest commit

 

History

History
48 lines (29 loc) · 1.77 KB

README.md

File metadata and controls

48 lines (29 loc) · 1.77 KB

spotify-api-server

Implementation of parts of the Spotify playlist API.

Hopefully this will allow for more services around Spotify as it makes editing playlists much easier than using libspotify.

It's a web server (listens at port 1337 by default) that talks to Spotify using libspotify. JSON is assumed as input and output.

spotify-api-server is an experiment with C, libspotify, evented I/O (libevent) and GPL.

Supported API methods

Playlists

GET /user/{username}/playlists -> {playlists:[<playlist>]}
GET /user/{username}/starred -> <playlist>

GET /playlist/{id} -> <playlist>
GET /playlist/{id}/collaborative -> {collaborative:<boolean>}
GET /playlist/{id}/subscribers -> [<string>]

POST /playlist <- {title:<string>} -> <playlist>
POST /playlist/{id}/add?index <- [<track URI>] -> <playlist>
POST /playlist/{id}/remove?index&count -> <playlist>
POST /playlist/{id}/collaborative?enabled=<boolean> -> <playlist>
POST /playlist/{id}/patch <- [<track URI>] -> <playlist>

patch replaces all tracks in a playlist with as few adds and removes as possible by first performing a diff between the playlist and the new tracks and then applying the changes.

Inboxes

POST /user/{user}/inbox <- {message:<string>, tracks:[<track URI>]}

message is optional.

How to build

  1. Make sure you have the required libraries
  1. Update account.c with your credentials. A Spotify premium account is necessary.

  2. Copy appkey.c into the directory and run make.