API

Everything you can do in the web interface can also be done over HTTP, which makes it easy to automate Soulsolid with curl, scripts or other tools. The web interface and the API use the same addresses: when a request comes from the web interface you get a web page, and when it comes from anything else you get JSON.

# How many tracks are in the library?
curl http://localhost:3535/library/tracks/count
# {"key":"tracks_count","value":1234}

# Import the download folder
curl -X POST http://localhost:3535/import/directory -d "directoryPath=/app/downloads"
# {"job_id":"…"}

# Follow the job
curl http://localhost:3535/jobs/<job_id>

Request bodies can be sent as form fields (-d "key=value") or as JSON.

Soulsolid has no authentication: anyone who can reach it can use the API. Don’t expose it to the internet without a reverse proxy that adds a login.

Responses

Each route below returns one of these kinds of responses:

ResponseWhat you get
PageA full web page. Open it in a browser.
DataThe data shown on that part of the page, as JSON.
ValueA single value: {"key":"…","value":…}.
OK{"message":"…"} on success, or {"error":"…"} with an HTTP error status.
Job202 Accepted with {"job_id":"…"}. The work runs as a background job; follow it with /jobs/:id.
FileThe file itself (audio, image, playlist, database). Send Accept: application/json to get {"type":"…","url":"…"} instead.
JSONAlways JSON.

Dashboard

MethodRouteWhat it doesResponse
GET/DashboardPage
GET/dashboardDashboardPage
GET/analyzeAnalyze sectionPage
GET/dashboard/quick-actionsQuick actions cardData
GET/healthReturns OK while the server is runningText

Settings

MethodRouteWhat it doesResponse
GET/settingsSettings pagePage
GET/config/formCurrent settingsData
PUT/settingsSave settingsOK
PUT/config/importSave import optionsOK
PUT/config/pathsSave path templatesOK
GET/configThe whole configurationJSON
GET/config?fmt=yamlThe config.yaml file as textYAML
GET/config/database/downloadDownload a backup of the library databaseFile

Library

MethodRouteWhat it doesResponse
GET/libraryLibrary pagePage
GET/library/tableLibrary tableData
GET/library/searchSearch the library (see parameters below)Data
GET/library/tracks/:trackId/overviewTrack overviewData
GET/library/artists/countNumber of artistsValue
GET/library/albums/countNumber of albumsValue
GET/library/tracks/countNumber of tracksValue
GET/library/storage/sizeLibrary size on disk, in bytesValue
GET/library/artists/:idOne artistJSON
GET/library/albums/:idOne albumJSON
GET/library/tracks/:idOne trackJSON
GET/library/treeFolder tree of the library (?folder=downloads for the download folder)Value
GET/library/tracks/:id/lyricsA track’s lyricsValue
DELETE/library/tracks/:trackIdDelete a track and its fileOK
DELETE/library/albums/:albumIdDelete an album and its filesOK
DELETE/library/artists/:artistIdDelete an artist and their filesOK

Search parameters

ParameterDefaultMeaning
queryText to search for in artists, albums and tracks
page1Page number
limit50Results per page
genreOnly tracks with this genre
has_acoustidtrue or false: only tracks with or without an AcoustID
lyrics_filterOnly tracks in a given lyrics state
lyrics_textOnly tracks whose lyrics contain this text
added_after, added_beforeOnly tracks added in this date range

Tags / Metadata

MethodRouteWhat it doesResponse
GET/tag/:trackIdTag editor for a track (?source=db to show the library’s tags instead of the file’s)Page
POST/tag/:trackIdSave a track’s tagsOK
GET/tag/:trackId/metadataEnabled metadata providersData
GET/tag/:trackId/search/:providerSearch a provider for matchesData
GET/tag/:trackId/select/:provider?index=NFill the tag editor with a search resultPage
GET/tag/:trackId/:providerFill the tag editor with a provider’s best matchPage
GET/tag/:trackId/artworkThe track’s cover artFile
GET/tag/:trackId/fingerprintFingerprint the track and look up its AcoustIDOK
GET/tag/:trackId/fingerprint/viewThe track’s stored fingerprintValue
GET/analyze/metadataMetadata analysis pagePage
POST/analyze/acoustidStart an AcoustID analysis of the libraryJob

Importing

MethodRouteWhat it doesResponse
GET/importImport pagePage
GET/import/directory/formImport form, with the default folderData
GET/import/directory/badgesCurrent import optionsData
POST/import/directoryImport a folder (directoryPath)Job
GET/import/queue/itemsTracks in the review queueData
GET/import/queue/items/groupedQueue grouped by ?type=artist or ?type=albumData
GET/import/queue/headerQueue summaryData
GET/import/queue/countNumber of tracks in the queueValue
GET/import/queue/:id/artworkCover art of a queued trackFile
POST/import/queue/:id/:actionAct on a queued track: import, replace, cancel or deleteOK
POST/import/queue/group/:groupType/:groupKey/:actionAct on a whole artist or album groupOK
POST/import/queue/clearEmpty the queueOK
POST/import/prune/download-pathDelete the audio files in the download folder and empty the queueOK
POST/import/watcher/toggleStart or stop the download folder watcher (action=start or action=stop)OK
GET/import/watcher/statusWhether the watcher is runningData
GET/import/watcher/toggle-stateWhether the watcher is runningData

