TracksAPI

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

Bases: TIDALResourceAPI

Tracks and Track Manifests API endpoints for the TIDAL API.

Important

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

Parameters:
clientminim.api._shared.APIClient

API client instance used to make HTTP requests.

Methods

get_similar_tracks

Tracks > Get Similar Tracks Relationship: Get TIDAL catalog information for similar tracks.

get_track_albums

Tracks > Get Albums Relationship: Get TIDAL catalog information for albums containing a track.

get_track_artists

Tracks > Get Artists Relationship: Get TIDAL catalog information for the artists of a track.

get_track_media_info

Track Manifests > Get Single Track Manifest: Get TIDAL media information for a track.

get_track_mix

Tracks > Get Radio Relationship: Get TIDAL catalog information for a track's mix.

get_track_owners

Tracks > Get Owners Relationship: Get TIDAL profile information for the owners of a track resource.

get_track_providers

Tracks > Get Providers Relationship: Get TIDAL catalog information for the providers of a track.

get_track_source_file

Tracks > Get Source File Relationship: Get TIDAL catalog information for the source file for a track.

get_track_usage_rules

Tracks > Get Usage Rules Relationship: Get TIDAL catalog information for the usage rules for a track.

get_tracks

Tracks > Get Single Track: Get TIDAL catalog information for a track․ Tracks > Get Multiple Tracks: Get TIDAL catalog information for multiple tracks.

get_user_saved_tracks

User Collection Tracks > Get Items Relationship: Get TIDAL catalog information for tracks in a user collection․ User Collections > Get Tracks Relationship: Get TIDAL catalog information for tracks in a user's collection.

remove_saved_tracks

User Collection Tracks > Delete from Items Relationship: Remove tracks from a user collection․ User Collections > Delete from Tracks Relationship: Remove tracks from a user's collection.

save_tracks

User Collection Tracks > Add to Items Relationship: Add tracks to a user collection․ User Collections > Add to Tracks Relationship: Add tracks to a user's collection.

search_tracks

Search Results > Get Tracks Relationship: Search for tracks in the TIDAL catalog.

get_similar_tracks(track_id: int | str, /, country_code: str | None = None, *, include_metadata: bool = False, cursor: str | None = None, share_code: str | None = None) dict[str, Any][source]

Tracks > Get Similar Tracks Relationship: Get TIDAL catalog information for similar tracks.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "75413016".

country_codestr; optional

ISO 3166-1 alpha-2 country code.

Example: "US".

include_metadatabool; keyword-only; default: False

Whether to include metadata for the similar tracks.

cursorstr; keyword-only; optional

Cursor for fetching the next page of results.

Example: "3nI1Esi".

share_codestr; keyword-only; optional

Share code that grants access to unlisted resources.

Returns:
tracksdict[str, Any]

Page of TIDAL metadata for the similar tracks.

get_track_albums(track_id: int | str, /, country_code: str | None = None, *, include_metadata: bool = False, cursor: str | None = None, share_code: str | None = None) dict[str, Any][source]

Tracks > Get Albums Relationship: Get TIDAL catalog information for albums containing a track.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "75413016".

country_codestr; optional

ISO 3166-1 alpha-2 country code.

Example: "US".

include_metadatabool; keyword-only; default: False

Whether to include metadata for the albums containing the track.

cursorstr; keyword-only; optional

Cursor for fetching the next page of results.

Example: "3nI1Esi".

share_codestr; keyword-only; optional

Share code that grants access to unlisted resources.

Returns:
albumsdict[str, Any]

Page of TIDAL metadata for the albums containing the track.

get_track_artists(track_id: int | str, /, country_code: str | None = None, *, include_metadata: bool = False, cursor: str | None = None, share_code: str | None = None) dict[str, Any][source]

Tracks > Get Artists Relationship: Get TIDAL catalog information for the artists of a track.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "75413016".

country_codestr; optional

