Trackhop

Trackhop on a server (Docker, beta)

Beta. The server works for everyday use (it has run scheduled syncs for days) but is still young: pages and settings can change between releases. Keep a copy of the data volume (or save the set-up from Tools › Backup & restore) and report what goes wrong. The unofficial connectors below stay an alpha.

The same sync engine as the Android app, running on a home server, a NAS or a small VPS, with a web page to connect services, create syncs and see how they went. Scheduled syncs run there, whether or not your phone is on.

Start it

docker run -d --name trackhop \
  -p 8080:8080 \
  -v trackhop-data:/data \
  -e SONGPORT_URL=http://127.0.0.1:8080 \
  -e SONGPORT_PASSWORD=choose-one \
  ghcr.io/xlollx/trackhop:latest

Then open http://127.0.0.1:8080 (any user name, the password you chose).

With Docker Compose:

services:
  trackhop:
    image: ghcr.io/xlollx/trackhop:latest
    container_name: trackhop
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./trackhop-data:/data
    environment:
      SONGPORT_URL: http://127.0.0.1:8080
      SONGPORT_PASSWORD: choose-one
      # SONGPORT_LOCALE: it

The same image is also on Docker Hub as xlollx/trackhop (docker pull xlollx/trackhop, the same latest and version tags), for tools and NAS app stores that only search there. Either name works; the commands in this guide use ghcr.io/xlollx/trackhop.

The image runs on amd64 and arm64 (Raspberry Pi 4/5, most NAS). To build it yourself, from the repository root: docker build -f server/Dockerfile -t trackhop .

Coming from Songport? Trackhop was called Songport up to version 1.1. The old image name, ghcr.io/xlollx/songport, still works and gets every release with the same tags as ghcr.io/xlollx/trackhop, so an existing setup keeps updating as it is. To switch, change only the image name: keep your volume (or folder) and your settings. The variables keep their SONGPORT_ prefix and the log file its name songport.log, so nothing else needs to change.

Update

The page says when a new version is out (Settings › Updates): twice a day at most it asks GitHub’s public API which version is the latest, nothing else. Turn it off there, or for everyone with SONGPORT_UPDATE_CHECK=false.

The image is ghcr.io/xlollx/trackhop:latest, or a version (:1.3.0): Docker and Trackhop Desktop have their own version, separate from the app’s, listed in the Desktop & Server releases. To update, pull the image and start the container again; everything is in the volume, so nothing is lost:

docker pull ghcr.io/xlollx/trackhop:latest
docker rm -f trackhop
docker run -d --name trackhop … ghcr.io/xlollx/trackhop:latest   # the same command as the first time

With Docker Compose: docker compose pull && docker compose up -d. The page’s footer shows the version running, and the app version whose engine it uses.

Settings

Variable Default What it does
SONGPORT_URL http://127.0.0.1:8080 The address your browser uses to reach Trackhop. Sign-ins come back to <SONGPORT_URL>/callback.
SONGPORT_PASSWORD none Asks for this password on every page. The browser also asks for a user name: any will do, unless SONGPORT_USER sets one. Set it whenever anyone else can reach the port. With SONGPORT_MULTIUSER, the admin’s password.
SONGPORT_USER none The user name that goes with SONGPORT_PASSWORD: set, only this name signs in (otherwise any will do). With SONGPORT_MULTIUSER, the admin’s name instead of admin.
SONGPORT_MULTIUSER off true: several people, each with their own services and syncs, signing in with a user name and a password. Needs SONGPORT_PASSWORD.
SONGPORT_LOCALE English Language of the texts that come from the engine: it, de, fr, es, pt-BR, pl, ru, tr, zh, ja, ko.
SONGPORT_PORT 8080 Port inside the container.
SONGPORT_DATA /data Where everything is kept (the volume).
SPOTIFY_CLIENT_ID, TIDAL_CLIENT_ID, DEEZER_APP_ID, GOOGLE_CLIENT_ID, LASTFM_API_KEY none Your keys, if you’d rather pass them here than type them in the page.
LASTFM_SHARED_SECRET none The “Shared secret” of your Last.fm API key: needed only to love tracks on Last.fm.
DEEZER_REDIRECT_URL <SONGPORT_URL>/callback Deezer’s redirect, which must be https.

