=============================================================================== Jah'Spotify Project
Jah'Spotify is a Java wrapper built on top of the Spotify native APIs (libspotify) exposed both as an HTML5 UI and a JSON REST based API
- retrieving library (all user playlists/folders)
- retrieve a playlist
- retrieve a folder (including/excluding sub-folders and playlists)
- retrieve an album
- retrieve a track
- retrieve an image
- add tracks to a queue (single queue currently supported)
- play tracks
- pause/skip functions
- dynamic playlist using echonest apis
- basic historical track list view
- very basic android app for remote control
- JSON reset based API
- web-ui based on JQuery Mobile
In addition, all the above functions are accessible over a JSON based RESTful API (provided by the services and web modules).
Note: Currently, JahSpotify relies on existing playlists created from Spotify - there is currently no option to add playlists/folders using the API or UI - it is being worked on ;)
Jah'Spotify supports the Linux and Windows versions of libspotify (see below for more details on building on Windows).
The following prerequisites are required in order to build Jah'Spotify
- Spotify API key
Checking out the sources
To build the sources first check them out from git
git clone git://github.com/johanlindquist/jahspotify.git cd jahspotify
Preparing Spotify API key and libraries
Next, you need to download and install libspotify & request an API key from Spotify. This can be done on the libspotify website or via your OS package provider (Homebrew for OS X for example)
Generate the key and download the C code version of it. Place this in a file called AppKey.h in the
directory. You may want to place some #ifndef APPKEY statements in this to prevent linking problems.
Performing the build
Ensure that your JAVA_HOME environment variable points to the JDK (v1.6.x) you want to use.
Finally, execute the Maven build
mvn clean install
Building on Windows
- Download MinGW and put the bin folder in your PATH.
- Download the OpenAL SDK from and copy the include folder to the MinGW include folder and rename it to AL
- The native pom.xml has a reference to a local LibSpotify folder. Change this to your own Spotify folder. You'll get an error that the api.h file can't be found if you don't.
- Add a reference to your OpenAL installation folder
You can find the OpenAL SDK at:
Next, define the following environment properties:
JAHSPOTIFY_SPOTIFY_DIR=c:\path\to\spotify\installation\LibSpotify\ JAHSPOTIFY_OPENAL_DIR=c:\path\to\openal\installation\OpenAL 1.1 SDK\
Performing the build
To build, simply execute maven build
mvn clean install
Building on OX X
Depending on your
Jah'Spotity will run both from within Maven (using Jetty) and in a web container such as Tomcat.
Jah'Spotify uses MongoDB for storing the historical statistics and tracks played. This can be downloaded from MongoDB. As long as MongoDB is running when Jah'Spotify is started (and the connection does not require credentials), it should work.
Running on Windows
For windows, you will need to download a few more dependencies:
- pthreads (http://sources.redhat.com/pthreads-win32/). pthreadGC2.dll needs to be in your path.
- Install the OpenAL SDK for Windows
To run up the Jah'Spotify with Maven/Jetty
mvn jetty:run -Djahspotify.spotify.username=<your username> -Djahspotify.spotify.password=<your password>
NOTE: The username and password can also be specified in your Maven settings.xml
To access the HTML5 UI of JahSpotify, simply point your browser to:
Once running, Jah'Spotify exposes it's RESTful API
All media can be retrieved using the Media Controller URL
Where the URI is any of the URIs specified below, in the more specialized controllers:
Adding a track to the play queue
Retrieving play queue
Skip to next track in queue
There are other URLs - please examine the web module for them.
provides a simple app for browsing playlists and queueing tracks
provides the basic operations for interacting with Jah'Spotify (and in turn libspotify)
contains all native & JNI code interacting with libspotify
contains wrapper code to load libjahspotify from a jar
provides all Jah'Spotify Spring services
provides the RESTful API (json based)
provides java client for interacting with the RESTful API
provides the java beans which are serialized over the RESTful API
provides basic storage implementations for caching media objects (tracks/images/etc)
provides a single, executable Jah'Spotify war file
Discussions and other:
For now, there is nothing concrete setup but try the issues page on github, contacting me on github. Also found at times on freenode - #jahspotify. Or try Twitter @nahojkap
All Jah'Spotify code is released under the Apache 2.0 license
Niels vd Weem
Yourkit is kindly supporting open source projects with its full-featured Java Profiler.
YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications.