This Spotify plugin exposes the API externally using Websockets. This allows you to control the play back and gather information from the player. It has been built to be used with the Spotibeef Server
It is hacky as. Be warned.
https://github.com/beef/spotibeef-server
For OSX, if not already in place create a folder in your home directory called;
Spotify
Then either download or git clone this into the folder;
git clone https://github.com/beef/spotibeef.git
Launch Spotify and in the search bar paste;
spotify:app:spotibeef