Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
HTTP interface to libspotify
C
branch: master

This branch is 3 commits ahead, 36 commits behind liesen:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
COPYING
Makefile
README.md
account.c
api.key
config.c
config.h
constants.h
diff.c
diff.h
json.c
json.h
server.c

README.md

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

  2. Update account.c with your credentials. A Spotify premium account is necessary.

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

Something went wrong with that request. Please try again.