Skip to content

Remote Control API

Taiko2k edited this page Dec 20, 2020 · 28 revisions

Port used is 7814

API is not stable and subject to change.

API point is /api1/. So for example full URL would be for example http://localhost:7814/api1/play (no trailing slash)

Warning: There are currently no notifications of server side data changes. If playlist state changes, existing client playlist data will be invalidated.

Identifiers used

  • Playlist ID: Identifies a unique playlist. (str)
  • Track ID: Identifies a unique track database entry. May appear multiple times in a playlist. (int)
  • Album ID: Identifies a block within a playlist. Only unique in the context of a single playlist. (int)
  • Position: An index position within a playlist. (int)

API

Meta

  • version Returns json:
{"version": 1}

Playback control

  • play
  • pause
  • next
  • back
  • seek/<n> where <n> is an int in range 0 to 1000.
  • start/<Playlist ID>/<Position> Begins playback in playlist at track index position in playlist.

Toggle modes

  • shuffle
  • repeat

Playlists

  • playlists Returns json:
{"playlists": 
  [ {"name": "Myplaylist",
     "id": "1234",
     "count": 123
    }, ...
  ]
}

Track at position

  • trackposition/<Playlist ID>/<Position>

Returns json of base track data class:

 {"title": "",
  "artist": "",
  "album": "",
  "album_artist": "",
  "duration": 180000, 
  "id": 123,
  "position": 12,
  "album_id": 12,
  "track_number": "5"
  }

All tracks

  • tracklist/<Playlist ID> Returns list of track classes (as above)
{"tracks": 
  [ ...
  ]
}

Albums

  • albums Same format as "All tracks", except only the first track of every album block is included.
{"albums": 
  [ ...
  ]
}

Album Tracks

  • albumtracks/<Playlist ID>/<Album ID> Same format as "All tracks", Except only the tracks in given album will be returned.

Status

  • status
{ "status": "stopped",
  "shuffle": false,
  "repeat": false,
  "progress": 0,
  "playlist": "123",
  "playlist_length": 123,
  "id": 123,
  "title": "",
  "artist": "",
  "album": "",
  "progress": 120000,
  "position": 1,
  "album_id": 123,
  "track": {...}
  • status can be stopped, playing or paused
  • id is a Track ID of currently playing track
  • progress is absolute time in ms
  • playlist is a Playlist ID
  • playlist_length is a count of tracks in the playlist
  • position is index position of playing playlist

Image Thumbnails

  • pic/small/<Track ID>
  • pic/medium/<Track ID>

Returns image file

Misc

  • playinghit/<Track ID> Causes play time to increment. Hit continuously while playing. Period must be less than 5 seconds.

Streaming

file/<Track ID> Return raw audio file. Network tracks not supported. CUE sheets not supported.

Clone this wiki locally