Everything lives in the /data volume: store.json (syncs, reports, match cache, settings), tokens.json (sign-ins, readable only by the container’s user), songport.log, and csv/ for playlist files. Back that folder up and you have backed up Trackhop.

Services

Service On the server What you need
Spotify yes Your own key from developer.spotify.com
YouTube yes Your own Google OAuth client (with its secret)
TIDAL yes Your own key from developer.tidal.com
Deezer yes (beta) Your own app, and an https address
Navidrome / Subsonic, Jellyfin, Plex yes The server’s address and your login
Last.fm yes, as a source; Loved tracks also as a target Your user name; to love tracks, your password once (only the session Last.fm gives back is kept) and LASTFM_SHARED_SECRET
ListenBrainz yes, as a source Your user name
SoundCloud yes, as a source (unofficial) Nothing: pick it as the source of a new sync and paste a public set or likes link. More
NetEase Cloud Music, QQ Music yes, as sources (unofficial) Nothing: pick one as the source of a new sync and paste a public playlist link. More
CSV files yes Put them in csv/ inside the data volume
YouTube Music yes (unofficial, alpha) The cookies of a browser where you are signed in: see below
Spotify (web) yes (unofficial, alpha) The sp_dc cookie of a browser where you are signed in: see below
Deezer (web) yes (unofficial, alpha) The arl cookie of a browser where you are signed in: see below
Amazon Music, Apple Music no See below

Why not all of them. The other quick routes (Amazon Music, Apple Music without a key) work by running the service’s own web player inside the phone’s browser engine: there is no such browser on a server. Apple Music’s official route signs in with Apple’s MusicKit JS, which needs one too. Keep those syncs in the app.

More than one account or server

A service can be on the list more than once: two Jellyfin servers (yours and your parents’), two Spotify accounts, Navidrome at home and at the office. In Services, pick Jellyfin: Add another account in Add a service (or Add another account at the foot of the service’s page), give it a name if you like (“Jellyfin di casa”), then sign in to it as to the first. Each account keeps its own sign-in; the name can be changed later on its page.

New syncs offer every account on both sides, so a playlist can go from one Jellyfin server to the other. Only a playlist onto itself is refused. An extra account that a sync uses cannot be removed: delete or change those syncs first. The main account is removed as before.

Extra accounts work for the official connections (Spotify, YouTube, TIDAL, Deezer with your own key, which every account of the service shares), the personal servers (Navidrome / Subsonic, Jellyfin, Emby, Plex), Last.fm and ListenBrainz, and for the connectors signed in with pasted cookies (YouTube Music, Spotify and Deezer web, LiveOne, Anghami, Qobuz): each account pastes its own cookies, from a browser signed in to that account, and keeps its own session apart from the others.

The extra accounts and their names are part of the set-up: Tools › Backup & restore and GET /api/v1/config carry them, without the sign-ins, as for the main ones. In GET /api/v1/services an extra account’s id is jellyfin@2, with serviceId and slot; that id is the one to use in the other calls. A data folder from an older version reads as it did. With several people, each person’s accounts are their own.

Jellyfin Quick Connect

Jellyfin behind single sign-on, or a user without a Jellyfin password: on the Jellyfin service’s page, under the sign-in form, enter the server’s address and choose Sign in with Quick Connect. Trackhop shows a code; on a device where you are already signed in to Jellyfin, open your profile › Quick Connect and enter it. The page notices the approval within a few seconds and signs in. If Quick Connect is off on the server, the page says so (an administrator turns it on in Dashboard › General). Emby has no Quick Connect.

YouTube Music (unofficial)

The server talks to music.youtube.com the way the app’s built-in YouTube Music connector does, through the web player’s own endpoints, signed in with the cookies of a browser where you are signed in. It is not an official API: Google can change it or block it at any time, and it is an alpha on the server.

Copy the cookies (a desktop browser, Chrome, Edge or Firefox):

  1. Open music.youtube.com and sign in with the account to sync.
  2. Open the developer tools (F12, or Ctrl+Shift+I; on a Mac Cmd+Option+I) and pick the Network tab.
  3. Reload the page, type browse in the filter box and click one of the requests that appear (any request to music.youtube.com will do).
  4. Under Headers, then Request Headers, find cookie:, right-click its value and copy it (in Firefox: Raw view, then select the value).
  5. In Trackhop, Services, YouTube Music (unofficial, alpha), paste it in Cookies and press Connect. The page checks them with one call before saving.
  6. If your playlists live on a brand account (a channel of its own under the same Google account), pick it under Channel on the same page once connected: the list shows the account’s own channel and its brand accounts by name. Without a choice the account’s own channel is used, as before.

A cookies.txt export or the JSON export of a cookie-editor extension works too: paste the file’s content. Only YouTube’s and Google’s cookies are kept. Optionally paste your browser’s user agent as well (type navigator.userAgent in the developer tools’ Console): requests then look like that browser’s.

What to know before using it:

Your own key. The app’s built-in keys only work with the app’s own redirect (songport://), so on the server every service that needs a key needs yours. Each service page in Trackhop lists the steps and shows the exact redirect address to paste. The rules each service sets:

Open the page at the same address as SONGPORT_URL (127.0.0.1, not localhost): the service sends you back there after the sign-in. Spotify no longer accepts localhost at all.

Signing in from another computer than the server is fine, as long as SONGPORT_URL is the address that computer’s browser uses.

Spotify and Deezer without a key (unofficial)

Spotify (web) and Deezer (web) talk to the web players’ own backends, as the app’s connectors of the same name do, signed in with the cookies of a browser where you are signed in. Not an official API: against the services’ terms, they can stop working when the players change, and they are an alpha on the server.

Copy the cookie (a desktop browser): sign in on open.spotify.com or deezer.com, open the developer tools (F12), then Application (Firefox: Storage) › Cookies › https://open.spotify.com (or https://www.deezer.com). Copy sp_dc for Spotify (with sp_key and sp_t when listed) or arl for Deezer as name=value, several joined by ; , and paste them in Trackhop, Services, in the connector’s Cookies. The cookie: header of a request, a cookies.txt or a JSON export work too.

The same cautions as YouTube Music apply: the cookies are as good as your password, and they end when you sign out in that browser. Spotify’s access token is read from the player page fetched with the cookies: when that page answers as a signed-out visitor, Trackhop says the cookies have expired. Paste fresh ones then.

LiveOne (unofficial)

LiveOne (formerly Slacker Radio) has no public API: Trackhop goes through liveone.com’s own web player, unofficial and alpha, like the web connectors above. No developer key.

  1. In a desktop browser, sign in to liveone.com.
  2. Open the developer tools (F12), then Application (Storage in Firefox) › Local storage › https://www.liveone.com, and copy the whole value of slackerUser (it holds the refresh token).
  3. In Trackhop, Services › Add › LiveOne (web), paste it and press Connect.

Trackhop renews the session from the refresh token in it as the player does; it lasts until you sign out of LiveOne in that browser. It is as good as your password: keep it to yourself.

What works: a free account’s presets, shown as the liked songs, as a source and as a target (songs are added, not removed); search. Not yet: playlists of your own (they need LiveOne’s paid plan), removing songs, and stations as a radio source (LiveOne plays them only in the US).

Anghami (unofficial)

Anghami has no public API: Trackhop goes through play.anghami.com’s own web player, unofficial and alpha, like the web connectors above. No developer key. (Public playlist links work without any of this: paste them as the source of a sync.)

  1. In a desktop browser, sign in to play.anghami.com.
  2. Open the developer tools (F12), then Network; type gateway in the filter and open your library.
  3. Right-click one of the gateway.php requests › Copy › Copy URL.
  4. In Trackhop, Services › Add › Anghami (web), paste it and press Connect.

The sid in that address is the session: it lasts until you sign out of Anghami in that browser, and it is as good as your password, so keep it to yourself.

What works: your playlists and your liked songs, as a source and as a target (add, remove, create, rename, delete); search.

Qobuz (unofficial)

Qobuz gives its API only to approved partners: Trackhop goes through play.qobuz.com’s own web player, unofficial and alpha, like the web connectors above. No developer key.

  1. In a desktop browser, sign in to play.qobuz.com.
  2. Open the developer tools (F12), then Network; type api.json in the filter and open your playlists.
  3. Right-click one of the requests › Copy › Copy as cURL (or copy its request headers).
  4. In Trackhop, Services › Add › Qobuz (web), paste it and press Connect.

What Trackhop keeps is the X-User-Auth-Token of that request: it lasts until you sign out of Qobuz in that browser, and it is as good as your password, so keep it to yourself.

What works: your playlists and your favourite tracks, as a source and as a target (add, remove, create, rename, public or private, delete); search, by ISRC first.

Radio syncs

A radio sync listens to an internet radio in the hours you choose and saves the songs it plays to a playlist on any service: the morning show’s music in your Spotify, a station’s evening mix on YouTube Music. On the home page, New radio sync:

  1. Find the station by name (from radio-browser.info, a free directory of some 50,000 radios), or paste its stream’s address.
  2. Pick where the songs go: a service, then a playlist or a new one.
  3. Pick the days and the hours. The same time twice listens all day; an end before the start runs past midnight (Friday 22:00–02:00 listens into Saturday night).

While its window is open, Trackhop reads the title of each song the station sends with its stream (Icecast and Shoutcast do, as most internet radios and the streams of FM stations); the audio itself is read and dropped, never kept. Each new song is noted once in a File playlist of its own (*Radio - *), the station's announcements, adverts and news left out, and the sync takes them to your playlist every 10 minutes and once more when the window closes, matched as any sync. Its card wears a radio and says what is on air.

A station that sends no titles is reported on the card (“this stream sends no song titles”): try another of its streams (an MP3 one rather than HLS), or another station. Listening uses the station’s bandwidth (128 kbps is about 60 MB an hour) on the server and on Trackhop Desktop, which are always on. The Android app has radio syncs too: there the phone samples the stream every 2 minutes, on Wi‑Fi by default, instead of listening throughout (guide).

Several people on one server

One container can serve the whole household: each person signs in with their own user name and password and has a Trackhop of their own, with their own services, syncs, files, backups and log. Nobody sees the others’. Add SONGPORT_MULTIUSER:

    environment:
      SONGPORT_URL: http://<NAS-IP>:8080   # example: http://192.168.1.10:8080
      SONGPORT_PASSWORD: choose-one        # the admin's password
      SONGPORT_MULTIUSER: "true"
  1. Open the page and sign in as admin (or the name in SONGPORT_USER, if you set one), with SONGPORT_PASSWORD.
  2. In Users, add each person with a user name and what they may use (below), then Create an invitation link and send it to them (a message, an email…).
  3. They open the link, choose their own password and are in: they connect their own services. From then on they sign in at the same address with their name and password. The 👤 link with their name, in the top bar, is where they change their password or sign out.

Without SONGPORT_MULTIUSER nothing changes: one Trackhop, one password, any user name.

On Azure (beta)

Deploy to Azure

No server at home? The button creates Trackhop on Azure Container Apps in your own subscription: a small app that is always on, with an HTTPS address, and its data on an Azure Files share. You choose a name, a region, a user name and a password; the address is shown at the end of the deployment. It is billed to your Azure subscription: about $5 a month in most regions when it sits idle between syncs, up to about $15 if it is busy all the time (estimate from Azure’s list prices for Container Apps after its monthly free grant; storage costs cents) (check the pricing calculator for your region); to remove it, delete the resource group. From a datacenter, use the official connectors: the unofficial ones are blocked more often. Details: packaging/azure.

Behind a reverse proxy

Point the proxy at port 8080 and set SONGPORT_URL to the public https:// address. Trackhop needs nothing else: no websockets, no special headers. /health answers ok without a password, for health checks.

On your phone, as an app

Trackhop’s page can sit on your phone’s home screen and open full screen, like an app (a PWA): the syncs keep running on the server, so it works with the phone off too.

It shows the server’s pages live, nothing is kept on the phone; if the server is off or out of reach, it says so. Connect the services (Spotify and the others) from a browser: their sign-in can leave the home-screen app and not come back to it.

How it runs

Tools

The page’s Tools are the app’s: Export a playlist, File playlists (upload any format, download CSV, M3U, XSPF, JSPF or text), Full backup (by hand, daily or weekly, optionally copied to a folder: mount one, for example -v /mnt/nas/trackhop:/backups, and enter /backups), Duplicates, Unplayable tracks, AI playlists and, on Docker only, Lyrics. Long runs go on in the background: their page refreshes until the result, and you can leave it.

Lyrics

Trackhop can give a music library on the server its lyrics: for each audio file without them, it asks LRCLIB, a free archive written by its users, and saves what it finds next to the file, synced lyrics as <name>.lrc and plain ones as <name>.txt. Navidrome, Jellyfin and Plex show them in their players after their next library scan. Only on Docker, not in the app or in Trackhop Desktop.

Mount the music folder and name it in SONGPORT_MUSIC:

services:
  trackhop:
    image: ghcr.io/xlollx/trackhop:latest
    volumes:
      - ./trackhop-data:/data
      - /path/to/music:/music
    environment:
      SONGPORT_MUSIC: /music

The container runs as user 999, so it needs to be allowed to write in that folder (and only to add files; it changes none): sudo setfacl -R -m u:999:rwX -m d:u:999:rwX /path/to/music gives it that without changing the files’ owner. Do not mount it :ro.

Then Tools › Lyrics looks through the whole library or one folder of it. The artist, title, album and length come from the files’ tags (or from names like Artist - Title.mp3 when a file has none); a title with “Remastered”, “(feat. …)” or “(with …)” is tried again without them, and the length has to match within a few seconds, so a live version does not get the studio lyrics.

For each file, its artist, title, album and length are sent to LRCLIB, nothing else. Lyrics are protected by copyright: they are for your own listening. On a server shared by several people, only the admin sees this tool.

AI playlists

No key needed

The first form on Tools › AI playlist needs no AI and no key, and it is the same on every build (Android, Docker, Desktop). Type one to five artists you like, or pick a playlist of yours (its most frequent artists are the starting point, its own tracks are left out), a length (25, 50, 100) and how adventurous: Familiar keeps to the closest artists and their best-known songs, Discovery skips the obvious names and the biggest hits. Trackhop then asks open music data:

It mixes them, a few songs per artist and never the same song twice, searches them on the service you chose like any sync, and creates the playlist (or saves it into File). Building a list takes from a few seconds to a minute or two for 100 tracks; the page shows how far it is. In the app it is Tools › Playlist generator › No key needed, the mode the card opens in while no AI is set up, with the list shown for a look before anything is created.

With your AI

Describe a playlist; your own AI writes it and Trackhop creates it on a service (or saves it into File). Trackhop has no AI of its own and sends the AI only your description. Free ways:

What the AI proposes is searched on the service like any sync, so a track it made up is simply not found.

Notifications

A short message on your phone or in a chat when a sync ends with something to know: in Settings › Notifications, add as many channels as you like, each with its own events (a sync added or removed tracks, a sync failed or a sign-in expired, tracks to review, removals waiting for your confirmation), and try it with Send test. The message says the sync’s name, +added −removed and the error’s first line: never your tokens or your server’s address. Sending happens apart from the sync (10 seconds at most per channel); a channel that fails is noted in the log and never fails the sync. Tokens are kept in the data folder like the sign-ins, shown masked (••••abcd), and left out of the .trackhop set-up file: after restoring it on another server, enter them again (the channels wait, turned off). On a server for several people each has their own.

From a terminal, trackhop notify lists the channels and trackhop notify test <name or id> sends a test. For the whole run as JSON (Home Assistant, n8n), use the webhook instead.

API

Other tools (Home Assistant, n8n, Node-RED, a script) can do what the page does: make and change syncs, run them and review what they did, read and edit playlists, bring in files, set up notifications. Turn it on in Tools › API: make a token (shown once; only its hash is kept) and send it as Authorization: Bearer <token>. It is separate from the page’s password; on Trackhop Desktop only the computer itself can reach it. From a terminal or a script, the trackhop command does the same with less typing: docker exec trackhop trackhop run --all, no token needed inside the container. The same token lets an AI assistant use Trackhop at /mcp (Model Context Protocol): how.

Every call is also described in GET /api/v1/openapi.json (OpenAPI 3, no token needed: it holds nothing of yours), for the tools that read one, such as Postman or a generated client. Ids in paths are the ones the lists give: a sync’s id, a run’s id, a service’s id (spotify, ytm, navidrome_1…), a playlist’s id. Refusals answer {"error": "why"} with a 4xx code.

General

Call What it does
GET /api/v1/status Version, how many syncs, which are running, the last run.
GET /api/v1/metrics The syncs as Prometheus metrics (text).
GET /api/v1/stats Your numbers: tracks moved, time saved, busiest route, top artists.
GET /api/v1/tasks The background tasks (backups, duplicates, lyrics), running or ended in the last hour.
GET /api/v1/tasks/{task} One background task: its progress, whether it is done, its error.
GET /api/v1/log The server’s last log lines (admin only).

Syncs

Call What it does
GET /api/v1/syncs Every sync with its source, target, timing and last result.
POST /api/v1/syncs Make a sync.
POST /api/v1/syncs/run-all Start every sync that is turned on.
GET /api/v1/syncs/{sync} One sync and its last runs.
PATCH /api/v1/syncs/{sync} Change a sync: any of name, enabled, schedule, every, at, days, changes, follows, color.
DELETE /api/v1/syncs/{sync} Delete a sync (the playlists stay as they are).
POST /api/v1/syncs/{sync}/run Start a sync now; anyway=true after a run held back by the target’s size check.
POST /api/v1/syncs/{sync}/stop Stop a running sync.
POST /api/v1/syncs/{sync}/pause Pause a running sync.
POST /api/v1/syncs/{sync}/resume Resume a paused sync.
POST /api/v1/syncs/{sync}/enable Turn a sync’s schedule on.
POST /api/v1/syncs/{sync}/disable Turn a sync’s schedule off.
POST /api/v1/syncs/{sync}/move Move a sync in the list: a position from 1, or up, down, top, bottom.
GET /api/v1/syncs/{sync}/preview What a run would do now, without changing anything.

Runs

Call What it does
GET /api/v1/syncs/{sync}/runs A sync’s runs, newest first.
GET /api/v1/runs Every run, newest first; sync= for one sync’s.
GET /api/v1/runs/{run} One run with its tracks (added, removed, not found, to check) and its notes.
GET /api/v1/runs/{run}/review A run’s review: not found, to check, removed.
POST /api/v1/runs/{run}/review Review a run: ignore, keep, discard, pick, replace or restore.

Services

Call What it does
GET /api/v1/services The services added, and whether each is connected; each account apart (id jellyfin@2, with serviceId and slot).
GET /api/v1/services/{service} One service: connected, account, and what it can do.
GET /api/v1/services/{service}/search Look for a track: q is “Artist - Title” or a link.
GET /api/v1/convert A track on another service: track is “Artist - Title” or a link, to the service’s id.
POST /api/v1/convert Several tracks on another service.

Playlists

Call What it does
GET /api/v1/services/{service}/playlists A service’s playlists and library entries.
POST /api/v1/services/{service}/playlists Make a playlist.
PATCH /api/v1/services/{service}/playlists/{playlist} Rename a playlist.
DELETE /api/v1/services/{service}/playlists/{playlist} Delete a playlist.
GET /api/v1/services/{service}/playlists/{playlist}/tracks A playlist’s tracks.
POST /api/v1/services/{service}/playlists/{playlist}/tracks Adds tracks, searched and matched as a sync does: {"tracks": [{"title": "…", "artist": "…"}, {"link": "https://open.spotify.com/track/…"}, {"id": "…"}, "Artist - Title"]}. Tracks already there are skipped ("allowDuplicates": true to add them anyway); the answer lists what was added, already there and not found.
DELETE /api/v1/services/{service}/playlists/{playlist}/tracks Remove tracks.
POST /api/v1/services/{service}/playlists/{playlist}/tracks/remove Remove tracks (for tools that cannot send a body with DELETE).
GET /api/v1/services/{service}/playlists/{playlist}/duplicates The tracks a playlist holds more than once.
POST /api/v1/services/{service}/playlists/{playlist}/duplicates/remove Remove the extra copies (a background task).
GET /api/v1/services/{service}/playlists/{playlist}/export A playlist as a file: csv, m3u, xspf, jspf or txt.

Files

Call What it does
GET /api/v1/files The File playlists.
GET /api/v1/files/{file} A File playlist, in a format: csv, m3u, xspf, jspf or txt.
PUT /api/v1/files/{file} Bring in a playlist file (CSV, M3U, PLS, XSPF, JSPF, iTunes XML, JSON, text) as the body.
POST /api/v1/files/{file} The same as PUT, for tools that only POST.
DELETE /api/v1/files/{file} Delete a File playlist.
POST /api/v1/files/zip Several File playlists in one .zip, in a format.
GET /api/v1/files/settings How names in imported files are read: the layout and your own patterns.
PUT /api/v1/files/settings Set the layout (AUTO, ARTIST_TITLE, ARTIST_ALBUM_TITLE, CUSTOM) and the patterns.
POST /api/v1/files/try Try patterns on a line from a file, without saving them.

Backups

Call What it does
GET /api/v1/backup The full backup: running, last run, schedule.
POST /api/v1/backup Back up every playlist now (a background task).
GET /api/v1/config The whole set-up as a .trackhop file; history=true with the runs.
POST /api/v1/config Bring a .trackhop file back in (the body); dryRun=true only says what it holds.

Settings

Call What it does
GET /api/v1/settings The settings the page offers.
PATCH /api/v1/settings Change settings: theme, backupSchedule, backupFolder, updatesCheck.

Notifications

Call What it does
GET /api/v1/webhook The webhook: address, whether a secret is set, its events.
PUT /api/v1/webhook Set the webhook.
DELETE /api/v1/webhook Turn the webhook off.
GET /api/v1/notifications The notification channels, their tokens masked.
GET /api/v1/notifications/kinds The kinds of channel, their settings and the events.
POST /api/v1/notifications Add a channel.
PATCH /api/v1/notifications/{channel} Change a channel (a secret left out keeps its value).
DELETE /api/v1/notifications/{channel} Remove a channel.
POST /api/v1/notifications/{channel}/test Send a test message.

Lyrics

| Call | What it does | |—|—| | GET /api/v1/lyrics | Lyrics for the music folder (Docker, admin): state and last run. | | POST /api/v1/lyrics | Looks for lyrics now (202, with a task id): ?folder=Queen/Jazz for one folder, &synced=true for synced lyrics only, &retry=true to ask again for the ones not found. Lyrics | GET /health answers ok with no token: for Docker’s health check, Uptime Kuma or a reverse proxy.

curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:8080/api/v1/syncs
curl -X POST -H "Authorization: Bearer $TOKEN" http://127.0.0.1:8080/api/v1/syncs/run-all

Making and changing a sync. The same checks as the page: the playlists must be ones the services list, a playlist cannot sync onto itself. Without target.playlist, a new playlist is made at the first run. The timing is schedule (manual, hourly, every_6h, daily, weekly) or every in minutes, with at ("07:30") and days (1 = Monday … 7 = Sunday); changes is add (only add), mirror (also remove what leaves the source) or archive (keep every track ever seen); color a name (teal) or #RRGGBB. A PATCH changes only what it names.

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"source": {"service": "spotify", "playlist": "37i9dQZEVXcJZyENOWUFo7"}, "target": {"service": "ytm"},
       "name": "Discover Weekly", "schedule": "weekly", "days": [1], "at": "08:00", "changes": "archive"}' \
  http://127.0.0.1:8080/api/v1/syncs