ISO 3166-1 alpha-2 country code.

Example: "US".

include_metadatabool; keyword-only; default: False

Whether to include metadata for the track’s artists.

cursorstr; keyword-only; optional

Cursor for fetching the next page of results.

Example: "3nI1Esi".

share_codestr; keyword-only; optional

Share code that grants access to unlisted resources.

Returns:
artistsdict[str, Any]

Page of TIDAL metadata for the track’s artists.

get_track_media_info(track_id: int | str, /, *, manifest_type: str = 'MPEG_DASH', formats: str | Collection[str] | None = None, uri_scheme: str = 'HTTPS', intent: str = 'PLAYBACK', adaptive: bool = True, share_code: str | None = None) dict[str, Any][source]

Track Manifests > Get Single Track Manifest: Get TIDAL media information for a track.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "251380837".

manifest_typestr; keyword-only; default: "MPEG_DASH"

Streaming protocol to use for the manifest.

Valid values:

  • "HLS" – HTTP Live Streaming.

  • "MPEG_DASH" – Dynamic Adaptive Streaming over HTTP.

formatsstr or Collection[str]; keyword-only; default: None

Requested audio formats. If a collection, the highest quality format available will be returned. If not specified, all audio formats are requested.

Valid values: "HEAACV1", "AACLC", "FLAC", "FLAC_HIRES", "EAC3_JOC".

uri_schemestr; keyword-only; default: "HTTPS"

Whether to return a remote URL or a Base64 manifest.

Valid values:

  • "HTTPS" – Remote URL for the manifest.

  • "DATA" – Base64 manifest.

intentstr; keyword-only; default: "PLAYBACK"

Playback mode or intended use of the track.

Valid values:

  • "DOWNLOAD" – Offline download.

  • "PLAYBACK" – Streaming playback.

adaptivebool; keyword-only; default: True

Whether the manifest should support adaptive bitrate switching based on network conditions.

share_codestr; keyword-only; optional

Share code that grants access to unlisted resources.

Returns:
media_infodict[str, Any]

TIDAL media information for the track.

get_track_mix(track_id: int | str, /, *, include_metadata: bool = False, cursor: str | None = None, share_code: str | None = None) dict[str, Any][source]

Tracks > Get Radio Relationship: Get TIDAL catalog information for a track’s mix.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "75413016".

include_metadatabool; keyword-only; default: False

Whether to include metadata for the track’s mix.

cursorstr; keyword-only; optional

Cursor for fetching the next page of results.

Example: "3nI1Esi".

share_codestr; keyword-only; optional

Share code that grants access to unlisted resources.

Returns:
mixdict[str, Any]

Page of TIDAL metadata for the track’s mix.

get_track_owners(track_id: int | str, /, *, include_metadata: bool = False, cursor: str | None = None, share_code: str | None = None) dict[str, Any][source]

Tracks > Get Owners Relationship: Get TIDAL profile information for the owners of a track resource.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "75413016".

include_metadatabool; keyword-only; default: False

Whether to include metadata for the owners.

cursorstr; keyword-only; optional

Cursor for fetching the next page of results.

Example: "3nI1Esi".

share_codestr; keyword-only; optional

Share code that grants access to unlisted resources.

Returns:
ownersdict[str, Any]

Page of TIDAL profile information for the track resource’s owners.

get_track_providers(track_id: int | str, /, country_code: str | None = None, *, include_metadata: bool = False, cursor: str | None = None, share_code: str | None = None) dict[str, Any][source]

Tracks > Get Providers Relationship: Get TIDAL catalog information for the providers of a track.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "75413016".

country_codestr; optional

ISO 3166-1 alpha-2 country code.

Example: "US".

include_metadatabool; keyword-only; default: False

Whether to include metadata for the track’s providers.

cursorstr; keyword-only; optional

Cursor for fetching the next page of results.

Example: "3nI1Esi".

