PrivateAPI#
- class minim.qobuz.PrivateAPI(*, app_id: str = None, app_secret: str = None, flow: str = None, browser: bool = False, user_agent: str = None, email: str = None, password: str = None, auth_token: str = None, overwrite: bool = False, save: bool = True)[source]#
Bases:
object
Private Qobuz API client.
The private TIDAL API allows songs, collections (albums, playlists), and performers to be queried, and information about them to be retrieved. As there is no available official documentation for the private Qobuz API, its endpoints have been determined by watching HTTP network traffic.
Attention
As the private Qobuz API is not designed to be publicly accessible, this class can be disabled or removed at any time to ensure compliance with the Qobuz API Terms of Use.
While authentication is not necessary to search for and retrieve data from public content, it is required to access personal content and stream media (with an active Qobuz subscription). In the latter case, requests to the private Qobuz API endpoints must be accompanied by a valid user authentication token in the header.
Minim can obtain user authentication tokens via the password grant, but it is an inherently unsafe method of authentication since it has no mechanisms for multifactor authentication or brute force attack detection. As such, it is highly encouraged that you obtain a user authentication token yourself through the Qobuz Web Player or the Android, iOS, macOS, and Windows applications, and then provide it and its accompanying app ID and secret to this class’s constructor as keyword arguments. The app credentials can also be stored as
QOBUZ_PRIVATE_APP_ID
andQOBUZ_PRIVATE_APP_SECRET
in the operating system’s environment variables, and they will automatically be retrieved.Tip
The app credentials and user authentication token can be changed or updated at any time using
set_flow()
andset_auth_token()
, respectively.Minim also stores and manages user authentication tokens and their properties. When the password grant is used to acquire a user authentication token, it is automatically saved to the Minim configuration file to be loaded on the next instantiation of this class. This behavior can be disabled if there are any security concerns, like if the computer being used is a shared device.
- Parameters:
- app_idstr, keyword-only, optional
App ID. Required if an user authentication token is provided in auth_token.
- app_secretstr, keyword-only, optional
App secret. Required if an user authentication token is provided in auth_token.
- flowstr, keyword-only, optional
Authorization flow.
Valid values:
"password"
for the password flow.None
for no authentication.
- browserbool, keyword-only, default:
False
Determines whether a web browser is opened with the Qobuz login page using the Playwright framework by Microsoft to complete the password flow. If
False
, the account email and password must be provided in email and password, respectively.- user_agentstr, keyword-only, optional
User agent information to send in the header of HTTP requests.
- emailstr, keyword-only, optional
Account email address. Required if an user authentication token is not provided in auth_token and
browser=False
.- passwordstr, keyword-only, optional
Account password. Required if an user authentication token is not provided in auth_token and
browser=False
.- auth_tokenstr, keyword-only, optional
User authentication token. If provided here or found in the Minim configuration file, the authentication process is bypassed.
- overwritebool, keyword-only, default:
False
Determines whether to overwrite an existing user authentication token in the Minim configuration file.
- savebool, keyword-only, default:
True
Determines whether newly obtained user authentication tokens and their associated properties are stored to the Minim configuration file.
- Attributes:
- API_URLstr
URL for the Qobuz API.
- WEB_URLstr
URL for the Qobuz Web Player.
Methods
Add tracks to a user playlist.
Create a user playlist.
Delete a user playlist.
Delete tracks from a user playlist.
Favorite albums, artists, and/or tracks.
Subscribe to a playlist.
Get Qobuz catalog information for a single album.
Get Qobuz catalog information for a single artist.
Get audio stream data for all tracks in an album or a playlist.
Get weekly curated tracks for the user.
Get the current user's favorite albums, artists, and tracks.
Get Qobuz catalog information for featured albums.
Get Qobuz catalog information for featured playlists.
Get Qobuz catalog information for a record label.
Get Qobuz catalog information for a playlist.
Get the current user's profile information.
Get the current user's purchases.
Get Qobuz catalog information for a track.
Get the file URL for a track.
Get credits for a track.
Get the audio stream data for a track.
Get the current user's custom and favorite playlists.
Move tracks in a user playlist.
Search Qobuz for media and performers.
Set the private Qobuz API user authentication token.
Set the authorization flow.
Unfavorite albums, artists, and/or tracks.
Unsubscribe from a playlist.
Update the title, description, and/or privacy of a playlist owned by the current user.
Organize a user's playlists.
- add_playlist_tracks(playlist_id: int | str, track_ids: int | str | list[int | str], *, duplicate: bool = False) dict[str, Any] [source]#
Add tracks to a user playlist.
User authentication
Requires user authentication via the password flow.
- Parameters:
- playlist_idint or str
Qobuz user playlist ID.
Example:
17737508
.- track_idsint, str, or list
Qobuz track ID(s).
Examples:
"24393122,24393138"
or[24393122, 24393138]
.- duplicatebool, keyword-only, default:
False
Determines whether duplicate tracks should be added to the playlist.
- Returns:
- playliststr
Qobuz catalog information for the updated playlist.
Sample response
{ "id": <int>, "name": <str>, "description": <str>, "tracks_count": <int>, "users_count": <int>, "duration": <int>, "public_at": <int>, "created_at": <int>, "updated_at": <int>, "is_public": <bool>, "is_collaborative": <bool>, "owner": { "id": <int>, "name": <str> } }
- create_playlist(name: str, *, description: str = None, public: bool = True, collaborative: bool = False) dict[str, Any] [source]#
Create a user playlist.
User authentication
Requires user authentication via the password flow.
- Parameters:
- namestr
Qobuz playlist name.
- descriptionstr, keyword-only, optional
Brief playlist description.
- publicbool, keyword-only, default:
True
Determines whether the playlist is public (
True
) or private (False
).- collaborativebool, keyword-only, default:
False
Determines whether the playlist is collaborative.
- Returns:
- playliststr
Qobuz catalog information for the newly created playlist.
Sample response
{ "id": <int>, "name": <str>, "description": <str>, "tracks_count": <int>, "users_count": <int>, "duration": <int>, "public_at": <int>, "created_at": <int>, "updated_at": <int>, "is_public": <bool>, "is_collaborative": <bool>, "owner": { "id": <int>, "name": <str> } }
- delete_playlist(playlist_id: int | str) None [source]#
Delete a user playlist.
User authentication
Requires user authentication via the password flow.
- Parameters:
- playlist_idint or str
Qobuz user playlist ID.
Example:
17737508
.
- delete_playlist_tracks(playlist_id: int | str, playlist_track_ids: int | str | list[int | str]) dict[str, Any] [source]#
Delete tracks from a user playlist.
User authentication
Requires user authentication via the password flow.
- Parameters:
- playlist_idint or str
Qobuz user playlist ID.
Example:
17737508
.- playlist_track_idsint, str, or list
Qobuz playlist track ID(s).
Note
Playlist track IDs are not the same as track IDs. To get playlist track IDs, use
get_playlist()
.
- Returns:
- playliststr
Qobuz catalog information for the updated playlist.
Sample response
{ "id": <int>, "name": <str>, "description": <str>, "tracks_count": <int>, "users_count": <int>, "duration": <int>, "public_at": <int>, "created_at": <int>, "updated_at": <int>, "is_public": <bool>, "is_collaborative": <bool>, "owner": { "id": <int>, "name": <str> } }
- favorite_items(*, album_ids: str | list[str] = None, artist_ids: int | str | list[int | str] = None, track_ids: int | str | list[int | str] = None) None [source]#
Favorite albums, artists, and/or tracks.
User authentication
Requires user authentication via the password flow.
See also
For playlists, use
favorite_playlist()
.- Parameters:
- album_idsstr or list, keyword-only, optional
Qobuz album ID(s).
- artist_idsint, str, or list, keyword-only, optional
Qobuz artist ID(s).
- track_idsint, str, or list, keyword-only, optional
Qobuz track ID(s).
- favorite_playlist(playlist_id: int | str) None [source]#
Subscribe to a playlist.
User authentication
Requires user authentication via the password flow.
- Parameters:
- playlist_idint or str
Qobuz playlist ID.
Example:
15732665
.
- get_album(album_id: str) dict[str, Any] [source]#
Get Qobuz catalog information for a single album.
- Parameters:
- album_idstr
Qobuz album ID.
Example:
"0060254735180"
.
- Returns:
- albumdict
Qobuz catalog information for a single album.
Sample response
{ "maximum_bit_depth": <int>, "image": { "small": <str>, "thumbnail": <str>, "large": <str>, "back": <str> }, "media_count": <str>, "artist": { "image": <str>, "name": <str>, "id": <int>, "albums_count": <int>, "slug": <str>, "picture": <str> }, "artists": [ { "id": <int>, "name": <str>, "roles": [<str>] } ], "upc": <str>, "released_at": <int>, "label": { "name": <str>, "id": <int>, "albums_count": <int>, "supplier_id": <int>, "slug": <str> }, "title": <str>, "qobuz_id": <int>, "version": <str>, "url": <str>, "duration": <int>, "parental_warning": <bool>, "popularity": <int>, "tracks_count": <int>, "genre": { "path": [<int>], "color": <str>, "name": <str>, "id": <int>, "slug": <str> }, "maximum_channel_count": <int>, "id": <str>, "maximum_sampling_rate": <int>, "articles": <list>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "purchasable": <bool>, "streamable": <bool>, "previewable": <bool>, "sampleable": <bool>, "downloadable": <bool>, "displayable": <bool>, "purchasable_at": <int>, "streamable_at": <int>, "hires": <bool>, "hires_streamable": <bool>, "awards": <list>, "description": <str>, "description_language": <str>, "goodies": <list>, "area": <str>, "catchline": <str>, "composer": { "id": <int>, "name": <str>, "slug": <str>, "albums_count": <int>, "picture": <str>, "image": <str> }, "created_at": <int>, "genres_list": [<str>], "period": <str>, "copyright": <str>, "is_official": <bool>, "maximum_technical_specifications": <str>, "product_sales_factors_monthly": <int>, "product_sales_factors_weekly": <int>, "product_sales_factors_yearly": <int>, "product_type": <str>, "product_url": <str>, "recording_information": <str>, "relative_url": <str>, "release_tags": <list>, "release_type": <str>, "slug": <str>, "subtitle": <str>, "tracks": { "offset": <int>, "limit": <int>, "total": <int>, "items": [ { "maximum_bit_depth": <int>, "copyright": <str>, "performers": <str>, "audio_info": { "replaygain_track_peak": <float>, "replaygain_track_gain": <float> }, "performer": { "name": <str>, "id": <int> }, "work": <str>, "composer": { "name": <str>, "id": <int> }, "isrc": <str>, "title": <str>, "version": <str>, "duration": <int>, "parental_warning": <bool>, "track_number": <int>, "maximum_channel_count": <int>, "id": <int>, "media_number": <int>, "maximum_sampling_rate": <int>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "release_date_purchase": <str>, "purchasable": <bool>, "streamable": <bool>, "previewable": <bool>, "sampleable": <bool>, "downloadable": <bool>, "displayable": <bool>, "purchasable_at": <int>, "streamable_at": <int>, "hires": <bool>, "hires_streamable": <bool> } ] } }
- get_artist(artist_id: int | str, *, extras: str | list[str] = None, limit: int = None, offset: int = None) dict[str, Any] [source]#
Get Qobuz catalog information for a single artist.
- Parameters:
- artist_idint or str
Qobuz artist ID.
- extrasstr or list, keyword-only, optional
Specifies extra information about the artist to return.
Valid values:
"albums"
,"tracks"
,"playlists"
,"tracks_appears_on"
, and"albums_with_last_release"
.- limitint, keyword-only, optional
The maximum number of extra items to return. Has no effect if
extras=None
.Default:
25
.- offsetint, keyword-only, optional
The index of the first extra item to return. Use with limit to get the next page of extra items. Has no effect if
extras=None
.Default:
0
.
- Returns:
- artistdict
Qobuz catalog information for a single artist.
Sample response
{ "id": <int>, "name": <str>, "albums_as_primary_artist_count": <int>, "albums_as_primary_composer_count": <int>, "albums_count": <int>, "slug": <str>, "picture": <str>, "image": { "small": <str>, "medium": <str>, "large": <str>, "extralarge": <str>, "mega": <str> }, "similar_artist_ids": [<int>], "information": <str>, "biography": { "summary": <str>, "content": <str>, "source": <str>, "language": <str> } }
- get_collection_streams(id: int | str, type: str, *, format_id: int | str = 27) list[tuple[bytes, str]] [source]#
Get audio stream data for all tracks in an album or a playlist.
Subscription
Full track playback information and lossless and Hi-Res audio is only available with an active Qobuz subscription.
Note
This method is provided for convenience and is not a private Qobuz API endpoint.
- Parameters:
- idint or str
Qobuz collection ID.
- typestr
Collection type.
Valid values:
"album"
and"playlist"
.- format_idint, default:
27
Audio format ID that determines the maximum audio quality.
Valid values:
5
for constant bitrate (320 kbps) MP3.6
for CD-quality (16-bit, 44.1 kHz) FLAC.7
for up to 24-bit, 96 kHz Hi-Res FLAC.27
for up to 24-bit, 192 kHz Hi-Res FLAC.
- Returns:
- streamslist
Audio stream data.
- get_curated_tracks() list[dict[str, Any]] [source]#
Get weekly curated tracks for the user.
User authentication
Requires user authentication via the password flow.
- Parameters:
- limitint, keyword-only, optional
The maximum number of tracks to return.
Default:
50
.- offsetint, keyword-only, optional
The index of the first track to return. Use with limit to get the next page of tracks.
Default:
0
.
- Returns:
- trackslist
Qobuz catalog information for the curated tracks.
Sample response
{ "title": <str>, "baseline": <str>, "description": <str>, "type": "weekly", "step_pagination": <int>, "images": { "small": <str>, "large": <str> }, "graphics": { "background": <str>, "foreground": <str> }, "duration": <int>, "generated_at": <int>, "expires_on": <int>, "track_count": <int>, "tracks": { "offset": <int>, "limit": <int>, "items": [ { "maximum_bit_depth": <int>, "copyright": <str>, "performers": <str>, "audio_info": { "replaygain_track_peak": <float>, "replaygain_track_gain": <float> }, "performer": { "name": <str>, "id": <int> }, "album": { "image": { "small": <str>, "thumbnail": <str>, "large": <str> }, "maximum_bit_depth": <int>, "media_count": <int>, "artist": { "image": <str>, "name": <str>, "id": <int>, "albums_count": <int>, "slug":<str>, "picture": <str> }, "upc": <str>, "released_at": <int>, "label": { "name": <str>, "id": <int>, "albums_count": <int>, "supplier_id": <int>, "slug": <str> }, "title": <str>, "qobuz_id": <int>, "version": <str>, "duration": <int>, "parental_warning": <bool>, "tracks_count": <int>, "popularity": <int>, "genre": { "path": [<int>], "color": <str>, "name": <str>, "id": <int>, "slug": <str> }, "maximum_channel_count": <int>, "id": <str>, "maximum_sampling_rate": <int>, "previewable": <bool>, "sampleable": <bool>, "displayable": <bool>, "streamable": <bool>, "streamable_at": <int>, "downloadable": <bool>, "purchasable_at": <int>, "purchasable": <bool>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "release_date_purchase": <str>, "hires": <bool>, "hires_streamable": <bool> }, "work": <str>, "composer": { "name": <str>, "id": <int> }, "isrc": <str>, "title": <str>, "version": <str>, "duration": <int>, "parental_warning": <bool>, "track_number": <int>, "maximum_channel_count": <int>, "id": <int>, "media_number": <int>, "maximum_sampling_rate": <int>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "release_date_purchase": <str>, "purchasable": <bool>, "streamable": <bool>, "previewable": <bool>, "sampleable": <bool>, "downloadable": <bool>, "displayable": <bool>, "purchasable_at": <int>, "streamable_at": <int>, "hires": <bool>, "hires_streamable": <bool> } ] } }
- get_favorites(type: str = None, *, limit: int = None, offset: int = None) dict[str, dict] [source]#
Get the current user’s favorite albums, artists, and tracks.
User authentication
Requires user authentication via the password flow.
- Parameters:
- typestr
Media type to return. If not specified, all of the user’s favorite items are returned.
Valid values:
"albums"
,"artists"
, and"tracks"
.- limitint, keyword-only, optional
The maximum number of favorited items to return.
Default:
50
.- offsetint, keyword-only, optional
The index of the first favorited item to return. Use with limit to get the next page of favorited items.
Default:
0
.
- Returns:
- favoritesdict
A dictionary containing Qobuz catalog information for the current user’s favorite items and the user’s ID and email.
Sample response
{ "albums": { "offset": <int>, "limit": <int>, "total": <int>, "items": <list> }, "user": { "id": <int>, "login": <str> } }
- get_featured_albums(type: str = 'new-releases', *, limit: int = None, offset: int = None) dict[str, Any] [source]#
Get Qobuz catalog information for featured albums.
- Parameters:
- typestr, default:
"new-releases"
Feature type.
Valid values:
"best-sellers"
,"editor-picks"
,"ideal-discography"
,"most-featured"
,"most-streamed"
,"new-releases"
,"new-releases-full"
,"press-awards"
,"recent-releases"
,"qobuzissims"
,"harmonia-mundi"
,"universal-classic"
,"universal-jazz"
,"universal-jeunesse"
, and"universal-chanson"
.- limitint, keyword-only, optional
The maximum number of albums to return.
Default:
50
.- offsetint, keyword-only, optional
The index of the first album to return. Use with limit to get the next page of albums.
Default:
0
.
- typestr, default:
- Returns:
- albumsdict
Qobuz catalog information for the albums.
Sample response
{ "albums": { "total": <int>, "limit": <int>, "offset": <int>, "items": [ { "maximum_bit_depth": <int>, "image": { "small": <str>, "thumbnail": <str>, "large": <str>, "back": <str> }, "media_count": <str>, "artist": { "image": <str>, "name": <str>, "id": <int>, "albums_count": <int>, "slug": <str>, "picture": <str> }, "artists": [ { "id": <int>, "name": <str>, "roles": [<str>] } ], "upc": <str>, "released_at": <int>, "label": { "name": <str>, "id": <int>, "albums_count": <int>, "supplier_id": <int>, "slug": <str> }, "title": <str>, "qobuz_id": <int>, "version": <str>, "url": <str>, "duration": <int>, "parental_warning": <bool>, "popularity": <int>, "tracks_count": <int>, "genre": { "path": [<int>], "color": <str>, "name": <str>, "id": <int>, "slug": <str> }, "maximum_channel_count": <int>, "id": <str>, "maximum_sampling_rate": <int>, "articles": <list>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "purchasable": <bool>, "streamable": <bool>, "previewable": <bool>, "sampleable": <bool>, "downloadable": <bool>, "displayable": <bool>, "purchasable_at": <int>, "streamable_at": <int>, "hires": <bool>, "hires_streamable": <bool> } ] } }
- get_featured_playlists(type: str = 'editor-picks', *, limit: int = None, offset: int = None) dict[str, Any] [source]#
Get Qobuz catalog information for featured playlists.
- Parameters:
- typestr, default:
"editor-picks"
Feature type.
Valid values:
"editor-picks"
and"last-created"
.- limitint, keyword-only, optional
The maximum number of playlists to return.
Default:
50
.- offsetint, keyword-only, optional
The index of the first playlist to return. Use with limit to get the next page of playlists.
Default:
0
.
- typestr, default:
- Returns:
- playlistsdict
Qobuz catalog information for the playlists.
Sample response
{ "offset": <int>, "limit": <int>, "total": <int>, "items": [ { "owner": { "name": <str>, "id": <int> }, "image_rectangle_mini": [<str>], "users_count": <int>, "images150": [<str>], "images": [<str>], "featured_artists": <list>, "is_collaborative": <bool>, "stores": [<str>], "description": <str>, "created_at": <int>, "images300": [<str>], "tags": [ { "color": <str>, "is_discover": <bool>, "featured_tag_id": <str>, "name_json": <str>, "slug": <str>, "genre_tag": <str> } ], "duration": <int>, "updated_at": <int>, "genres": [ { "path": [<int>], "color": <str>, "name": <str>, "id": <int>, "percent": <float>, "slug": <str> } ], "image_rectangle": [<str>], "tracks_count": <int>, "public_at": <int>, "name": <str>, "is_public": <bool>, "id": <int>, "slug": <str>, "is_featured": <bool> } ] }
- get_label(label_id: int | str, *, albums: bool = False, limit: int = None, offset: int = None) dict[str, Any] [source]#
Get Qobuz catalog information for a record label.
- Parameters:
- label_idint or str
Qobuz record label ID.
Example:
1153
.- albumsbool, keyword-only, default:
False
Specifies whether information on the albums released by the record label is returned.
- limitint, keyword-only, optional
The maximum number of albums to return. Has no effect if
albums=False
.Default:
25
.- offsetint, keyword-only, optional
The index of the first album to return. Use with limit to get the next page of albums. Has no effect if
albums=False
.Default:
0
.
- Returns:
- labeldict
Qobuz catalog information for the record label.
Sample response
{ "id": <int>, "name": <str>, "slug": <str>, "supplier_id": <int>, "albums_count": <int>, "image": <str>, "description": <str> }
- get_playlist(playlist_id: int | str, *, tracks: bool = True, limit: int = None, offset: int = None) dict[str, Any] [source]#
Get Qobuz catalog information for a playlist.
- Parameters:
- playlist_idint or str
Qobuz playlist ID.
Example:
15732665
.- tracksbool, keyword-only, default:
True
Specifies whether information on the tracks in the playlist is returned.
- limitint, keyword-only, optional
The maximum number of tracks to return. Has no effect if
tracks=False
.Default:
50
.- offsetint, keyword-only, optional
The index of the first track to return. Use with limit to get the next page of tracks. Has no effect if
tracks=False
.Default:
0
.
- Returns:
- playlistdict
Qobuz catalog information for the playlist.
Sample response
{ "image_rectangle_mini": [<str>], "featured_artists": <list>, "description": <str>, "created_at": <int>, "timestamp_position": <int>, "images300": [<str>], "duration": <int>, "updated_at": <int>, "genres": [ { "id": <int>, "color": <str>, "name": <str>, "path": [<int>], "slug": <str>, "percent": <float> } ], "image_rectangle": [<str>], "id": <int>, "slug": <str>, "owner": { "id": <int>, "name": <str> }, "users_count": <int>, "images150": [<str>], "images": [<str>], "is_collaborative": <bool>, "stores": [<str>], "tags": [ { "featured_tag_id": <str>, "name_json": <str>, "slug": <str>, "color": <str>, "genre_tag": <str>, "is_discover": <bool> } ], "tracks_count": <int>, "public_at": <int>, "name": <str>, "is_public": <bool>, "is_featured": <bool>, "tracks": { "offset": <int>, "limit": <int>, "total": <int>, "items": [ { "maximum_bit_depth": <int>, "copyright": <str>, "performers": <str>, "audio_info": { "replaygain_track_peak": <float>, "replaygain_track_gain": <float> }, "performer": { "name": <str>, "id": <int> }, "album": { "image": { "small": <str>, "thumbnail": <str>, "large": <str> }, "maximum_bit_depth": <int>, "media_count": <int>, "artist": { "image": <str>, "name": <str>, "id": <int>, "albums_count": <int>, "slug": <str>, "picture": <str> }, "upc": <str>, "released_at": <int>, "label": { "name": <str>, "id": <int>, "albums_count": <int>, "supplier_id": <int>, "slug": <str> }, "title": <str>, "qobuz_id": <int>, "version": <str>, "duration": <int>, "parental_warning": <bool>, "tracks_count": <int>, "popularity": <int>, "genre": { "path": [<int>], "color": <str>, "name": <str>, "id": <int>, "slug": <str> }, "maximum_channel_count": <int>, "id": <str>, "maximum_sampling_rate": <int>, "previewable": <bool>, "sampleable": <bool>, "displayable": <bool>, "streamable": <bool>, "streamable_at": <int>, "downloadable": <bool>, "purchasable_at": <int>, "purchasable": <bool>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "release_date_purchase": <str>, "hires": <bool>, "hires_streamable": <bool> }, "work": <str>, "isrc": <str>, "title": <str>, "version": null, "duration": <int>, "parental_warning": <bool>, "track_number": <int>, "maximum_channel_count": <int>, "id": <int>, "media_number": <int>, "maximum_sampling_rate": <int>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "release_date_purchase": <str>, "purchasable": <bool>, "streamable": <bool>, "previewable": <bool>, "sampleable": <bool>, "downloadable": <bool>, "displayable": <bool>, "purchasable_at": <int>, "streamable_at": <int>, "hires": <bool>, "hires_streamable": <bool>, "position": <int>, "created_at": <int>, "playlist_track_id": <int> } ] } }
- get_profile() dict[str, Any] [source]#
Get the current user’s profile information.
User authentication
Requires user authentication via the password flow.
- Returns:
- profiledict
A dictionary containing the current user’s profile information.
Sample response
{ "id": <int>, "publicId": <str>, "email": <str>, "login": <str>, "firstname": <str>, "lastname": <str>, "display_name": <str>, "country_code": <str>, "language_code": <str>, "zone": <str>, "store": <str>, "country": <str>, "avatar": <str>, "genre": <str>, "age": <int>, "creation_date": <str>, "subscription": { "offer": <str>, "periodicity": <str>, "start_date": <str>, "end_date": <str>, "is_canceled": <bool>, "household_size_max": <int> }, "credential": { "id": <int>, "label": <str>, "description": <str>, "parameters": { "lossy_streaming": <bool>, "lossless_streaming": <bool>, "hires_streaming": <bool>, "hires_purchases_streaming": <bool>, "mobile_streaming": <bool>, "offline_streaming": <bool>, "hfp_purchase": <bool>, "included_format_group_ids": [<int>], "color_scheme": { "logo": <str> }, "label": <str>, "short_label": <str>, "source": <str> } }, "last_update": { "favorite": <int>, "favorite_album": <int>, "favorite_artist": <int>, "favorite_track": <int>, "playlist": <int>, "purchase": <int> }, "store_features": { "download": <bool>, "streaming": <bool>, "editorial": <bool>, "club": <bool>, "wallet": <bool>, "weeklyq": <bool>, "autoplay": <bool>, "inapp_purchase_subscripton": <bool>, "opt_in": <bool>, "music_import": <bool> } }
- get_purchases(type: str = 'albums', *, limit: int = None, offset: int = None) dict[str, Any] [source]#
Get the current user’s purchases.
User authentication
Requires user authentication via the password flow.
- Parameters:
- typestr, default:
"albums"
Media type.
Valid values:
"albums"
and"tracks"
.- limitint, keyword-only, optional
The maximum number of albums or tracks to return.
Default:
50
.- offsetint, keyword-only, optional
The index of the first album or track to return. Use with limit to get the next page of albums or tracks.
Default:
0
.
- typestr, default:
- Returns:
- purchasesdict
A dictionary containing Qobuz catalog information for the current user’s purchases.
Sample response
{ "offset": <int>, "limit": <int>, "total": <int>, "items": <list> }
- get_track(track_id: int | str) dict[str, Any] [source]#
Get Qobuz catalog information for a track.
- Parameters:
- track_idint or str
Qobuz track ID.
Example:
24393138
.
- Returns:
- trackdict
Qobuz catalog information for the track.
Sample response
{ "maximum_bit_depth": <int>, "copyright": <str>, "performers": <str>, "audio_info": { "replaygain_track_gain": <float>, "replaygain_track_peak": <float> }, "performer": { "id": <int>, "name": <str> }, "album": { "maximum_bit_depth": <int>, "image": { "small": <str>, "thumbnail": <str>, "large": <str>, "back": <str> }, "media_count": <int>, "artist": { "image": <str>, "name": <str>, "id": <int>, "albums_count": <int>, "slug": <str>, "picture": <str> }, "artists": [ { "id": <int>, "name": <str>, "roles": [<str>] } ], "upc": <str>, "released_at": <int>, "label": { "name": <str>, "id": <int>, "albums_count": <int>, "supplier_id": <int>, "slug": <str> }, "title": <str>, "qobuz_id": <int>, "version": <str>, "url": <str>, "duration": <int>, "parental_warning": <bool>, "popularity": <int>, "tracks_count": <int>, "genre": { "path": [<int>], "color": <str>, "name": <str>, "id": <int>, "slug": <str> }, "maximum_channel_count": <int>, "id": <str>, "maximum_sampling_rate": <int>, "articles": <list>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "purchasable": <bool>, "streamable": <bool>, "previewable": <bool>, "sampleable": <bool>, "downloadable": <bool>, "displayable": <bool>, "purchasable_at": <int>, "streamable_at": <int>, "hires": <bool>, "hires_streamable": <bool>, "awards": <list>, "description": <str>, "description_language": <str>, "goodies": <list>, "area": null, "catchline": <str>, "composer": { "id": <int>, "name": <str>, "slug": <str>, "albums_count": <int>, "picture": <str>, "image": <str> }, "created_at": <int>, "genres_list": [<str>], "period": <str>, "copyright": <str>, "is_official": <bool>, "maximum_technical_specifications": <str>, "product_sales_factors_monthly": <int>, "product_sales_factors_weekly": <int>, "product_sales_factors_yearly": <int>, "product_type": <str>, "product_url": <str>, "recording_information": <str>, "relative_url": <str>, "release_tags": <list>, "release_type": <str>, "slug": <str>, "subtitle": <str> }, "work": <str>, "composer": { "id": <int>, "name": <str> }, "isrc": <str>, "title": <str>, "version": <str>, "duration": <int>, "parental_warning": <bool>, "track_number": <int>, "maximum_channel_count": <int>, "id": <int>, "media_number": <int>, "maximum_sampling_rate": <int>, "articles": <list>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "release_date_purchase": <str>, "purchasable": <bool>, "streamable": <bool>, "previewable": <bool>, "sampleable": <bool>, "downloadable": <bool>, "displayable": <bool>, "purchasable_at": <int>, "streamable_at": <int>, "hires": <bool>, "hires_streamable": <bool> }
- get_track_file_url(track_id: int | str, format_id: int | str = 27) dict[str, Any] [source]#
Get the file URL for a track.
Subscription
Full track playback information and lossless and Hi-Res audio is only available with an active Qobuz subscription.
- Parameters:
- track_idint or str
Qobuz track ID.
Example:
24393138
.- format_idint or str, default:
27
Audio format ID that determines the maximum audio quality.
Valid values:
5
for constant bitrate (320 kbps) MP3.6
for CD-quality (16-bit, 44.1 kHz) FLAC.7
for up to 24-bit, 96 kHz Hi-Res FLAC.27
for up to 24-bit, 192 kHz Hi-Res FLAC.
- Returns:
- urldict
A dictionary containing the URL and track information, such as the audio format, bit depth, etc.
Sample response
{ "track_id": <int>, "duration": <int>, "url": <str>, "format_id": <int>, "mime_type": <str>, "restrictions": [ { "code": <str> } ], "sampling_rate": <int>, "bit_depth": <int> }
- get_track_performers(track_id: int | str = None, *, performers: str = None, roles: list[str] | set[str] = None) dict[str, list] [source]#
Get credits for a track.
Note
This method is provided for convenience and is not a private Qobuz API endpoint.
- Parameters:
- track_idint or str, optional
Qobuz track ID. Required if performers is not provided.
Example:
24393138
.- performersstr, keyword-only, optional
An unformatted string containing the track credits obtained from calling
get_track()
.- roleslist or set, keyword-only, optional
Role filter. The special
"Composers"
filter will combine the"Composer"
,"ComposerLyricist"
,"Lyricist"
, and"Writer"
roles.Valid values:
"MainArtist"
,"FeaturedArtist"
,"Producer"
,"Co-Producer"
,"Mixer"
,"Composers"
("Composer"
,"ComposerLyricist"
,"Lyricist"
,"Writer"
),"MusicPublisher"
, etc.
- Returns:
- creditsdict
A dictionary containing the track contributors, with their roles (in snake case) being the keys.
- get_track_stream(track_id: int | str, *, format_id: int | str = 27) tuple[bytes, str] [source]#
Get the audio stream data for a track.
Subscription
Full track playback information and lossless and Hi-Res audio is only available with an active Qobuz subscription.
Note
This method is provided for convenience and is not a private Qobuz API endpoint.
- Parameters:
- track_idint or str
Qobuz track ID.
Example:
24393138
.- format_idint, default:
27
Audio format ID that determines the maximum audio quality.
Valid values:
5
for constant bitrate (320 kbps) MP3.6
for CD-quality (16-bit, 44.1 kHz) FLAC.7
for up to 24-bit, 96 kHz Hi-Res FLAC.27
for up to 24-bit, 192 kHz Hi-Res FLAC.
- Returns:
- streambytes
Audio stream data.
- mime_typestr
Audio stream MIME type.
- get_user_playlists(*, limit: int = None, offset: int = None) dict[str, Any] [source]#
Get the current user’s custom and favorite playlists.
User authentication
Requires user authentication via the password flow.
- Parameters:
- limitint, keyword-only, optional
The maximum number of playlists to return.
Default:
500
.- offsetint, keyword-only, optional
The index of the first playlist to return. Use with limit to get the next page of playlists.
Default:
0
.
- Returns:
- playlistsdict
Qobuz catalog information for the current user’s custom and favorite playlists.
Sample response
{ "offset": <int>, "limit": <int>, "total": <int>, "items": [ { "image_rectangle_mini": [<str>], "is_published": <bool>, "featured_artists": <list>, "description": <str>, "created_at": <int>, "timestamp_position": <int>, "images300": [<str>], "duration": <int>, "updated_at": <int>, "published_to": <int>, "genres": <list>, "image_rectangle": [<str>], "id": <int>, "slug": <str>, "owner": { "id": <int>, "name": <str> }, "users_count": <int>, "images150": [<str>], "images": [<str>], "is_collaborative": <bool>. "stores": [<str>], "tracks_count": <int>, "public_at": <int>, "name": "Welcome to Qobuz", "is_public": <bool>, "published_from": <int>, "is_featured": <bool>, "position": <int> } ] }
- move_playlist_tracks(playlist_id: int | str, playlist_track_ids: int | str | list[int | str], insert_before: int) dict[str, Any] [source]#
Move tracks in a user playlist.
User authentication
Requires user authentication via the password flow.
- Parameters:
- playlist_idint or str
Qobuz user playlist ID.
Example:
17737508
.- playlist_track_idsint, str, or list
Qobuz playlist track ID(s).
Note
Playlist track IDs are not the same as track IDs. To get playlist track IDs, use
get_playlist()
.- insert_beforeint
Position to which to move the tracks specified in track_ids.
- Returns:
- playliststr
Qobuz catalog information for the updated playlist.
Sample response
{ "id": <int>, "name": <str>, "description": <str>, "tracks_count": <int>, "users_count": <int>, "duration": <int>, "public_at": <int>, "created_at": <int>, "updated_at": <int>, "is_public": <bool>, "is_collaborative": <bool>, "owner": { "id": <int>, "name": <str> } }
- search(query: str, type: str = None, *, hi_res: bool = False, new_release: bool = False, strict: bool = False, limit: int = 10, offset: int = 0) dict[str, Any] [source]#
Search Qobuz for media and performers.
- Parameters:
- querystr
Search query.
- typestr, keyword-only, optional
Category to search in. If specified, only matching releases and tracks will be returned.
Valid values:
"MainArtist"
,"Composer"
,"Performer"
,"ReleaseName"
, and"Label"
.- hi_resbool, keyword-only,
False
High-resolution audio only.
- new_releasebool, keyword-only,
False
New releases only.
- strictbool, keyword-only,
False
Enable exact word or phrase matching.
- limitint, keyword-only, default:
10
Maximum number of results to return.
- offsetint, keyword-only, default:
0
Index of the first result to return. Use with limit to get the next page of search results.
- Returns:
- resultsdict
Search results.
Sample response
{ "query": <str>, "albums": { "limit": <int>, "offset": <int>, "total": <int>, "items": [ { "maximum_bit_depth": <int>, "image": { "small": <str>, "thumbnail": <str>, "large": <str>, "back": <str>, }, "media_count": <int>, "artist": { "image": <str>, "name": <str>, "id": <int>, "albums_count": <int>, "slug": <str>, "picture": <str> }, "artists": [ { "id": <int>, "name": <str>, "roles": [<str>] } ], "upc": <str>, "released_at": <int>, "label": { "name": <str>, "id": <int>, "albums_count": <int>, "supplier_id": <int>, "slug": <str> }, "title": <str>, "qobuz_id": <int>, "version": <str>, "url": <str>, "duration": <int>, "parental_warning": <bool>, "popularity": <int>, "tracks_count": <int>, "genre": { "path": [<int>], "color": <str>, "name": <str>, "id": <int>, "slug": <str> }, "maximum_channel_count": <int>, "id": <str>, "maximum_sampling_rate": <int>, "articles": <list>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "purchasable": <bool>, "streamable": <bool>, "previewable": <bool>, "sampleable": <bool>, "downloadable": <bool>, "displayable": <bool>, "purchasable_at": <int>, "streamable_at": <int>, "hires": <bool>, "hires_streamable": <bool> } ] }, "tracks": { "limit": <int>, "offset": <int>, "total": <int>, "items": [ { "maximum_bit_depth": <int>, "copyright": <str>, "performers": <str>, "audio_info": { "replaygain_track_peak": <float>, "replaygain_track_gain": <float> }, "performer": { "name": <str>, "id": <int> }, "album": { "image": { "small": <str>, "thumbnail": <str>, "large": <str> }, "maximum_bit_depth": <int>, "media_count": <int>, "artist": { "image": <str>, "name": <str>, "id": <int>, "albums_count": <int>, "slug":<str>, "picture": <str> }, "upc": <str>, "released_at": <int>, "label": { "name": <str>, "id": <int>, "albums_count": <int>, "supplier_id": <int>, "slug": <str> }, "title": <str>, "qobuz_id": <int>, "version": <str>, "duration": <int>, "parental_warning": <bool>, "tracks_count": <int>, "popularity": <int>, "genre": { "path": [<int>], "color": <str>, "name": <str>, "id": <int>, "slug": <str> }, "maximum_channel_count": <int>, "id": <str>, "maximum_sampling_rate": <int>, "previewable": <bool>, "sampleable": <bool>, "displayable": <bool>, "streamable": <bool>, "streamable_at": <int>, "downloadable": <bool>, "purchasable_at": <int>, "purchasable": <bool>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "release_date_purchase": <str>, "hires": <bool>, "hires_streamable": <bool> }, "work": <str>, "composer": { "name": <str>, "id": <int> }, "isrc": <str>, "title": <str>, "version": <str>, "duration": <int>, "parental_warning": <bool>, "track_number": <int>, "maximum_channel_count": <int>, "id": <int>, "media_number": <int>, "maximum_sampling_rate": <int>, "release_date_original": <str>, "release_date_download": <str>, "release_date_stream": <str>, "release_date_purchase": <str>, "purchasable": <bool>, "streamable": <bool>, "previewable": <bool>, "sampleable": <bool>, "downloadable": <bool>, "displayable": <bool>, "purchasable_at": <int>, "streamable_at": <int>, "hires": <bool>, "hires_streamable": <bool> } ] }, "artists": { "limit": <int>, "offset": <int>, "total": <int>, "items": [ { "picture": <str>, "image": { "small": <str>, "medium": <str>, "large": <str>, "extralarge": <str>, "mega": <str> }, "name": <str>, "slug": <str>, "albums_count": <int>, "id": <int> } ] }, "playlists": { "limit": <int>, "offset": <int>, "total": <int>, "items": [ { "image_rectangle_mini": [<str>], "is_published": <bool>, "featured_artists": <list>, "description": <str>, "created_at": <int>, "timestamp_position": <int>, "images300": [<str>], "duration": <int>, "updated_at": <int>, "published_to": <int>, "genres": <list>, "image_rectangle": [<str>], "id": <int>, "slug": <str>, "owner": { "id": <int>, "name": <str> }, "users_count": <int>, "images150": [<str>], "images": [<str>], "is_collaborative": <bool>, "stores": [<str>], "tags": [ { "featured_tag_id": <str>, "name_json": <str>, "slug": <str>, "color": <str>, "genre_tag": <str>, "is_discover": <bool> } ], "tracks_count": <int>, "public_at": <int>, "name": <str>, "is_public": <bool>, "published_from": <int>, "is_featured": <bool> } ] }, "focus": { "limit": <int>, "offset": <int>, "total": <int>, "items": [ { "image": <str>, "name_superbloc": <str>, "accroche": <str>, "id": <str>, "title": <str>, "genre_ids": [<str>], "author": <str>, "date": <str> } ] }, "articles": { "limit": <int>, "offset": <int>, "total": <int>, "items": [ { "image": <str>, "thumbnail": <str>, "root_category": <int>, "author": <str>, "abstract": <str>, "source": <str>, "title": <str>, "type": <str>, "url": <str>, "image_original": <str>, "category_id": <int>, "source_image": <str>, "id": <int>, "published_at": <int>, "category": <str> } ] }, "stories": { "limit": <int>, "offset": <int>, "total": <int>, "items": [ { "id": <str>, "section_slugs": [<str>], "title": <str>, "description_short": <str>, "authors": [ { "id": <str>, "name": <str>, "slug": <str> } ], "image": <str>, "display_date": <int> } ] } }
- set_auth_token(auth_token: str = None, *, email: str = None, password: str = None) None [source]#
Set the private Qobuz API user authentication token.
- Parameters:
- auth_tokenstr, optional
User authentication token.
- emailstr, keyword-only, optional
Account email address.
- passwordstr, keyword-only, optional
Account password.
- set_flow(flow: str, *, app_id: str = None, app_secret: str = None, auth_token: str = None, browser: bool = False, save: bool = True) None [source]#
Set the authorization flow.
- Parameters:
- flowstr, keyword-only, optional
Authorization flow.
Valid values:
"password"
for the password flow.None
for no authentication.
- app_idstr, keyword-only, optional
App ID. Required if an user authentication token is provided in auth_token.
- app_secretstr, keyword-only, optional
App secret. Required if an user authentication token is provided in auth_token.
- auth_tokenstr, keyword-only, optional
User authentication token.
- browserbool, keyword-only, default:
False
Determines whether a web browser is opened with the Qobuz login page using the Playwright framework by Microsoft to complete the password flow.
- savebool, keyword-only, default:
True
Determines whether to save the newly obtained access tokens and their associated properties to the Minim configuration file.
- unfavorite_items(*, album_ids: str | list[str] = None, artist_ids: int | str | list[int | str] = None, track_ids: int | str | list[int | str] = None) None [source]#
Unfavorite albums, artists, and/or tracks.
User authentication
Requires user authentication via the password flow.
See also
For playlists, use
unfavorite_playlist()
.- Parameters:
- album_idsstr or list, keyword-only, optional
Qobuz album ID(s).
- artist_idsint, str, or list, keyword-only, optional
Qobuz artist ID(s).
- track_idsint, str, or list, keyword-only, optional
Qobuz track ID(s).
- unfavorite_playlist(playlist_id: int | str) None [source]#
Unsubscribe from a playlist.
User authentication
Requires user authentication via the password flow.
- Parameters:
- playlist_idint or str
Qobuz playlist ID.
Example:
15732665
.
- update_playlist(playlist_id: int | str, *, name: str = None, description: str = None, public: bool = None, collaborative: bool = None) dict[str, Any] [source]#
Update the title, description, and/or privacy of a playlist owned by the current user.
User authentication
Requires user authentication via the password flow.
- Parameters:
- playlist_idint or str
Qobuz user playlist ID.
Example:
17737508
.- namestr, keyword-only, optional
Qobuz playlist name.
- descriptionstr, keyword-only, optional
Brief playlist description.
- publicbool, keyword-only, optional
Determines whether the playlist is public (
True
) or private (False
).- collaborativebool, keyword-only, optional
Determines whether the playlist is collaborative.
- Returns:
- playliststr
Qobuz catalog information for the updated playlist.
Sample response
{ "id": <int>, "name": <str>, "description": <str>, "tracks_count": <int>, "users_count": <int>, "duration": <int>, "public_at": <int>, "created_at": <int>, "updated_at": <int>, "is_public": <bool>, "is_collaborative": <bool>, "owner": { "id": <int>, "name": <str> } }
- update_playlist_position(from_playlist_id: int | str, to_playlist_id: int | str) None [source]#
Organize a user’s playlists.
User authentication
Requires user authentication via the password flow.
- Parameters:
- from_playlist_idint or str
Qobuz user playlist ID of playlist to move.
Example:
17737508
.- to_playlist_idint or str
Qobuz user playlist ID of playlist to swap with that in from_playlist_id.
Example:
17737509
.