opensubsonic-rs
Complete async Rust client for the OpenSubsonic / Subsonic REST API.
Supports Subsonic API v1.16.1 and OpenSubsonic extensions. Works with Navidrome, Gonic, Ampache, and any other Subsonic-compatible server.
Quick start
use ;
async
Authentication
Two methods are supported:
// Token-based (recommended) — sends MD5(password + salt) + salt
let auth = token;
// Plain text (legacy) — sends hex-encoded password
let auth = plain;
API coverage
All ~80 endpoints from Subsonic API v1.16.1 are implemented, plus OpenSubsonic extensions:
| Category | Endpoints |
|---|---|
| System | ping, getLicense, getOpenSubsonicExtensions, tokenInfo |
| Browsing | getMusicFolders, getIndexes, getMusicDirectory, getGenres, getArtists, getArtist, getAlbum, getSong, getVideos, getArtistInfo/2, getAlbumInfo/2, getSimilarSongs/2, getTopSongs |
| Lists | getAlbumList/2, getRandomSongs, getSongsByGenre, getNowPlaying, getStarred/2 |
| Searching | search, search2, search3 |
| Playlists | getPlaylists, getPlaylist, createPlaylist, updatePlaylist, deletePlaylist |
| Media Retrieval | stream, download, hls, getCaptions, getCoverArt, getLyrics, getLyricsBySongId, getAvatar |
| Media Annotation | star, unstar, setRating, scrobble |
| Sharing | getShares, createShare, updateShare, deleteShare |
| Podcast | getPodcasts, getNewestPodcasts, getPodcastEpisode, refreshPodcasts, createPodcastChannel, deletePodcastChannel, deletePodcastEpisode, downloadPodcastEpisode |
| Jukebox | jukeboxControl |
| Internet Radio | getInternetRadioStations, createInternetRadioStation, updateInternetRadioStation, deleteInternetRadioStation |
| Chat | getChatMessages, addChatMessage |
| User Management | getUser, getUsers, createUser, updateUser, deleteUser, changePassword |
| Bookmarks | getBookmarks, createBookmark, deleteBookmark, getPlayQueue, savePlayQueue, getPlayQueueByIndex, savePlayQueueByIndex |
| Scanning | getScanStatus, startScan |
| Transcoding | getTranscodeDecision, getTranscodeStream (OpenSubsonic) |
Builder options
let client = new?
.with_client_name // Custom client identifier (default: "opensubsonic-rs")
.with_api_version // Override protocol version (default: "1.16.1")
.with_http_client; // Inject a custom reqwest::Client
URL builders
Some methods build URLs without making HTTP requests, useful for passing to audio players:
let stream_url = client.stream_url?;
let cover_url = client.cover_art_url?;
let hls_url = client.hls_url?;
Dependencies
- reqwest 0.13 (async HTTP, rustls TLS)
- serde / serde_json (JSON serialization)
- tokio (async runtime, dev-dependency)
Minimum supported Rust version: 1.85 (edition 2024).
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.