share_codestr; keyword-only; optional

Share code that grants access to unlisted resources.

Returns:
providersdict[str, Any]

Page of TIDAL metadata for the track’s providers.

get_track_source_file(track_id: int | str, /, *, include_metadata: bool = False, share_code: str | None = None) dict[str, Any][source]

Tracks > Get Source File Relationship: Get TIDAL catalog information for the source file for a track.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "75413016".

include_metadatabool; keyword-only; default: False

Whether to include metadata for the track’s source file.

cursorstr; keyword-only; optional

Cursor for fetching the next page of results.

Example: "3nI1Esi".

share_codestr; keyword-only; optional

Share code that grants access to unlisted resources.

Returns:
source_filedict[str, Any]

Page of TIDAL metadata for the track’s source file.

get_track_usage_rules(track_id: int | str, /, *, include_metadata: bool = False, share_code: str | None = None) dict[str, Any][source]

Tracks > Get Usage Rules Relationship: Get TIDAL catalog information for the usage rules for a track.

Parameters:
track_idint or str; positional-only

TIDAL ID of the track.

Examples: 46369325, "75413016".

include_metadatabool; keyword-only; default: False

Whether to include metadata for the track’s usage rules.

share_codestr; keyword-only; optional

Share code that grants access to unlisted resources.

Returns:
usage_rulesdict[str, Any]

TIDAL metadata for the track’s usage rules.

get_tracks(track_ids: int | str | Collection[int | str] | None = None, /, *, isrcs: str | Collection[str] | None = None, owner_ids: int | str | Collection[int | str] | None = None, country_code: str | None = None, expand: str | Collection[str] | None = None, cursor: str | None = None, sort_by: str | None = None, share_code: str | None = None) dict[str, Any][source]

Tracks > Get Single Track: Get TIDAL catalog information for a track․ Tracks > Get Multiple Tracks: Get TIDAL catalog information for multiple tracks.

Important

Exactly one of track_ids, isrcs, or owner_ids must be provided. When isrcs or owner_ids is specified, the request will always be sent to the endpoint for multiple tracks.

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

TIDAL IDs of the tracks.

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

isrcsstr or Collection[str]; keyword-only; optional

International Standard Recording Codes (ISRCs) of the tracks.

Examples: "QMJMT1701237", ["QMJMT1701237", "USAT21404265"].

owner_idsint, str, or Collection[int | str]; keyword-only; optional

TIDAL IDs of the track resources’ owners.

Examples: 123456, "123456", [123456, "654321"].

country_codestr; keyword-only; optional

ISO 3166-1 alpha-2 country code.

Example: "US".

expandstr or Collection[str]; keyword-only; optional

Related resources to include metadata for in the response.

Valid values: "albums", "artists", "credits", "download", "genres", "lyrics", "metadataStatus", "owners", "priceConfig", "providers", "radio", "replacement", "shares", "similarTracks", "sourceFile", "suggestedTracks", "trackStatistics", "usageRules".

Examples: "lyrics", ["albums", "artists"].

cursorstr; keyword-only; optional

Cursor for fetching the next page of results when requesting multiple tracks.

Example: "3nI1Esi".

sort_bystr; keyword-only; optional

Field to sort the tracks by.

Valid values: "createdAt", "title".

share_codestr; keyword-only; optional

Share code that grants access to unlisted resources.

Returns:
tracksdict[str, Any]

Page of TIDAL metadata for the tracks.

get_user_saved_tracks(*, collection_id: str | None = None, user_id: int | str | None = None, country_code: str | None = None, locale: str | None = None, include_metadata: bool = False, cursor: str | None = None, sort_by: str | None = None, descending: bool | None = None) dict[str, Any][source]

User Collection Tracks > Get Items Relationship: Get TIDAL catalog information for tracks in a user collection․ User Collections > Get Tracks Relationship: Get TIDAL catalog information for tracks in a user’s collection.

