Now playing
Get now playing
GET
/api/nowplayingOpen. Open to everyone who can reach Tempolight.
Whether reading what music apps play works here, how, the track, and the Spotify account. When the track is a remembered song, the lights follow its beat map.
Responses
200OKapplication/json
enabledbooleansupportedbooleanplatformstringstatestringOne of
"ok" "starting" "unavailable" "error" "off"messagestring | nullmethodstring | nullOne of
"osascript" "playerctl" "dbus-send" "powershell" nulltrackobject | null{source, app, device, title, artist, album, dur, pos, playing, posKnown, remembered, following}.
spotifyobjectRequest
curl 'http://localhost:8080/api/nowplaying'const res = await fetch("http://localhost:8080/api/nowplaying");
const data = await res.json();
console.log(data);import requests
res = requests.get(
"http://localhost:8080/api/nowplaying",
)
print(res.json())Response
{
"enabled": true,
"supported": true,
"platform": "darwin",
"state": "ok",
"message": null,
"method": "osascript",
"track": null,
"spotify": {
"clientId": "",
"connected": false,
"error": null,
"redirectUri": "http://127.0.0.1:8080/api/nowplaying/spotify/callback"
}
}