Now playing, as JSON.
Track Fly turns whatever plays in Apple Music, Spotify, Roon or Plex into one JSON feed on your local network. Read it from a microcontroller, a home automation hub, a stream overlay or a script.
$ curl -s http://studio.local:8765/now { "source": , "state": , "title": , "artist": , "album": , "duration": , "position": , "progress": , "text": }
Bring your own screen.
Track Fly doesn't care what reads it. It answers plain HTTP with open CORS, so a $4 microcontroller and a browser tab get the same feed.
A REST sensor whose state is the current line, with the rest as attributes. Dim the lights when state turns playing.
# configuration.yaml
sensor:
- platform: rest
name: Now Playing
resource: http://studio.local:8765/now
value_template: "{{ value_json.text }}"
json_attributes: [state, source, title, artist, album, progress]
scan_interval: 5
Ask for ?ascii=1 and every string arrives as plain ASCII, ready for a 5×7 font.
HTTPClient http;
http.begin("http://studio.local:8765/now?ascii=1");
if (http.GET() == 200) {
JsonDocument doc;
deserializeJson(doc, http.getString());
if (doc["state"] == "playing") scroll(doc["text_ascii"]);
}
http.end();
Drop this into an OBS browser source or any page. The server sends Access-Control-Allow-Origin: *.
const el = document.querySelector("#now");
setInterval(async () => {
const t = await fetch("http://studio.local:8765/now").then(r => r.json());
el.textContent = t.state === "playing" ? `${t.artist} – ${t.title}` : "";
}, 2000);
/text returns one line and nothing when music stops, which is all a status bar needs.
curl -s http://studio.local:8765/text # Pink Floyd - Wish You Were Here (Wish You Were Here) curl -s http://studio.local:8765/now | jq -r '.progress' # 0.1829
No library, no token, no account. Just a GET.
import json, urllib.request
with urllib.request.urlopen("http://studio.local:8765/now") as r:
t = json.load(r)
if t["state"] == "playing":
print(f'{t["artist"]} - {t["title"]} {t["progress"]:.0%}')
Four players, one shape.
Every source answers with the same fields, so your display never needs to know where the music comes from. Turn each one on or off in Settings. When two play at once, the one that started last wins, or the one you prefer.
Apple Music
Reads the Music app while it is open. Radio streams show their stream title.
Spotify
Reads the Spotify desktop app. Track Fly never opens it for you.
Roon
Pairs with your Roon Core. Follows one zone, or whichever zone is playing.
Plex
Sees music on any Plex player: Plexamp, phone, TV. Filter to one player if you like.
The fields.
Stable keys, sensible types, nothing nested. Values you can trust a display with.
| Key | Type | Meaning |
|---|---|---|
| state | string | playing, paused, stopped or not_running |
| source | string | music, spotify, roon or plex |
| title · artist · album | string | The track, as the player names it |
| duration · position | seconds | Track length and playhead, one decimal |
| progress | 0 – 1 | Position divided by duration, for progress bars |
| text | string | “Artist - Title (Album)”, ready to show |
| text_ascii | string | The same line in plain ASCII |
| zone | string | Roon zone or Plex player, when there is one |
| id | string | Changes when the track changes |
Endpoints · port 8765
/nowThe current track as JSON./textOne line of text, empty when nothing plays./sourcesEvery enabled source at once./healthIs it up.
?ascii=1 on any endpoint turns Sigur Rós into Sigur Ros. &source=plex pins one source.
Small on purpose.
A menu bar icon, a settings window and a tiny server. No Dock icon, no cloud, no account.
Never opens your players
Apple Music and Spotify are only read while you already have them open.
Only what you switch on
Disabled sources are never polled, and Roon is only contacted while it is on.
Stays on your network
The feed is served from your Mac to your LAN. Nothing is sent anywhere else.
Your Plex token stays local
It lives in the macOS keychain, not in a preferences file.
A menu bar icon that tells you
A dot lifts out of the row while music plays and turns hollow on pause.
Open at login
One switch in Settings, off until you turn it on.
Get Track Fly.
Signed and notarized for macOS 15 or later. Open it, allow access to Music and Spotify when macOS asks, and copy the feed address from the menu bar.