Authorization scope

collection.read scope

Read access to a user’s collection.

Important

At most one of collection_id or user_id must be provided. If user_id is provided, the legacy GET /userCollections/{user_id}/relationships/tracks endpoint is used.

Parameters:
collection_idstr; keyword-only; optional

TIDAL ID of the user collection. If authenticated, "me" can be used in lieu of a TIDAL ID for the current user’s collection. If not specified, "me" is used.

user_idint or str; keyword-only; optional

TIDAL ID of the user.

country_codestr; keyword-only; optional

ISO 3166-1 alpha-2 country code.

Example: "US".

localestr; keyword-only; optional

IETF BCP 47 language tag.

include_metadatabool; keyword-only; default: False

Whether to include metadata for the tracks in the user’s collection.

cursorstr; keyword-only; optional

Cursor for fetching the next page of results.

Example: "3nI1Esi".

sort_bystr; keyword-only; optional

Field to sort the tracks by.

Valid values: "addedAt", "albums.title", "artists.name", "duration", "title".

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 | dict[str, int | str] | Collection[int | str | dict[str, int | str]], /, *, collection_id: str | None = None, user_id: int | str | None = None, country_code: str | None = None) None[source]

User Collection Tracks > Delete from Items Relationship: Remove tracks from a user collection․ User Collections > Delete from Tracks Relationship: Remove tracks from a user’s collection.

Authorization scope

collection.write scope

Write access to a user’s collection.

Important

At most one of collection_id or user_id must be provided. If user_id is provided, the legacy DELETE /userCollections/{user_id}/relationships /tracks endpoint is used.

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

TIDAL IDs and/or resource identifiers of the tracks.

Examples:

  • 46369325

  • "75413016"

  • {"id": "46369325", "types": "tracks"}

  • ["75413016", {"id": "46369325", "types": "tracks"}]

collection_idstr; keyword-only; optional

TIDAL ID of the user collection. If authenticated, "me" can be used in lieu of a TIDAL ID for the current user’s collection. If not specified, "me" is used.

user_idint or str; keyword-only; optional

TIDAL ID of the user.

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

User Collection Tracks > Add to Items Relationship: Add tracks to a user collection․ User Collections > Add to Tracks Relationship: Add tracks to a user’s collection.

Authorization scope

collection.write scope

Write access to a user’s collection.

Important

At most one of collection_id or user_id must be provided. If user_id is provided, the legacy POST /userCollections/{user_id}/relationships/tracks endpoint is used.

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

TIDAL IDs and/or resource identifiers of the tracks.

Examples:

  • 46369325

  • "75413016"

  • {"id": "46369325", "types": "tracks"}

  • ["75413016", {"id": "46369325", "types": "tracks"}]

collection_idstr; keyword-only; optional

TIDAL ID of the user collection. If authenticated, "me" can be used in lieu of a TIDAL ID for the current user’s collection. If not specified, "me" is used.

user_idint or str; keyword-only; optional

TIDAL ID of the user.

country_codestr; keyword-only; optional

ISO 3166-1 alpha-2 country code.

Example: "US".

search_tracks(query: str, /, country_code: str | None = None, *, include_explicit: bool | None = None, include_metadata: bool = False, cursor: str | None = None) dict[str, Any][source]

Search Results > Get Tracks Relationship: Search for tracks in the TIDAL catalog.

Parameters:
querystr; positional-only

Search query.

country_codestr; optional

ISO 3166-1 alpha-2 country code.

Example: "US".

include_explicitbool; keyword-only; optional

Whether to include items with explicit language.

API default: True.

include_metadatabool; keyword-only; default: False

Whether to include metadata for the matching tracks.

cursorstr; keyword-only; optional

Cursor for fetching the next page of results.

Example: "3nI1Esi".

Returns:
tracksdict[str, Any]

Page of TIDAL metadata for the matching tracks.