PrivateTracksAPI¶
- class minim.api.tidal.PrivateTracksAPI(client: APIClient, /)[source]¶
Bases:
PrivateTIDALResourceAPITracks API endpoints for the private TIDAL API.
Important
This class is managed by
PrivateTIDALAPIClientand should not be instantiated directly.- Parameters:
- clientminim.api._shared.APIClient
API client instance used to make HTTP requests.
Methods
Block a track for a user.
Get TIDAL catalog information for a track.
Get TIDAL catalog information for contributors to a track.
Get TIDAL catalog information for credits for a track.
Get TIDAL catalog information for lyrics for a track.
Get TIDAL media information for a track.
Get the TIDAL ID of a track's mix.
Get track recommendations based on a given track.
Get TIDAL catalog information for tracks blocked by a user.
Get TIDAL catalog information for tracks in a user's collection.
Remove tracks from a user's collection.
Add tracks to a user's collection.
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.
Sample response
{ "accessType": <str>, "adSupportedStreamReady": <bool>, "album": { "cover": <str>, "id": <int>, "title": <str>, "vibrantColor": <str>, "videoCover": <str> }, "allowStreaming": <bool>, "artist": { "handle": <str>, "id": <int>, "name": <str>, "picture": <str>, "type": "MAIN" }, "artists": [ { "handle": <str>, "id": <int>, "name": <str>, "picture": <str>, "type": <str> } ], "audioModes": <list[str]>, "audioQuality": <str>, "bpm": <int>, "copyright": <str>, "djReady": <bool>, "duration": <int>, "editable": <bool>, "explicit": <bool>, "id": <int>, "isrc": <str>, "key": <str>, "keyScale": <str>, "mediaMetadata": { "tags": <list[str]> }, "mixes": { "TRACK_MIX": <str> }, "payToStream": <bool>, "peak": <float>, "popularity": <int>, "premiumStreamingOnly": <bool>, "replayGain": <float>, "spotlighted": <bool>, "stemReady": <bool>, "streamReady": <bool>, "streamStartDate": <str>, "title": <str>, "trackNumber": <int>, "upload": <bool>, "url": <str>, "version": <str>, "volumeNumber": <int> }
- 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:
1to100.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.
Sample response
{ "items": [ { "name": <str>, "role": <str> } ], "limit": <int>, "offset": <int>, "totalNumberOfItems": <int> }
- 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.
Sample response
[ { "contributors": [ { "id": <int>, "name": <str> } ], "type": <str> } ]
- 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.
Sample response
{ "trackId": <int>, "lyricsProvider": <str>, "providerCommontrackId": <str>, "providerLyricsId": <str>, "lyrics": <str>, "subtitles": <str>, "isRightToLeft": <bool> }
- 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.
Subscription
- TIDAL streaming plan
Stream full-length and high-resolution audio. Learn more.
- 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.
Sample response
{ "albumPeakAmplitude": <float>, "albumReplayGain": <float>, "assetPresentation": <str>, "audioMode": <str>, "audioQuality": <str>, "bitDepth": <int>, "licenseSecurityToken": <str>, "manifest": <str>, "manifestHash": <str>, "manifestMimeType": <str>, "sampleRate": <int>, "trackId": <int>, "trackPeakAmplitude": <float>, "trackReplayGain": <float> }
- 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:
1to100.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.
Sample response
{ "items": [ { "sources": [ "SUGGESTED_TRACKS" ], "track": { "accessType": <str>, "adSupportedStreamReady": <bool>, "album": { "cover": <str>, "id": <int>, "title": <str>, "vibrantColor": <str>, "videoCover": <str> }, "allowStreaming": <bool>, "artist": { "handle": <str>, "id": <int>, "name": <str>, "picture": <str>, "type": "MAIN" }, "artists": [ { "handle": <str>, "id": <int>, "name": <str>, "picture": <str>, "type": <str> } ], "audioModes": <list[str]>, "audioQuality": <str>, "bpm": <int>, "copyright": <str>, "djReady": <bool>, "duration": <int>, "editable": <bool>, "explicit": <bool>, "id": <int>, "isrc": <str>, "key": <str>, "keyScale": <str>, "mediaMetadata": { "tags": <list[str]> }, "mixes": { "TRACK_MIX": <str> }, "payToStream": <bool>, "peak": <float>, "popularity": <int>, "premiumStreamingOnly": <bool>, "replayGain": <float>, "spotlighted": <bool>, "stemReady": <bool>, "streamReady": <bool>, "streamStartDate": <str>, "title": <str>, "trackNumber": <int>, "upload": <bool>, "url": <str>, "version": <str>, "volumeNumber": <int> } } ], "limit": <int>, "offset": <int>, "totalNumberOfItems": <int> }
- 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:
1to100.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.
Sample response
{ "items": [ { "created": <str>, "item": { "accessType": <str>, "adSupportedStreamReady": <bool>, "album": { "cover": <str>, "id": <int>, "title": <str>, "vibrantColor": <str>, "videoCover": <str> }, "allowStreaming": <bool>, "artist": { "handle": <str>, "id": <int>, "name": <str>, "picture": <str>, "type": "MAIN" }, "artists": [ { "handle": <str>, "id": <int>, "name": <str>, "picture": <str>, "type": <str> } ], "audioModes": <list[str]>, "audioQuality": <str>, "bpm": <int>, "copyright": <str>, "djReady": <bool>, "duration": <int>, "editable": <bool>, "explicit": <bool>, "id": <int>, "isrc": <str>, "key": <str>, "keyScale": <str>, "mediaMetadata": { "tags": <list[str]> }, "mixes": { "TRACK_MIX": <str> }, "payToStream": <bool>, "peak": <float>, "popularity": <int>, "premiumStreamingOnly": <bool>, "replayGain": <float>, "spotlighted": <bool>, "stemReady": <bool>, "streamReady": <bool>, "streamStartDate": <str>, "title": <str>, "trackNumber": <int>, "upload": <bool>, "url": <str>, "version": <str>, "volumeNumber": <int> }, "type": "TRACK" } ], "limit": <int>, "offset": <int>, "totalNumberOfItems": <int> }
- 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:
1to100.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.
Sample response
{ "items": [ { "created": <str>, "item": { "accessType": <str>, "adSupportedStreamReady": <bool>, "album": { "cover": <str>, "id": <int>, "title": <str>, "vibrantColor": <str>, "videoCover": <str> }, "allowStreaming": <bool>, "artist": { "handle": <str>, "id": <int>, "name": <str>, "picture": <str>, "type": "MAIN" }, "artists": [ { "handle": <str>, "id": <int>, "name": <str>, "picture": <str>, "type": <str> } ], "audioModes": <list[str]>, "audioQuality": <str>, "bpm": 128, "copyright": <str>, "djReady": <bool>, "duration": <int>, "editable": <bool>, "explicit": <bool>, "id": <int>, "isrc": <str>, "key": <str>, "keyScale": <str>, "mediaMetadata": { "tags": <list[str]> }, "mixes": { "TRACK_MIX": <str> }, "payToStream": <bool>, "peak": <float>, "popularity": <int>, "premiumStreamingOnly": <bool>, "replayGain": <float>, "spotlighted": <bool>, "stemReady": <bool>, "streamReady": <bool>, "streamStartDate": <str>, "title": <str>, "trackNumber": <int>, "upload": <bool>, "url": <str>, "version": <str>, "volumeNumber": <int>, } } ], "limit": <int>, "offset": <int>, "totalNumberOfItems": <int> }
- 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.