Player API

The Player API is a Flash module for your site that allows you to easily add a music player to your website. You must have streaming access on the Grooveshark API to be able to use APIPlayer.


It can be found at and once embedded into the page, you can control it via JavaScript.

Controling the Player API

You control APIPlayer by using various Javascript methods.


playStreamKey(streamKey, serverHostname, serverID)

Using the Streaming API, get a streamKey, serverHostname and serverID from getStreamKeyStreamServer. Then use them to play the song in APIPlayer.

Example Return from getStreamKeyStreamServer:


The streamKey would be: 49f96f87d901402998409bcc616cffec802e8c819_4dc072cd_1a8c758_1d2b5ce_19f7ebe3_8

The serverHostname would be:

The serverID would be 32768.



The callback is called when the song is complete. The callback is just called and nothing is sent.



The callback is called when there is an error when playing a stream. The callback is called with a human-readable error string as the only param.



The callback is called when the status of the song changes. The callback is sent a string with a new status of the song. The string can be one of: none, loading, playing, paused, buffering, failed, completed.


The callback is called when the position of the song changes. The callback is sent an object with two keys. There is the position key and the duration key. Each have a value of an int in milliseconds.

pauseStream, resumeStream, stopStream

Each of these methods can be used to pause, resume and stop (respectably) the currently playing stream. No params are needed.


This method takes a 0-100 integer value and changes the volume of the player to the corresponding value.