π¦ Resources
Every method on the Qobuz client β search, albums, artists, tracks, favourites, and playlists
All methods live on the QobuzClient returned by connect / createQobuzClient, are async, and return mapped camelCase domain types (see the Reference page). List methods take an optional PageOptions β { limit?: number; offset?: number }.
ID types matter. Album ids are strings (e.g.
"0634904032432"); artist, track, and playlist ids are numbers.
π client.search
search(query, options?)
Searches the catalogue across albums, tracks, and artists in one call.
const results = await client.search.search("radiohead", { limit: 10 })
results.albums // Album[]
results.tracks // Track[]
results.artists // Artist[]Returns a SearchResults β { query, albums, tracks, artists }.
πΏ client.albums
get(albumId)
Full album metadata. albumId is a string.
const album = await client.albums.get("0634904032432")
// album.title, album.artist?.name, album.tracksCount, album.releaseDate, album.hiresReturns an Album.
π€ client.artists
get(artistId)
Artist metadata. artistId is a number.
const artist = await client.artists.get(43840)
// artist.name, artist.albumsCountReturns an Artist.
getSimilar(artistId, options?)
Artists similar to the given one.
const similar = await client.artists.getSimilar(43840, { limit: 10 })
// Artist[] β e.g. BjΓΆrk, Alt-J, James Blakeβ¦Returns Artist[].
π΅ client.tracks
get(trackId)
Track metadata, including its album and performing artist. trackId is a number.
const track = await client.tracks.get(33933680)
// track.title, track.artist?.name, track.album?.title, track.durationReturns a Track.
β client.favourites
list(type, options?)
Lists the user's favourites of a given type ("albums" | "artists" | "tracks"). The response always carries all three arrays; the requested type is populated.
const favs = await client.favourites.list("albums", { limit: 50 })
favs.albums // Album[]Returns UserFavourites β { albums, artists, tracks }.
add(type, id)
Adds an item to favourites. id is the entity id as a string.
await client.favourites.add("albums", "0634904032432")remove(type, id)
Removes an item from favourites.
await client.favourites.remove("albums", "0634904032432")π client.playlists
listForUser(options?)
The current user's playlists.
const playlists = await client.playlists.listForUser()
// Playlist[] β id, name, tracksCountReturns Playlist[].
get(playlistId, options?)
A single playlist (with its tracks). playlistId is a number.
const playlist = await client.playlists.get(65996412)Returns a Playlist.
create(params)
Creates a playlist. params is a CreatePlaylistParams β { name, description?, isPublic? }.
const playlist = await client.playlists.create({
name: "Focus",
isPublic: false,
})Returns the new Playlist.
addTracks(playlistId, trackIds)
Adds tracks (by numeric track id) to a playlist.
await client.playlists.addTracks(65996412, [33933680])Returns the updated Playlist.
removeTracks(playlistId, playlistTrackIds)
Removes tracks by their playlist-track id (the id of the track within the playlist, from playlists.get).
await client.playlists.removeTracks(65996412, [playlistTrackId])Returns the updated Playlist.
remove(playlistId)
Deletes a playlist.
await client.playlists.remove(65996412)βΆοΈ client.nowPlaying
nowPlaying(options?)
The track Qobuz is currently playing. macOS doesn't expose Qobuz to its now-playing system, so this reads the desktop app's own queue state at ~/Library/Application Support/Qobuz/player-0.json (macOS only) and fetches the track's metadata.
const track = await client.nowPlaying()
if (track) console.log(`${track.artist?.name} β ${track.title}`)Returns a Track, or undefined if nothing is playing / the desktop app isn't running. Pass { path } to point at a non-default state file.
For just the id (no API call), use the standalone readNowPlayingTrackId export β see the Reference page.