PrivateTracksAPI¶
- class minim.api.qobuz.PrivateTracksAPI(client: APIClient, /)[source]¶
Bases:
PrivateQobuzResourceAPITracks API endpoints for the private Qobuz API.
Important
This class is managed by
PrivateQobuzAPIClientand should not be instantiated directly.- Parameters:
- clientminim.api._shared.APIClient
API client instance used to make HTTP requests.
Methods
Get the current user's favorite tracks.
Get Qobuz media information for a track.
Get track recommendations based on seed tracks.
Get Qobuz catalog information for one or more tracks.
Check whether the current user has a track favorited.
Unfavorite one or more tracks.
Report the end of a streaming event.
Report the start of a streaming event.
Favorite one or more tracks.
Search for tracks in the Qobuz catalog.
Toggle the favorite status of a track.
- get_my_saved_tracks(*, limit: int | None = None, offset: int | None = None) dict[str, Any][source]¶
Get the current user’s favorite tracks.
User authentication
- User authentication
Access and manage your library.
- Parameters:
- limitint; keyword-only; optional
Maximum number of tracks to return.
Valid range:
1to500.API default:
50.- offsetint; keyword-only; optional
Index of the first track to return. Use with limit to get the next batch of tracks.
Minimum value:
0.API default:
0.
- Returns:
- tracksdict[str, Any]
Page of Qobuz metadata for the current user’s favorite tracks.
Sample response
{ "tracks": { "items": [ { "album": { "artist": { "albums_count": <int>, "id": <int>, "image": None, "name": <str>, "picture": None, "slug": <str> }, "displayable": <bool>, "downloadable": <bool>, "duration": <int>, "genre": { "id": <int>, "name": <str>, "path": <list[int]>, "slug": <str> }, "hires": <bool>, "hires_streamable": <bool>, "id": <str>, "image": { "large": <str>, "small": <str>, "thumbnail": <str> }, "label": { "albums_count": <int>, "id": <int>, "name": <str>, "slug": <str>, "supplier_id": <int> }, "maximum_bit_depth": <int>, "maximum_channel_count": <int>, "maximum_sampling_rate": <float>, "media_count": <int>, "parental_warning": <bool>, "previewable": <bool>, "purchasable": <bool>, "purchasable_at": null, "qobuz_id": <int>, "release_date_download": <str>, "release_date_original": <str>, "release_date_purchase": <str>, "release_date_stream": <str>, "released_at": <int>, "sampleable": <bool>, "streamable": <bool>, "streamable_at": <int>, "title": <str>, "tracks_count": <int>, "upc": <str>, "version": None }, "audio_info": { "replaygain_track_gain": <float>, "replaygain_track_peak": <float>, }, "composer": { "id": <int>, "name": <str> }, "copyright": <str>, "displayable": <bool>, "downloadable": <bool>, "duration": <int>, "favorited_at": <int>, "hires": <bool>, "hires_streamable": <bool>, "id": <int>, "isrc": <str>, "maximum_bit_depth": <int>, "maximum_channel_count": <int>, "maximum_sampling_rate": <float>, "media_number": <int>, "parental_warning": <bool>, "performer": { "id": <int>, "name": <str> }, "performers": <str>, "previewable": <bool>, "purchasable": <bool>, "purchasable_at": <int>, "release_date_download": <str>, "release_date_original": <str>, "release_date_purchase": <str>, "release_date_stream": <str>, "sampleable": <bool>, "streamable": <bool>, "streamable_at": <int>, "title": <str>, "track_number": <int>, "version": <str>, "work": None } ], "limit": <int>, "offset": <int>, "total": <int> }, "user": { "id": <int>, "login": <str> } }
- get_track_media_info(track_id: int | str, /, *, format_id: int | str | None = None, intent: str | None = None, preview: bool | None = None) dict[str, Any][source]¶
Get Qobuz media information for a track.
Subscription
- Qobuz streaming plan
Stream full-length and high-resolution audio. Learn more.
- Parameters:
- track_idint or str; positional-only
Qobuz ID of the track.
Examples:
23929516,"344521217".- format_idint or str; keyword-only; optional
Audio format identifier.
Valid values:
5– Constant 320 kbps bitrate MP3.6– CD-quality (16-bit, 44.1 kHz) FLAC.7– Up to 24-bit, 96 kHz FLAC.27– Up to 24-bit, 192 kHz FLAC.
- intentstr; keyword-only; optional
Playback mode or intended use of the track.
Valid values:
"download"– Offline download."import"– Library import."stream"– Streaming playback.
API default:
"stream".- previewbool; keyword-only; optional
Whether to return a 30-second preview instead of the full track.
API default:
False.
- Returns:
- media_infodict[str, Any]
Qobuz media information for the track.
Sample response
{ "bit_depth": <int>, "blob": <str>, "duration": <int>, "format_id": <int>, "mime_type": <str>, "restrictions": [ { "code": <str> } ], "sample": <bool>, "sampling_rate": <float>, "track_id": <int>, "url": <str> }
- get_track_recommendations(seed_track_ids: int | str | Collection[int | str], /, exclude_track_ids: int | str | Collection[int | str] | None = None, *, limit: int | None = None) dict[str, Any][source]¶
Get track recommendations based on seed tracks.
User authentication
- User authentication
Access the
POST /dynamic/suggestendpoint.
- Parameters:
- seed_track_idsint | str | Collection[int | str]; positional-only
Qobuz IDs of seed tracks.
Examples:
23929516,"344521217","23929516,344521217",[23929516, "344521217"].- exclude_track_idsint | str | Collection[int | str]; optional
Qobuz IDs of tracks to exclude.
Examples:
256316240,"53859680","256316240,53859680",[256316240, "53859680"].- limitint; keyword-only; optional
Maximum number of items to return.
Valid range:
1to500.API default:
50.
- Returns:
- recommendationsdict[str, Any]
Qobuz metadata for the tracks recommended based on the seed tracks.
Sample response
{ "algorithm": <str>, "tracks": { "items": [ { "album": { "artist": { "albums_count": <int>, "id": <int>, "image": None, "name": <str>, "picture": None, "slug": <str>, }, "displayable": <bool>, "downloadable": <bool>, "duration": <int>, "genre": { "id": <int>, "name": <str>, "path": <list[int]>, "slug": <str> }, "hires": <bool>, "hires_streamable": <bool>, "id": <str>, "image": { "large": <str>, "small": <str>, "thumbnail": <str> }, "label": { "albums_count": <int>, "id": <int>, "name": <str>, "slug": <str>, "supplier_id": <int> }, "maximum_bit_depth": <int>, "maximum_channel_count": <int>, "maximum_sampling_rate": <float>, "media_count": <int>, "parental_warning": <bool>, "popularity": <int>, "previewable": <bool>, "purchasable": <bool>, "purchasable_at": None, "qobuz_id": <int>, "release_date_download": <str>, "release_date_original": <str>, "release_date_stream": <str>, "released_at": <int>, "sampleable": <bool>, "streamable": <bool>, "streamable_at": <int>, "title": <str>, "tracks_count": <int>, "upc": <str>, "version": <str> }, "audio_info": { "replaygain_track_gain": <float>, "replaygain_track_peak": <float> }, "composer": { "id": <int>, "name": <str> }, "copyright": <str>, "displayable": <bool>, "downloadable": <bool>, "duration": <int>, "hires": <bool>, "hires_streamable": <bool>, "id": <int>, "isrc": <str>, "maximum_bit_depth": <int>, "maximum_channel_count": <int>, "maximum_sampling_rate": <float>, "media_number": <int>, "parental_warning": <bool>, "performer": { "id": <int>, "name": <str> }, "performers": <str>, "previewable": <bool>, "purchasable": <bool>, "purchasable_at": <int>, "sampleable": <bool>, "streamable": <bool>, "streamable_at": <int>, "title": <str>, "track_number": <int>, "version": <str>, "work": None } ], "limit": <int> } }
- get_tracks(track_ids: int | str | Collection[int | str], /) dict[str, Any][source]¶
Get Qobuz catalog information for one or more tracks.
- Parameters:
- track_idsint, str, or Collection[int | str]; positional-only
Qobuz IDs of the tracks.
Examples:
23929516,"344521217","23929516,344521217",[23929516, "344521217"].
- Returns:
- tracksdict[str, Any]
Qobuz metadata for the tracks.
Sample responses
{ "album": { "area": None, "articles": [], "artist": { "albums_count": <int>, "id": <int>, "image": None, "name": <str>, "picture": None, "slug": <str> }, "artists": [ { "id": <int>, "name": <str>, "roles": <list[str]> } ], "awards": [ { "award_id": <str>, "award_slug": <str>, "awarded_at": <int>, "name": <str>, "publication_id": <str>, "publication_name": <str>, "publication_slug": <str>, "slug": <str> } ], "catchline": <str>, "composer": { "albums_count": <int>, "id": <int>, "image": None, "name": <str>, "picture": None, "slug": <str> }, "copyright": <str>, "created_at": <int>, "description": <str>, "description_language": <str>, "displayable": <bool>, "downloadable": <bool>, "duration": <int>, "genre": { "color": <int>, "id": <int>, "name": <int>, "path": <list[int]>, "slug": <str> }, "genres_list": <list[str]>, "goodies": [], "hires": <bool>, "hires_streamable": <bool>, "id": <str>, "image": { "back": None, "large": <str>, "small": <str>, "thumbnail": <str> }, "is_official": <bool>, "label": { "albums_count": <int>, "id": <int>, "name": <str>, "slug": <str>, "supplier_id": <int> }, "maximum_bit_depth": <int>, "maximum_channel_count": <int>, "maximum_sampling_rate": <int>, "maximum_technical_specifications": <str>, "media_count": <int>, "parental_warning": <bool>, "period": None, "popularity": <int>, "previewable": <bool>, "product_sales_factors_monthly": <int>, "product_sales_factors_weekly": <int>, "product_sales_factors_yearly": <int>, "product_type": <str>, "product_url": <str>, "purchasable": <bool>, "purchasable_at": <int>, "qobuz_id": <int>, "recording_information": <str>, "relative_url": <str>, "release_date_download": <str>, "release_date_original": <str>, "release_date_stream": <str>, "release_tags": <list[str]>, "release_type": <str>, "released_at": <int>, "sampleable": <bool>, "slug": <str>, "streamable": <bool>, "streamable_at": <int>, "subtitle": <str>, "title": <str>, "tracks_count": <int>, "upc": <str>, "url": <str>, "version": <str> }, "articles": [], "audio_info": { "replaygain_track_gain": <float>, "replaygain_track_peak": <float> }, "composer": { "id": <int>, "name": <str> }, "copyright": <str>, "created_at": <int>, "displayable": <bool>, "downloadable": <bool>, "duration": <int>, "hires": <bool>, "hires_streamable": <bool>, "id": <int>, "indexed_at": <int>, "isrc": <str>, "maximum_bit_depth": <int>, "maximum_channel_count": <int>, "maximum_sampling_rate": <float>, "media_number": <int>, "parental_warning": <bool>, "performer": { "id": <int>, "name": <str> }, "performers": <str>, "previewable": <bool>, "purchasable": <bool>, "purchasable_at": <int>, "release_date_download": <str>, "release_date_original": <str>, "release_date_purchase": <str>, "release_date_stream": <str>, "sampleable":<bool>, "streamable": <bool>, "streamable_at": <int>, "title": <str>, "track_number": <int>, "version": <str>, "work": None }
{ "items": { "album": { "area": None, "articles": [], "artist": { "albums_count": <int>, "id": <int>, "image": None, "name": <str>, "picture": None, "slug": <str> }, "artists": [ { "id": <int>, "name": <str>, "roles": <list[str]> } ], "awards": [ { "award_id": <str>, "award_slug": <str>, "awarded_at": <int>, "name": <str>, "publication_id": <str>, "publication_name": <str>, "publication_slug": <str>, "slug": <str> } ], "catchline": <str>, "composer": { "albums_count": <int>, "id": <int>, "image": None, "name": <str>, "picture": None, "slug": <str> }, "copyright": <str>, "created_at": <int>, "description": <str>, "description_language": <str>, "displayable": <bool>, "downloadable": <bool>, "duration": <int>, "genre": { "color": <int>, "id": <int>, "name": <int>, "path": <list[int]>, "slug": <str> }, "genres_list": <list[str]>, "goodies": [], "hires": <bool>, "hires_streamable": <bool>, "id": <str>, "image": { "back": None, "large": <str>, "small": <str>, "thumbnail": <str> }, "is_official": <bool>, "label": { "albums_count": <int>, "id": <int>, "name": <str>, "slug": <str>, "supplier_id": <int> }, "maximum_bit_depth": <int>, "maximum_channel_count": <int>, "maximum_sampling_rate": <int>, "maximum_technical_specifications": <str>, "media_count": <int>, "parental_warning": <bool>, "period": None, "popularity": <int>, "previewable": <bool>, "product_sales_factors_monthly": <int>, "product_sales_factors_weekly": <int>, "product_sales_factors_yearly": <int>, "product_type": <str>, "product_url": <str>, "purchasable": <bool>, "purchasable_at": <int>, "qobuz_id": <int>, "recording_information": <str>, "relative_url": <str>, "release_date_download": <str>, "release_date_original": <str>, "release_date_stream": <str>, "release_tags": <list[str]>, "release_type": <str>, "released_at": <int>, "sampleable": <bool>, "slug": <str>, "streamable": <bool>, "streamable_at": <int>, "subtitle": <str>, "title": <str>, "tracks_count": <int>, "upc": <str>, "url": <str>, "version": <str> }, "articles": [], "audio_info": { "replaygain_track_gain": <float>, "replaygain_track_peak": <float> }, "composer": { "id": <int>, "name": <str> }, "copyright": <str>, "created_at": <int>, "displayable": <bool>, "downloadable": <bool>, "duration": <int>, "hires": <bool>, "hires_streamable": <bool>, "id": <int>, "indexed_at": <int>, "isrc": <str>, "maximum_bit_depth": <int>, "maximum_channel_count": <int>, "maximum_sampling_rate": <int>, "media_number": <int>, "parental_warning": <bool>, "performer": { "id": <int>, "name": <str> }, "performers": <str>, "previewable": <bool>, "purchasable": <bool>, "purchasable_at": <int>, "release_date_download": <str>, "release_date_original": <str>, "release_date_purchase": <str>, "release_date_stream": <str>, "sampleable":<bool>, "streamable": <bool>, "streamable_at": <int>, "title": <str>, "track_number": <int>, "version": <str>, "work": None }, "total": <int> }
- is_track_saved(track_id: int | str, /) dict[str, bool][source]¶
Check whether the current user has a track favorited.
User authentication
- User authentication
Access and manage your library.
- Parameters:
- track_idint or str; positional-only
Qobuz ID of the track.
Examples:
23929516,"344521217".
- Returns:
- saveddict[str, bool]
Whether the current user has the track favorited.
Sample response:
{"status": <bool>}.
- remove_saved_tracks(track_ids: int | str | Collection[int | str], /) dict[str, str][source]¶
Unfavorite one or more tracks.
User authentication
- User authentication
Access and manage your library.
- Parameters:
- track_idsint, str, or Collection[int | str]; positional-only
Qobuz IDs of the tracks.
Examples:
23929516,"344521217","23929516,344521217",[23929516, "344521217"].
- Returns:
- statusdict[str, str]
Whether the tracks were unfavorited successfully.
Sample response:
{"status": "success"}.
- report_streaming_end(track_id: int | str, /, *, format_id: int | str, started_at: int | datetime, duration: int, online: bool, local: bool, user_id: int | str | None = None, credential_id: int | str | None = None, device_id: int | str | None = None, intent: str | None = None, purchased: bool | None = None, preview: bool | None = None) dict[str, str][source]¶
Report the end of a streaming event.
User authentication
- User authentication
Report streaming.
- Parameters:
- track_idint or str; positional-only
Qobuz ID of the track.
Examples:
23929516,"344521217".- format_idint or str; keyword-only
Audio format identifier.
Valid values:
5– Constant 320 kbps bitrate MP3.6– CD-quality (16-bit, 44.1 kHz) FLAC.7– Up to 24-bit, 96 kHz FLAC.27– Up to 24-bit, 192 kHz FLAC.
- started_atint or datetime.datetime; keyword-only
Unix time at which the streaming started.
- durationint; keyword-only; default:
0 Duration of the streaming event, in seconds.
- onlinebool; keyword-only
Whether the streaming was performed online.
- localbool; keyword-only
Whether the streaming was played from a local source (
True) or from Qobuz servers (False).- user_idint or str; keyword-only; optional
Qobuz ID of the user who streamed the track. If not specified, the current user’s Qobuz ID is used.
- credential_idint or str; keyword-only; optional
Qobuz ID of the credentials used for the streaming event.
- device_idint or str; keyword-only; optional
Qobuz ID of the streaming device.
- intentstr; keyword-only; optional
Playback mode or intended use of the track.
Valid values:
"download"– Offline download."import"– Library import."stream"– Streaming playback.
API default:
"stream".- purchasedbool; keyword-only; optional
Whether the streamed track was purchased.
- previewbool; keyword-only; optional
Whether the streamed track is a 30-second preview instead of the full track.
- Returns:
- statusdict[str, str]
Whether the streaming end event was reported successfully.
Sample response:
{"status": "success"}.
- report_streaming_start(track_id: int | str, /, *, format_id: int | str, started_at: int | datetime, online: bool, local: bool, user_id: int | str | None = None, credential_id: int | str | None = None, device_id: int | str | None = None, intent: str | None = None, purchased: bool | None = None, preview: bool | None = None) dict[str, int | str][source]¶
Report the start of a streaming event.
User authentication
- User authentication
Report streaming.
- Parameters:
- track_idint or str; positional-only
Qobuz ID of the track.
Examples:
23929516,"344521217".- format_idint or str; keyword-only
Audio format identifier.
Valid values:
5– Constant 320 kbps bitrate MP3.6– CD-quality (16-bit, 44.1 kHz) FLAC.7– Up to 24-bit, 96 kHz FLAC.27– Up to 24-bit, 192 kHz FLAC.
- started_atint or datetime.datetime; keyword-only
Unix time at which the streaming started.
- onlinebool; keyword-only
Whether the streaming was performed online.
- localbool; keyword-only
Whether the streaming was played from a local source (
True) or from Qobuz servers (False).- user_idint or str; keyword-only; optional
Qobuz ID of the user who streamed the track. If not specified, the current user’s Qobuz ID is used.
- credential_idint or str; keyword-only; optional
Qobuz ID of the credentials used for the streaming event.
- device_idint or str; keyword-only; optional
Qobuz ID of the streaming device.
- intentstr; keyword-only; optional
Playback mode or intended use of the track.
Valid values:
"download"– Offline download."import"– Library import."stream"– Streaming playback.
API default:
"stream".- purchasedbool; keyword-only; optional
Whether the streamed track was purchased.
- previewbool; keyword-only; optional
Whether the streamed track is a 30-second preview instead of the full track.
- Returns:
- statusdict[str, int | str]
Whether the streaming start event was reported successfully.
Sample response:
{"code": 200, "status": "success", "transUId": <str>}.
- save_tracks(track_ids: int | str | Collection[int | str], /) dict[str, str][source]¶
Favorite one or more tracks.
User authentication
- User authentication
Access and manage your library.
- Parameters:
- track_idsint, str, or Collection[int | str]; positional-only
Qobuz IDs of the tracks.
Examples:
23929516,"344521217","23929516,344521217",[23929516, "344521217"].
- Returns:
- statusdict[str, str]
Whether the tracks were favorited successfully.
Sample response:
{"status": "success"}.
- search_tracks(query: str, /, *, limit: int | None = None, offset: int | None = None) dict[str, Any][source]¶
Search for tracks in the Qobuz catalog.
- Parameters:
- querystr; positional-only
Search query.
Tip
Searches can be narrowed using tags, such as
#ByMainArtist,#ByComposer,#ByPerformer,#ByReleaseName,#ByLabel,#NewRelease, and#HiRes.Use strict matching instead of fuzzy search by wrapping the keyword string in double quotes.
Example:
"Galantis" #ByMainArtist #HiRes.- limitint; keyword-only; optional
Maximum number of tracks to return.
Valid range:
1to500.API default:
50.- offsetint; keyword-only; optional
Index of the first track to return. Use with limit to get the next batch of tracks.
Minimum value:
0.API default:
0.
- Returns:
- tracksdict[str, Any]
Page of Qobuz metadata for the matching tracks.
Sample response
{ "query": <str>, "tracks": { "items": [ { "album": { "artist": { "albums_count": <int>, "id": <int>, "image": None, "name": <str>, "picture": None, "slug": <str> }, "displayable": <bool>, "downloadable": <bool>, "duration": <int>, "genre": { "color": <int>, "id": <int>, "name": <int>, "path": <list[int]>, "slug": <str> }, "hires": <bool>, "hires_streamable": <bool>, "id": <str>, "image": { "large": <str>, "small": <str>, "thumbnail": <str> }, "label": { "albums_count": <int>, "id": <int>, "name": <str>, "slug": <str>, "supplier_id": <int> }, "maximum_bit_depth": <int>, "maximum_channel_count": <int>, "maximum_sampling_rate": <int>, "maximum_technical_specifications": <str>, "media_count": <int>, "parental_warning": <bool>, "previewable": <bool>, "purchasable": <bool>, "purchasable_at": <int>, "qobuz_id": <int>, "release_date_download": <str>, "release_date_original": <str>, "release_date_purchase": <str>, "release_date_stream": <str>, "released_at": <int>, "sampleable": <bool>, "streamable": <bool>, "streamable_at": <int>, "title": <str>, "tracks_count": <int>, "upc": <str>, "version": <str> }, "audio_info": { "replaygain_track_gain": <float>, "replaygain_track_peak": <float> }, "copyright": <str>, "displayable": <bool>, "downloadable": <bool>, "duration": <int>, "hires": <bool>, "hires_streamable": <bool>, "id": <int>, "isrc": <str>, "maximum_bit_depth": <int>, "maximum_channel_count": <int>, "maximum_sampling_rate": <float>, "maximum_technical_specifications": <str>, "media_number": <int>, "parental_warning": <bool>, "performer": { "id": <int>, "name": <str> }, "performers": <str>, "previewable": <bool>, "purchasable": <bool>, "purchasable_at": <int>, "release_date_download": <str>, "release_date_original": <str>, "release_date_purchase": <str>, "release_date_stream": <str>, "sampleable": <bool>, "streamable": <bool>, "streamable_at": <int>, "title": <str>, "track_number": <int>, "version": <str>, "work": None } ], "limit": <int>, "offset": <int>, "total": <int> } }
- toggle_track_saved(track_id: int | str, /) dict[str, bool][source]¶
Toggle the favorite status of a track.
User authentication
- User authentication
Access and manage your library.
- Parameters:
- track_idint or str; positional-only
Qobuz ID of the track.
Examples:
23929516,"344521217".
- Returns:
- statusdict[str, bool]
Whether the track is now favorited.
Sample response:
{"status": <bool>}.