Title here
Summary here
The djctl WebSocket API provides a simple mechanism for providing real-time track transition updates to connected clients.
The WebSocket service is available at the following location:
ws://127.0.0.1:9090/ws
Once connected, the service will push JSON events to the client.
As a new track transitions into “featured” state, a JSON formatted message is sent to all WebSocket clients. The following is an example message:
The following table enumerates attributes found in the event JSON.
Attribute | Type | Description |
---|---|---|
title | string | Track title |
artist | string | Track artist |
genre | string | Track genre |
art | string | Base64 encoded PNG (RGB, 256x256) |
spotify_code | string | Base64 encoded PNG |
duration | integer | Total track duration in seconds |
timestamp | string | Timestamp in format 2022-02-11T08:24:47.162918-08:00 |
timestamp_epoch | integer | Unix time; the number of seconds elapsed since January 1, 1970 UTC |
elapsed | string | Elapsed time since the first track triggered in format hh:mm:ss |