PrivateTracksAPI

class minim.api.qobuz.PrivateTracksAPI(client: APIClient, /)[source]

Bases: PrivateQobuzResourceAPI

Tracks API endpoints for the private Qobuz API.

Important

This class is managed by PrivateQobuzAPIClient and should not be instantiated directly.

Parameters:
clientminim.api._shared.APIClient

API client instance used to make HTTP requests.

Methods

get_my_saved_tracks

Get the current user's favorite tracks.

get_track_media_info

Get Qobuz media information for a track.

get_track_recommendations

Get track recommendations based on seed tracks.

get_tracks

Get Qobuz catalog information for one or more tracks.

is_track_saved

Check whether the current user has a track favorited.

remove_saved_tracks

Unfavorite one or more tracks.

report_streaming_end

Report the end of a streaming event.

report_streaming_start

Report the start of a streaming event.

save_tracks

Favorite one or more tracks.

search_tracks

Search for tracks in the Qobuz catalog.

toggle_track_saved

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: 1 to 500.

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.

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.

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.

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/suggest endpoint.

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: 1 to 500.

API default: 50.

Returns:
recommendationsdict[str, Any]

Qobuz metadata for the tracks recommended based on the seed tracks.

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.

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: 1 to 500.

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.

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>}.