Reviewing a run. GET /api/v1/runs/{run}/review lists what a run could not find, the matches to check and what it removed, each with its source id; POST the same address does what the page’s review does: {"action": "ignore", "tracks": ["<id>"]} (or "tracks": "all"), keep and discard for matches to check, pick and replace with "choice": "Artist - Title" (or a link, or the track’s id on the destination), and restore to put back what the run removed.

Webhook. With an address set in Tools › API (or PUT /api/v1/webhook), Trackhop POSTs its events there as JSON: sync.finished (the sync, and the run with its added and not-found tracks) and backup.finished (services, failures) unless you choose otherwise; sync.started and sync.failed (a failed run sends both sync.finished and sync.failed) when you tick them. With a secret, X-Trackhop-Signature: sha256=<hex> is the HMAC-SHA256 of the body. In Home Assistant, a Webhook trigger with that address starts an automation (a notification when tracks were not found, say); a rest_command that POSTs to /api/v1/syncs/run-all starts every sync from one.

Prometheus and Grafana. /api/v1/metrics speaks Prometheus’ text format; a scrape job with the token is enough:

scrape_configs:
  - job_name: trackhop
    metrics_path: /api/v1/metrics
    bearer_token: th_your_token
    static_configs:
      - targets: ["trackhop:8080"]

