Subsonic and OpenSubsonic API
Navidrome implements the Subsonic API version 1.16.1 and the OpenSubsonic API, which extends it.
This page lists what Navidrome supports and where it behaves differently. It does not repeat the parameters and response formats of each endpoint. For those, follow the endpoint links to the OpenSubsonic documentation.
Quick reference
| Item | Value |
|---|---|
| URL | https://<server>/rest/<endpoint>. The .view suffix is optional |
| URL with a base path | https://<server>/<path>/rest/<endpoint>, when the server uses the BaseUrl option |
| Subsonic API version | 1.16.1 |
| Response formats | XML (default), JSON (f=json), and JSONP (f=jsonp) |
| Request methods | GET, or POST with an application/x-www-form-urlencoded body of up to 10 MB |
| CORS | All origins are allowed. Scripts can read the X-Content-Duration and X-Total-Count response headers |
| Demo server | See the demo page |
Each response identifies the server. Use type to detect Navidrome, and serverVersion to know its version:
{
"subsonic-response": {
"status": "ok",
"version": "1.16.1",
"type": "navidrome",
"serverVersion": "0.65.0 (b2debbb3)",
"openSubsonic": true
}
}
To know what a server can do, call getOpenSubsonicExtensions instead of comparing versions. It needs no
credentials, so you can call it before the user logs in.
Authentication
All endpoints except getOpenSubsonicExtensions require the v (API version) and c (client name) parameters.
Navidrome accepts any value in v.
Navidrome supports these authentication methods:
| Method | Parameters | Notes |
|---|---|---|
| API key | apiKey | Recommended. If you also send u, p, t, or s, Navidrome returns error 43 |
| Token and salt | u, t, s | t is md5(password + salt). It does not work with an API key in place of the password |
| Password | u, p | p is plain text, or hex-encoded with the enc: prefix |
| API key as password | u, p | p is the API key. This lets users log in with an API key in clients that have only a password field |
| Reverse proxy | Set by the proxy | With externalized authentication, the proxy identifies the user and Navidrome ignores the credentials in the request. This does not apply to JSONP requests, or to web clients on a different origin. These must send normal credentials |
API keys
Users create and revoke their keys in the Navidrome web UI, in the user menu, under Players & API keys. A key has the
nds_ prefix followed by 22 letters and digits. It does not expire.
Each key belongs to one player. To get the username that owns a key, call tokenInfo.
Failed logins
Navidrome limits failed logins. By default, after 5 failures in 20 seconds from the same IP address with the same
username or API key, it rejects all attempts until the 20 seconds end. Correct credentials are rejected too, with the
same error as wrong ones. Do not retry automatically after error 40 or 44.
Players
Navidrome registers each client as a player. Users can configure these settings for each of their players in the web UI:
- The transcoding format and the maximum bit rate
- Whether plays are sent to external services such as Last.fm and ListenBrainz
- Whether the real file path is returned in
path
With an API key, the player is the one that owns the key. With the other methods, Navidrome finds the player by the
username, the c parameter, and the User-Agent header. If one of them changes, the user can get a new player and lose
these settings:
- Use the same
cvalue in all requests, and do not put a version number in it. - Use the
Name/versionform in theUser-Agentheader, for exampleMyApp/1.2.3, and do not change the name. Navidrome compares only the name and the operating system, so a new version keeps the same player.
Two devices with the same username, client, and user agent can share one player. Each player has only one entry in
getNowPlaying, so use a different API key on each device to keep them separate.
Errors
API errors have the HTTP status 200 and an error element
in the response. Navidrome uses these error codes:
| Code | When |
|---|---|
0 | Invalid parameter value, or an internal error. See the message |
10 | A required parameter is missing. Some endpoints return 0 or 70 instead |
40 | Wrong username, password, or token, or too many failed logins |
43 | apiKey was sent together with other credentials |
44 | Invalid or revoked API key, or too many failed logins |
50 | The user does not have permission, the feature is disabled, or the playlist is read-only |
70 | The item does not exist, or it is in a library that the user cannot access |
Navidrome does not return the codes 20, 30, 41, 42, and 60, or the helpUrl field.
Some requests fail with an HTTP status instead. Most of these responses have no Subsonic response body, so check the HTTP status before you parse the response:
| Status | When |
|---|---|
400 | getTranscodeStream was called without a required parameter |
404 | The endpoint does not exist, the song in getTranscodeStream does not exist, or no sonic similarity plugin is active |
405 | getTranscodeDecision was not called with POST |
410 | Navidrome will not implement the endpoint, or the transcodeParams in getTranscodeStream is no longer valid |
429 | stream or download reached the transcoding limit of the server. Wait for the time in the Retry-After header, then try again |
429 | getCoverArt received too many requests at the same time. This response has no Retry-After header. Send only a few image requests at the same time, for example 4 |
500 | getTranscodeStream could not start the stream. This includes the transcoding limit |
501 | The endpoint is not implemented, or the feature is disabled in the server |
How Navidrome behaves
IDs
All IDs are strings, except for the music folder IDs, which are integers. Do not convert the string IDs to integers, and do not assume a format or a length.
Music folders
Each music folder is a Navidrome library. Users only see content from the libraries that they can access.
You can send musicFolderId more than once to select many libraries. If the user cannot access one of the selected
libraries, most endpoints return error 70.
Browsing
Navidrome organizes music by tags and does not support browsing by folder. getIndexes and getMusicDirectory
simulate a directory tree with artists, albums, and songs. Prefer the ID3 endpoints: getArtists, getArtist, and
getAlbum.
getIndexesandgetArtistsreturn only album artists. When there are none, for example on a new server, they return error70and not an empty list.getArtistreturns only the albums where the artist is an album artist. The server can also include the albums where the artist is a track artist, with theSubsonic.ArtistParticipationsoption.- The
pathof a song is simulated too, for exampleArtist/Album/01-02 - Song.mp3. To get the real path, the user must turn on Report Real Path in the player settings. The server can turn it on for new players with theSubsonic.DefaultReportRealPathoption.
Cover art
- Send the
coverArtvalue togetCoverArtexactly as you received it. Do not build it from the item ID. - When
coverArtis missing, the item has no artwork. You can skip the request and show your own placeholder. - The value can end with a hash of the image. In that case it changes when the image changes, so you can cache the image
by its
coverArtvalue. - The
Cache-Controlheader tells you if you can cache the image. When the item has no artwork,getCoverArtcan return a placeholder image withCache-Control: no-store. - Songs in an album with disc numbers can return the artwork of the disc. Each entry in
discTitlesalso has its owncoverArt. - The URLs in
artistImageUrland in thegetArtistInfoandgetAlbumInforesponses need no authentication.
Play counts and scrobbling
stream and download never count as a play. Navidrome counts a play, and sends it to external services, in one of
these ways:
- With
scrobble: when you call it withsubmission=true, which is the default. Your client decides when a song counts as played. To submit offline plays, send the originaltimeof each one. - With
reportPlayback: when you report thestoppedstate with apositionMsof at least 50% of the song or 4 minutes, whichever comes first. Also sendstoppedwhen a song plays to the end, with the final position. If you do not sendstopped, the play does not count.
If you use both for the same play, it counts twice. To combine them, send ignoreScrobble=true in reportPlayback and
submit the play with scrobble. This is the recommended pattern for clients that also play offline. reportPlayback
shows what the user is playing now, and scrobble submits online and offline plays in the same way.
Navidrome has no minimum song length, so do not skip short songs. Last.fm does not accept songs of 30 seconds or less, and by default Navidrome does not send them to Last.fm.
scrobble returns ok even if the song does not exist.
Without new reports, a playing song leaves getNowPlaying a few seconds after its expected end, and a paused song
leaves after 30 minutes.
Streaming
stream uses the first rule in this table that matches the request. The player settings can force a
different format or a lower bit rate.
| Request | Result |
|---|---|
No format and no maxBitRate | The original file |
format=raw | The original file. This ignores maxBitRate and the player settings |
Only maxBitRate, lower than the original | Transcoded to the format in the DefaultDownsamplingFormat option (default opus) |
Only maxBitRate, equal to or above the original | The original file |
format equal to the format of the original | The original file, unless its bit rate is above maxBitRate |
format=flac with maxBitRate | Can be transcoded to DefaultDownsamplingFormat, because FLAC cannot have a maximum bit rate |
Any other format that the server can transcode to | Transcoded to that format. By default, the server has mp3, opus, aac, and flac |
format that the server does not have | Transcoded to DefaultDownsamplingFormat |
Always check the Content-Type header of the response, because the format can be different from the one you requested.
Seeking. Check the
Accept-Rangesheader of the response. If it isbytes, sendRangerequests. If it isnone, the song is being transcoded and the response has noContent-Length. To seek, send a new request withtimeOffset, in seconds.Check if
timeOffsetwas applied. Navidrome ignorestimeOffsetwhen it sends the original file. There is no error, and the file starts at the beginning. To find out what you received:Accept-Ranges: none: the song is being transcoded, andtimeOffsetwas applied.Accept-Ranges: bytes, andContent-Lengthis equal to thesizeof the song: this is the original file, andtimeOffsetwas ignored. Seek with aRangerequest.Accept-Ranges: bytes, andContent-Lengthis different fromsize: this is a transcoded song from the server cache, andtimeOffsetwas applied.
To know this before you request the stream, use transcoding decisions.
Length. With
estimateContentLength=true, a transcoded response has an estimatedContent-Length. The real size can be different. TheX-Content-Durationheader has the duration of the full song, in seconds.
Transcoding decisions
With the transcoding extension, your client describes what it can play, and the server decides between the original
file and a transcoded stream:
- Call
getTranscodeDecisionwithPOST. Put the normal parameters in the URL and the client capabilities in a JSON body. Set theContent-Typeheader toapplication/json. If the body is sent as a form, Navidrome cannot read it and returns error0. - Check
canDirectPlayandcanTranscodein the response. If both arefalse, the server cannot send the song in a format that your client can play. The response has the reason inerrorReason, and has notranscodeParams. Do not continue. - Call
getTranscodeStreamwith thetranscodeParamsfrom the response. To seek in a transcoded stream, sendoffset, in seconds. - If
getTranscodeStreamreturns the HTTP status410, get a new decision. A decision is valid for 48 hours, and only while the file does not change.
The current limits are:
mediaTypemust besong.- The only streaming protocol is
http. Navidrome acceptshlsin a profile, but never selects it. - Navidrome ignores the transcoding profiles with the AAC codec. This is intentional, because AAC transcoding is not reliable
in some players. Include at least one profile with another codec, such as
mp3oropus. This limit does not apply tostreamwithformat=aac. - The transcoding format and the maximum bit rate in the player settings also apply to the decision.
Server options that change responses
The administrator of the server can change these options:
| Option | Default | Effect on the API |
|---|---|---|
AutoTranscodeDownload | false | When true, download without format uses the transcoding format in the player settings, if there is one |
EnableDownloads | true | When false, download returns error 50 and downloadRole is false |
EnableSharing | true | When false, the sharing endpoints return the HTTP status 501 and shareRole is false |
Jukebox.Enabled | false | When false, jukeboxControl returns the HTTP status 501 and jukeboxRole is false |
PreferSortTags | false | When true, sortName has the value of the sort tags in the files, if they exist. This also changes the order of artists and albums in lists, and the index letter of each artist in getArtists and getIndexes |
Subsonic.AppendSubtitle | true | Adds the subtitle to the song title, for example Song (Live) |
Subsonic.AppendAlbumVersion | true | Adds the version to the album name, for example Album (Deluxe Edition) |
Subsonic.ArtistParticipations | false | Adds the albums where the artist is a track artist to getArtist and getMusicDirectory |
Subsonic.DefaultReportRealPath | false | When true, new players receive the real file path in path |
Subsonic.EnableAverageRating | true | When false, averageRating is not returned |
Subsonic.LegacyClients | "DSub" | Clients (the c parameter) that do not receive the OpenSubsonic fields |
Subsonic.MinimalClients | "SubMusic" | Clients (the c parameter) that receive only the basic fields of songs and playlists |
Transcoding.MaxConcurrent and Transcoding.MaxConcurrentPerUser | 0 | When set, Navidrome limits how many transcodes can run at the same time |
OpenSubsonic support
Extensions
getOpenSubsonicExtensions returns these extensions:
| Extension | Versions | Adds | Notes |
|---|---|---|---|
apiKeyAuthentication | 1 | apiKey parameter, tokenInfo | See Authentication |
formPost | 1 | Parameters in a POST body | Use it for long lists of IDs |
indexBasedQueue | 1 | getPlayQueueByIndex, savePlayQueueByIndex | Supports a queue that has the same song more than once |
playbackReport | 1 | reportPlayback, more fields in getNowPlaying | Only for songs. See Play counts and scrobbling |
songLyrics | 1, 2 | getLyricsBySongId | Version 2 adds word timing and translations with enhanced=true. line.end is not returned |
sonicSimilarity | 1 | getSonicSimilarTracks, findSonicPath | Only when a plugin that provides it is active, such as AudioMuse-AI |
topSongsByArtistId | 1 | id parameter in getTopSongs | |
transcodeOffset | 1 | timeOffset parameter in stream | See Streaming |
transcoding | 1 | getTranscodeDecision, getTranscodeStream | See Transcoding decisions |
Navidrome does not support the getPodcastEpisode extension.
Response fields
Navidrome returns these OpenSubsonic fields:
| Response | Fields | Not returned |
|---|---|---|
Child (song) | albumArtists, artists, bitDepth, bpm, channelCount, comment, contributors, displayAlbumArtist, displayArtist, displayComposer, explicitStatus, genres, groupings, isrc, mediaType, moods, movements, musicBrainzId, played, replayGain, samplingRate, sortName, works | baseGain and fallbackGain in replayGain |
AlbumID3 | artists, discTitles, displayArtist, explicitStatus, genres, isCompilation, moods, musicBrainzId, originalReleaseDate, played, recordLabels, releaseDate, releaseTypes, sortName, userRating, version | |
ArtistID3 | musicBrainzId, roles, sortName | disambiguation |
NowPlayingEntry | playbackRate, positionMs, state | |
playlist | readonly, validUntil | |
internetRadioStation | coverArt |
In JSON, most of these fields are always present. When the library has no data for a field, its value is empty: "", 0, [], or
{}. In XML, empty fields are omitted. played and validUntil are present only when they have a value.
The original Subsonic fields are different. In JSON, they are omitted when they are empty, and this includes lists. For example, a
search without results returns "searchResult3": {}, and an empty playlist has no entry.
These are the main fields that Navidrome returns and that are not in the OpenSubsonic specification:
| Response | Fields |
|---|---|
AlbumID3 | averageRating |
ArtistID3 | averageRating, userRating. Also, roles can have the value maincredit, for an artist that is an album artist or a track artist |
scanStatus | lastScan (date of the last scan), folderCount, scanType, elapsedTime (in nanoseconds), and error (message from the last scan, if it failed) |
Endpoints
The notes show only the differences from the specification and the extra features. If an endpoint has no notes, it works as the OpenSubsonic documentation describes.
System
| Endpoint | Notes |
|---|---|
ping | |
getLicense | The license is always valid |
getOpenSubsonicExtensions | Needs no credentials |
tokenInfo | Works with all authentication methods |
Browsing endpoints
| Endpoint | Notes |
|---|---|
getMusicFolders | Returns the libraries that the user can access |
getIndexes | Does not return shortcut or child elements. See Browsing |
getMusicDirectory | id is the ID of an artist or an album. See Browsing |
getGenres | |
getArtists | See Browsing |
getArtist | See Browsing |
getAlbum | |
getSong | |
getArtistInfo, getArtistInfo2 | The data comes from external services. With includeNotPresent=true, similar artists that are not in the library have the ID -1 |
getAlbumInfo, getAlbumInfo2 | The data comes from external services. The two endpoints return the same response |
getSimilarSongs, getSimilarSongs2 | Accept the ID of a song, album, artist, or playlist. When external services do not return enough songs, Navidrome adds songs from the library. count is at most 500 |
getTopSongs | Without results from external services, it returns the songs of the artist that the user starred or rated with 5 stars, sorted by play count |
getSonicSimilarTracks | Only when the sonicSimilarity extension is available |
findSonicPath | Only when the sonicSimilarity extension is available |
Album and song lists
| Endpoint | Notes |
|---|---|
getAlbumList, getAlbumList2 | Support all type values. size is at most 500. The X-Total-Count response header has the total number of albums in the list |
getRandomSongs | size is at most 500 |
getSongsByGenre | count is at most 500 |
getNowPlaying | Returns what all users are playing, but only songs from the libraries that the user can access |
getStarred, getStarred2 | Do not return starred playlists |
Searching
| Endpoint | Notes |
|---|---|
search2, search3 | See the rules below |
- An empty
queryreturns everything. Usesearch3with an emptyquery,songCount, andsongOffsetto sync the full library. The artists in the results include composers and other contributors. To find the album artists, checkroles. - Navidrome searches for words that start with the text in
query. Lucene syntax is not supported. - A
querywith a single letter or digit returns no results. - Chinese, Japanese, and Korean text matches any part of a name, not only the start of a word.
- If
queryis a MusicBrainz ID, Navidrome returns the items that have that ID. - There is no maximum for
artistCount,albumCount, andsongCount. To skip one type of result, set its count to0.
Playlists
| Endpoint | Notes |
|---|---|
getPlaylists | Returns the playlists of the user and the public playlists of other users. Administrators get all playlists. Ignores username |
getPlaylist | A smart playlist is read-only. Navidrome updates its songs when its owner calls this endpoint after validUntil |
createPlaylist | With playlistId, replaces all songs and ignores name. Without songId, the playlist keeps its songs. To empty a playlist, use updatePlaylist. Accepts up to 50,000 songs |
updatePlaylist | Removes songs before it adds new ones. songIndexToRemove starts at 0 and refers to the list that getPlaylist returns. Accepts up to 50,000 new songs |
deletePlaylist |
Only the owner and administrators can change a playlist. readonly is true when the user is not the owner, or when the
songs cannot be changed.
Media retrieval
| Endpoint | Notes |
|---|---|
stream | See Streaming |
download | Accepts the ID of a song, album, artist, or playlist. Albums, artists, and playlists are sent as a ZIP file. To transcode, send format and, optionally, bitrate. maxBitRate is ignored, and so is bitrate without format. Without format, the server sends the original files, unless AutoTranscodeDownload is true and the player has a transcoding format |
getTranscodeDecision | See Transcoding decisions |
getTranscodeStream | See Transcoding decisions |
getCoverArt | With square=true, returns a square image. See Cover art |
getLyrics | title must be the title in the file tags, without the subtitle that Navidrome adds to the song title. Prefer getLyricsBySongId |
getLyricsBySongId | Returns lyrics from the file tags, from files such as .lrc and .ttml, and from plugins |
getAvatar | Returns a placeholder image. If Gravatar is enabled in the server, it redirects to the Gravatar of the authenticated user, and returns error 50 for other users |
Media annotation
| Endpoint | Notes |
|---|---|
star, unstar | id accepts the ID of a song, album, artist, or playlist. IDs that do not exist are ignored |
setRating | Accepts the ID of a song, album, artist, or playlist |
scrobble | With submission=false, you can send the current position, in seconds. See Play counts and scrobbling |
reportPlayback | See Play counts and scrobbling |
Bookmarks and play queue
| Endpoint | Notes |
|---|---|
getBookmarks | |
createBookmark | Only for songs. The bookmarkPosition field of the song has the same value that you send in position, in milliseconds |
deleteBookmark | |
getPlayQueue | current is a string ID, not an integer. When the queue is empty, changed is 0001-01-01T00:00:00Z |
savePlayQueue | Call it without id to clear the queue |
getPlayQueueByIndex | |
savePlayQueueByIndex | Call it without id to clear the queue |
Each user has one play queue. All clients of the user share it, and the two pairs of endpoints read and write the same queue.
Sharing
These endpoints are available when EnableSharing is true.
| Endpoint | Notes |
|---|---|
getShares | Returns the shares of the user. Administrators get all shares |
createShare | Accepts the IDs of songs, albums, artists, or playlists, but all IDs must be of the same type. Without expires, the share expires after the time in DefaultShareExpiration (default one year). To allow downloads, send downloadable=true |
updateShare | Also accepts downloadable. Parameters that you do not send keep their values. expires=0 does not remove the expiration date |
deleteShare |
Internet radio
| Endpoint | Notes |
|---|---|
getInternetRadioStations | |
createInternetRadioStation | Only for administrators |
updateInternetRadioStation | Only for administrators |
deleteInternetRadioStation | Only for administrators |
Jukebox
| Endpoint | Notes |
|---|---|
jukeboxControl | Available when Jukebox mode is enabled. By default, only administrators can use it. Check jukeboxRole in getUser |
User management
| Endpoint | Notes |
|---|---|
getUser | username must be the authenticated user. Other users return error 50, even for administrators |
getUsers | Only for administrators. Returns only the authenticated user |
Use only these roles to show or hide features: adminRole, coverArtRole, downloadRole, jukeboxRole, shareRole,
and streamRole. The other roles are always false, even when the feature works. For example, all users can create playlists, but
playlistRole is false.
Library scanning
| Endpoint | Notes |
|---|---|
getScanStatus | Returns extra fields |
startScan | Only for administrators. fullScan=true starts a full scan. To scan only some folders, send one or more target parameters with the format <library ID>:<folder path>. The path is relative to the library, for example target=1:Artist/Album |
Not implemented
Navidrome is a music server, so it will not implement the video endpoints.
| Endpoints | HTTP status | Status |
|---|---|---|
getPodcasts, getNewestPodcasts, refreshPodcasts, createPodcastChannel, deletePodcastChannel, deletePodcastEpisode, downloadPodcastEpisode | 501 | May be added later |
createUser, updateUser, deleteUser, changePassword | 501 | May be added later |
getPodcastEpisode | 404 | Not supported |
search (use search3) | 410 | Will not be added |
getVideos, getVideoInfo, getCaptions, hls | 410 | Will not be added |
getChatMessages, addChatMessage | 410 | Will not be added |
Get help
- To follow the OpenSubsonic work in Navidrome, see the tracking issue. It can include features that are not in a release yet.
- To report a compatibility problem, open an issue.
- To list your client on this site, see Adding apps.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can make this documentation even better.
Sorry to hear that. Please tell us how we can improve this documentation.