PrivateTracksAPI

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

Bases: PrivateTIDALResourceAPI

Tracks API endpoints for the private TIDAL API.

Important

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

Parameters:
clientminim.api._shared.APIClient

API client instance used to make HTTP requests.

Methods

block_track

Block a track for a user.

get_track

Get TIDAL catalog information for a track.

get_track_contributors

Get TIDAL catalog information for contributors to a track.

get_track_credits

Get TIDAL catalog information for credits for a track.

get_track_lyrics

Get TIDAL catalog information for lyrics for a track.

get_track_media_info

Get TIDAL media information for a track.

get_track_mix_id

Get the TIDAL ID of a track's mix.

get_track_recommendations

Get track recommendations based on a given track.

get_user_blocked_tracks

Get TIDAL catalog information for tracks blocked by a user.

get_user_saved_tracks

Get TIDAL catalog information for tracks in a user's collection.

remove_saved_tracks

Remove tracks from a user's collection.

save_tracks

Add tracks to a user's collection.

unblock_track

Unblock a track for a user.

block_track(track_id: int | str, /, user_id: int | str | None = None) None[source]

Block a track for a user.

User authentication

User authentication

Access and manage the user’s collection.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "251380837".

user_idint or str; optional

TIDAL ID of the user. If not specified, the current user’s TIDAL ID is used.

get_track(track_id: int | str, /, country_code: str | None = None) dict[str, Any][source]

Get TIDAL catalog information for a track.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "251380837".

country_codestr; optional

ISO 3166-1 alpha-2 country code. If not provided, the country associated with the current user account or IP address is used.

Example: "US".

Returns:
trackdict[str, Any]

TIDAL metadata for the track.

get_track_contributors(track_id: int | str, /, country_code: str | None = None, *, limit: int | None = None, offset: int | None = None) dict[str, Any][source]

Get TIDAL catalog information for contributors to a track.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "251380837".

country_codestr; optional

ISO 3166-1 alpha-2 country code. If not provided, the country associated with the current user account or IP address is used.

Example: "US".

limitint; keyword-only; optional

Maximum number of contributors to return.

Valid range: 1 to 100.

API default: 10.

offsetint; keyword-only; optional

Index of the first contributor to return. Use with limit to get the next batch of contributors.

Minimum value: 0.

API default: 0.

Returns:
contributorsdict[str, Any]

Page of TIDAL metadata for the track’s contributors.

get_track_credits(track_id: int | str, /, country_code: str | None = None) list[dict[str, Any]][source]

Get TIDAL catalog information for credits for a track.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "251380837".

country_codestr; optional

ISO 3166-1 alpha-2 country code. If not provided, the country associated with the current user account or IP address is used.

Example: "US".

Returns:
creditsdict[str, Any]

TIDAL metadata for the track’s credits.

get_track_lyrics(track_id: int | str, /, country_code: str | None = None) dict[str, Any][source]

Get TIDAL catalog information for lyrics for a track.

Subscription

TIDAL streaming plan

Access lyrics. Learn more.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "251380837".

country_codestr; optional

ISO 3166-1 alpha-2 country code. If not provided, the country associated with the current user account or IP address is used.

Example: "US".

Returns:
lyricsdict[str, Any]

TIDAL metadata for the track’s formatted and/or time-synced lyrics.

get_track_media_info(track_id: int | str, /, *, quality: str = 'HI_RES_LOSSLESS', intent: str = 'STREAM', preview: bool = False) dict[str, Any][source]

Get TIDAL media information for a track.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "251380837".

qualitystr; keyword-only; default: "HI_RES_LOSSLESS"

Audio quality.

Valid values:

  • "LOW" – 64 kbps (22.05 kHz) MP3 without user authentication or 96 kbps AAC with user authentication.

  • "HIGH" – 320 kbps AAC.

  • "LOSSLESS" – 1411 kbps (16-bit, 44.1 kHz) ALAC or FLAC.

  • "HI_RES_LOSSLESS" – Up to 9216 kbps (24-bit, 192 kHz) FLAC.

intentstr; keyword-only; default: "STREAM"

Playback mode or intended use of the track.

Valid values:

  • "OFFLINE" – Offline download.

  • "STREAM" – Streaming playback.

previewbool; keyword-only; default: False

Whether to return a 30-second preview instead of the full track.

Returns:
media_infodict[str, Any]

