TracksAPI

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

Bases: DeezerResourceAPI

Tracks API endpoints for the Deezer API.

Important

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

Parameters:
clientminim.api._shared.APIClient

API client instance used to make HTTP requests.

Methods

delete_track

Track: Delete a user-uploaded track.

get_top_tracks

Chart > Tracks: Get Deezer catalog information for the top tracks on Deezer.

get_track

Track: Get Deezer catalog information for a track.

get_user_saved_tracks

User > Tracks: Get Deezer catalog information for a user's favorite tracks.

get_user_top_tracks

User > Charts > Tracks: Get Deezer catalog information for a user's top tracks on Deezer.

get_user_track_recommendations

User > Recommendations > Tracks: Get Discogs catalog information for tracks recommended for a user.

get_user_tracks

User > Personal Songs: Get Deezer catalog information for a user's uploaded tracks.

remove_saved_track

User > Tracks: Unfavorite a track.

save_tracks

User > Tracks: Favorite one or more tracks.

update_track_metadata

Track: Update the metadata for a user-uploaded track.

delete_track(track_id: int | str, /) bool[source]

Track: Delete a user-uploaded track.

Permission

delete_library permission

Delete items from a user’s library. Learn more.

Parameters:
track_idint or str; positional-only

Deezer ID of the track.

Examples: -3140371023, "-3140371043".

Returns:
successbool

Whether the track was deleted successfully.

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

Chart > Tracks: Get Deezer catalog information for the top tracks on Deezer.

Parameters:
limitint; keyword-only; optional

Maximum number of tracks to return.

Minimum value: 1.

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 Deezer metadata for the top tracks.

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

Track: Get Deezer catalog information for a track.

Parameters:
track_idint or str; positional-only

Deezer ID of the track.

Examples: 101602968, "3541756661".

Returns:
trackdict[str, Any]

Deezer metadata for the track.

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

User > Tracks: Get Deezer catalog information for a user’s favorite tracks.

User authentication

User authentication

Access the user’s favorite items, playlists, and followed people.

Parameters:
user_idint or str; positional-only; default: "me"

Deezer ID of the user. If authenticated, "me" can be used in lieu of a Deezer ID for the current user.

Example: 5395005364, "5395005364", "me".

limitint; keyword-only; optional

Maximum number of tracks to return.

Minimum value: 1.

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

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

User > Charts > Tracks: Get Deezer catalog information for a user’s top tracks on Deezer.

User authentication

User authentication

Access the user’s favorite items, playlists, and followed people.

Parameters:
user_idint or str; positional-only; default: "me"

Deezer ID of the user. If authenticated, "me" can be used in lieu of a Deezer ID for the current user.

Example: 5395005364, "5395005364", "me".

limitint; keyword-only; optional

Maximum number of tracks to return.

Minimum value: 1.

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

get_user_track_recommendations(user_id: int | str = 'me', /) dict[str, Any][source]

User > Recommendations > Tracks: Get Discogs catalog information for tracks recommended for a user.

User authentication

User authentication

Access the user’s favorite items, playlists, and followed people.

Parameters:
user_idint or str; positional-only; default: "me"

Deezer ID of the user. If authenticated, "me" can be used in lieu of a Deezer ID for the current user.

Example: 5395005364, "5395005364", "me".

limitint; keyword-only; optional

Maximum number of tracks to return.

Minimum value: 1.

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 Deezer metadata for the recommended tracks.

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

User > Personal Songs: Get Deezer catalog information for a user’s uploaded tracks.

User authentication

User authentication

Access the user’s favorite items, playlists, and followed people.

Parameters:
user_idint or str; positional-only; default: "me"

Deezer ID of the user. If authenticated, "me" can be used in lieu of a Deezer ID for the current user.

Example: 5395005364, "5395005364", "me".

limitint; keyword-only; optional

Maximum number of tracks to return.

Minimum value: 1.

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

remove_saved_track(track_id: int | str, /, *, user_id: int | str = 'me') bool[source]

User > Tracks: Unfavorite a track.

Permissions

manage_library permission

Manage a user’s library. Learn more.

delete_library permission

Delete items from a user’s library. Learn more.

Parameters:
track_idint or str; positional-only

Deezer ID of the track.

Examples: 101602968, "3541756661".

user_idint or str; keyword-only; default: "me"

Deezer ID of the user. If authenticated, "me" can be used in lieu of a Deezer ID for the current user.

Example: 5395005364, "5395005364", "me".

Returns:
successbool

Whether the track was unfavorited successfully.

save_tracks(track_ids: int | str | Collection[int | str], /, *, user_id: int | str = 'me') bool[source]

User > Tracks: Favorite one or more tracks.

Permission

manage_library permission

Manage a user’s library. Learn more.

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

Deezer IDs of the tracks.

Examples: 101602968, "3541756661", "101602968,3541756661", [101602968, "3541756661"].

user_idint or str; keyword-only; default: "me"

Deezer ID of the user. If authenticated, "me" can be used in lieu of a Deezer ID for the current user.

Example: 5395005364, "5395005364", "me".

Returns:
successbool

Whether the track was favorited successfully.

update_track_metadata(track_id: int | str, /, *, album: str | None = None, artist: str | None = None, title: str | None = None) bool[source]

Track: Update the metadata for a user-uploaded track.

Permission

manage_library permission

Manage a user’s library. Learn more.

Important

At least one of album, artist, or title must be specified.

Parameters:
track_idint or str; positional-only

Deezer ID of the track.

Examples: -3140371023, "-3140371043".

albumstr; keyword-only; optional

Album name.

artiststr; keyword-only; optional

Artist name.

titlestr; keyword-only; optional

Track title.

Returns:
successbool

Whether the track metadata was updated successfully.