Jobs

MethodRouteWhat it doesResponse
GET/jobsJobs pagePage
GET/jobs/allEvery job, with links to its progress and logsJSON
GET/jobs/activeRunning and waiting jobsData
GET/jobs/listJobs, optionally only those of one type (?prefix=download_)Data
GET/jobs/latestThe 5 most recent jobsData
GET/jobs/countNumber of jobs (?filter=active for running and waiting ones)Value
POST/jobs/start/:typeStart a job of the given type, e.g. calculate_metricsJob
POST/jobs/clear-finishedRemove finished jobs and their logsOK
GET/jobs/:idOne job’s status, progress and messageJSON
GET/jobs/:id/progressOne job’s progressData
GET/jobs/:id/logsOne job’s log as plain text (?color=true for a colored page)Text
POST/jobs/:id/cancelCancel a jobData

Downloading

Add ?downloader=<name> to choose which plugin to use. Without it, the first configured plugin is used.

MethodRouteWhat it doesResponse
GET/downloadsDownload pagePage
POST/downloads/searchSearch (query, type: album, track, artist or link, limit)Data
POST/downloads/search/albumsSearch albums (query)Data
POST/downloads/search/tracksSearch tracks (query)Data
GET/downloads/album/:albumId/tracksAn album’s tracksData
GET/downloads/chart/tracksThe service’s top tracksData
GET/downloads/user/infoYour account on the service, and its statusData
GET/downloads/capabilitiesWhat the plugin supportsJSON
POST/downloads/trackDownload a track (trackId)Job
POST/downloads/albumDownload an album (albumId)Job
POST/downloads/artistDownload an artist’s discography (artistId)Job
POST/downloads/tracksDownload several tracks (trackIds, comma-separated)Job
POST/downloads/playlistDownload a playlist (trackIds, playlistName)Job

Lyrics

MethodRouteWhat it doesResponse
GET/analyze/lyricsLyrics analysis pagePage
POST/analyze/lyricsStart a lyrics analysis (provider, skip_existing_lyrics, override_no_queue)Job
GET/tag/:trackId/lyricsEnabled lyrics providersData
GET/tag/:trackId/lyrics/text/:providerLook up a track’s lyrics with a providerJSON
GET/library/tracks/:id/lyricsA track’s lyricsValue
GET/lyrics/queue/itemsTracks in the lyrics queueData
GET/lyrics/queue/items/groupedQueue grouped by ?type=artist or ?type=albumData
GET/lyrics/queue/headerQueue summaryData
GET/lyrics/queue/countNumber of tracks in the queueValue
GET/lyrics/queue/:id/new_lyricsThe new lyrics found for a queued trackValue
POST/lyrics/queue/:id/:actionAct on a queued track: override, keep_old, no_lyrics, skipOK
POST/lyrics/queue/group/:groupType/:groupKey/:actionAct on a whole artist or album groupOK
POST/lyrics/queue/clearEmpty the queueOK

Playlists

MethodRouteWhat it doesResponse
GET/playlistsPlaylists pagePage
GET/playlists/:idOne playlist and its tracksData
GET/playlists/create-modalNew playlist formData
GET/playlists/:type/:id/playlistsPlaylists you can add a track, album or artist toData
GET/playlists/:id/exportDownload the playlist as .m3uFile
POST/playlists/Create a playlist (name, description)OK
PUT/playlists/:idRename or edit a playlist (name, description)OK
DELETE/playlists/:idDelete a playlistOK
POST/playlists/itemsAdd music (playlist_id, item_type: track, album or artist, item_id)OK
DELETE/playlists/:playlistId/tracks/:trackIdRemove a track from a playlistOK

File paths (Reorganize)

MethodRouteWhat it doesResponse
GET/analyze/filesFile paths pagePage
POST/analyze/reorganizeStart a reorganize (fat32_safe=true to also make paths FAT32-safe)Job

Merge

MethodRouteWhat it doesResponse
GET/analyze/mergeMerge pagePage

Finding and merging duplicates is only available from the web interface. See Merge.


Metrics

MethodRouteWhat it doesResponse
GET/metrics/overviewNumber of tracks, artists and albumsData
GET/metrics/charts/genreTracks per genreData
GET/metrics/charts/yearTracks per release yearData
GET/metrics/charts/formatTracks per audio formatData
GET/metrics/charts/metadataPercentage of tracks with each tagData

To recalculate the metrics, start a calculate_metrics job with POST /jobs/start/calculate_metrics.


Streaming

MethodRouteWhat it doesResponse
GET/stream?path=<url-encoded path>Play or download an audio file from the library or download folderFile