TIDAL media information for the track.

get_track_mix_id(track_id: int | str, /, country_code: str | None = None) dict[str, str][source]

Get the TIDAL ID of a track’s mix.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "251380837".

country_codestr; optional

ISO 3166-1 alpha-2 country code. If not provided, the country associated with the current user account or IP address is used.

Example: "US".

Returns:
mix_iddict[str, str]

TIDAL ID of the track’s mix.

Sample response: {"id": <str>}.

get_track_recommendations(track_id: int | str, /, country_code: str | None = None, *, limit: int | None = None, offset: int | None = None) dict[str, Any][source]

Get track recommendations based on a given track.

User authentication

User authentication

Access and manage the user’s collection.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "251380837".

country_codestr; optional

ISO 3166-1 alpha-2 country code. If not provided, the country associated with the current user account or IP address is used.

Example: "US".

limitint; keyword-only; optional

Maximum number of tracks to return.

Valid range: 1 to 100.

API default: 10.

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 TIDAL metadata for the tracks recommended based on the given track.

get_user_blocked_tracks(user_id: int | str | None = None, /, *, limit: int | None = None, offset: int | None = None) dict[str, Any][source]

Get TIDAL catalog information for tracks blocked by a user.

User authentication

User authentication

Access and manage the user’s collection.

Parameters:
user_idint or str; positional-only; optional

TIDAL ID of the user. If not specified, the current user’s TIDAL ID is used.

limitint; keyword-only; optional

Maximum number of tracks to return.

Valid range: 1 to 100.

API default: 10.

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 TIDAL metadata for the user’s blocked tracks.

get_user_saved_tracks(user_id: int | str | None = None, /, country_code: str | None = None, *, limit: int | None = None, offset: int | None = None, sort_by: str | None = None, descending: bool | None = None) dict[str, Any][source]

Get TIDAL catalog information for tracks in a user’s collection.

User authentication

User authentication

Access and manage the user’s collection.

Parameters:
user_idint or str; positional-only; optional

TIDAL ID of the user. If not specified, the current user’s TIDAL ID is used.

country_codestr; optional

ISO 3166-1 alpha-2 country code. If not provided, the country associated with the current user account or IP address is used.

Example: "US".

limitint; keyword-only; optional

Maximum number of tracks to return.

Valid range: 1 to 100.

API default: 10.

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.

sort_bystr; keyword-only; optional

Field to sort the tracks by.

Valid values:

  • "DATE" - Date added.

  • "NAME" - Track name.

API default: "DATE".

descendingbool; keyword-only; optional

Whether to sort in descending order.

API default: False.

Returns:
tracksdict[str, Any]

Page of TIDAL metadata for the tracks in the user’s collection.

remove_saved_tracks(track_ids: int | str | Collection[int | str], /, user_id: int | str | None = None) None[source]

Remove tracks from a user’s collection.

User authentication

User authentication

Access and manage the user’s collection.

Parameters:
track_idsint, str, or Collection[int | str]; positional-only

TIDAL IDs of the tracks.

Examples: 46369325, "251380837", "46369325,251380837", [46369325, "251380837"].

user_idint or str; optional

TIDAL ID of the user. If not specified, the current user’s TIDAL ID is used.

save_tracks(track_ids: int | str | Collection[int | str], /, user_id: int | str | None = None, country_code: str | None = None, *, on_missing: str | None = None) None[source]

Add tracks to a user’s collection.

User authentication

User authentication

Access and manage the user’s collection.

Parameters:
track_idsint, str, or Collection[int | str]; positional-only

TIDAL IDs of the tracks.

Examples: 46369325, "251380837", "46369325,251380837", [46369325, "251380837"].

user_idint or str; optional

TIDAL ID of the user. If not specified, the current user’s TIDAL ID is used.

country_codestr; optional

ISO 3166-1 alpha-2 country code. If not provided, the country associated with the current user account or IP address is used.

Example: "US".

on_missingstr; keyword-only; optional

Behavior when the tracks to be favorited cannot be found in the TIDAL catalog.

API default: "FAIL".

unblock_track(track_id: int | str, /, user_id: int | str | None = None) None[source]

Unblock a track for a user.

User authentication

User authentication

Access and manage the user’s collection.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "251380837".

user_idint or str; optional

TIDAL ID of the user. If not specified, the current user’s TIDAL ID is used.