Playlists and tracks. A Home Assistant button that adds the song playing in the kitchen to a playlist, or a script that collects the songs a radio played:

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"tracks": ["Daft Punk - Digital Love", {"link": "https://open.spotify.com/track/2VEZx7NWsZ1D0eJ4uv5Fym"}]}' \
  http://127.0.0.1:8080/api/v1/services/ytm/playlists/PLxxxxxxxx/tracks

GET /api/v1/convert?track=Daft%20Punk%20-%20Digital%20Love&to=tidal finds a track on another service as a sync would, with how sure the match is.

Scripts. Push a playlist file and sync it, save the set-up every night, bring it back elsewhere:

curl -X POST -H "Authorization: Bearer $TOKEN" --data-binary @mix.m3u http://127.0.0.1:8080/api/v1/files/mix.m3u
curl -H "Authorization: Bearer $TOKEN" -o trackhop-$(date +%F).trackhop http://127.0.0.1:8080/api/v1/config
curl -X POST -H "Authorization: Bearer $TOKEN" --data-binary @trackhop.trackhop "http://127.0.0.1:8080/api/v1/config?dryRun=true"

Not there yet

The connectors that run a service’s own web player (Amazon Music, Spotify and Apple Music without a key, Deezer web, SoundCloud with an account) need a browser inside Trackhop: they are the next step. The compatibility card and the playlist poster are not on the page yet either.

Back to the guide