TracksAPI¶
- class minim.api.deezer.TracksAPI(client: APIClient, /)[source]¶
Bases:
DeezerResourceAPITracks API endpoints for the Deezer API.
Important
This class is managed by
DeezerAPIClientand should not be instantiated directly.- Parameters:
- clientminim.api._shared.APIClient
API client instance used to make HTTP requests.
Methods
Track: Delete a user-uploaded track.
Chart > Tracks: Get Deezer catalog information for the top tracks on Deezer.
Track: Get Deezer catalog information for a track.
User > Tracks: Get Deezer catalog information for a user's favorite tracks.
User > Charts > Tracks: Get Deezer catalog information for a user's top tracks on Deezer.
User > Recommendations > Tracks: Get Discogs catalog information for tracks recommended for a user.
User > Personal Songs: Get Deezer catalog information for a user's uploaded tracks.
User > Tracks: Unfavorite a track.
User > Tracks: Favorite one or more tracks.
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_librarypermissionDelete 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.
Sample response
{ "data": [ { "album": { "cover": <str>, "cover_big": <str>, "cover_medium": <str>, "cover_small": <str>, "cover_xl": <str>, "id": <int>, "md5_image": <str>, "title": <str>, "tracklist": <str>, "type": "album" }, "artist": { "id": <int>, "link": <str>, "name": <str>, "picture": <str>, "picture_big": <str>, "picture_medium": <str>, "picture_small": <str>, "picture_xl": <str>, "radio": <bool>, "tracklist": <str>, "type": "artist" }, "duration": <int>, "explicit_content_cover": <int>, "explicit_content_lyrics": <int>, "explicit_lyrics": <bool>, "id": <int>, "link": <str>, "md5_image": <str>, "position": <int>, "preview": <str>, "rank": <int>, "title": <str>, "title_short": <str>, "title_version": <str>, "type": "track" } ], "prev": <str>, "next": <str>, "total": <int> }
- 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.
Sample response
{ "album": { "cover": <str>, "cover_big": <str>, "cover_medium": <str>, "cover_small": <str>, "cover_xl": <str>, "id": <int>, "link": <str>, "md5_image": <str>, "release_date": <str>, "title": <str>, "tracklist": <str>, "type": "album" }, "artist": { "id": <int>, "link": <str>, "name": <str>, "picture": <str>, "picture_big": <str>, "picture_medium": <str>, "picture_small": <str>, "picture_xl": <str>, "radio": <bool>, "share": <str>, "tracklist": <str>, "type": "artist" }, "available_countries": <list[str]>, "bpm": <int>, "contributors": [ { "id": <int>, "link": <str>, "name": <str>, "picture": <str>, "picture_big": <str>, "picture_medium": <str>, "picture_small": <str>, "picture_xl": <str>, "radio": <bool>, "role": <str>, "share": <str>, "tracklist": <str>, "type": "artist" } ], "disk_number": <int>, "duration": <int>, "explicit_content_cover": <int>, "explicit_content_lyrics": <int>, "explicit_lyrics": <bool>, "gain": <float>, "id": <int>, "isrc": <str>, "link": <str>, "md5_image": <str>, "preview": <str>, "rank": <int>, "readable": true, "release_date": <str>, "share": <str>, "title": <str>, "title_short": <str>, "title_version": <str>, "track_position": <int>, "track_token": <str>, "type": "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.
- user_idint or str; positional-only; default:
- Returns:
- tracksdict[str, Any]
Page of Deezer metadata for the user’s favorite tracks.
Sample response
{ "checksum": <str>, "data": [ { "album": { "cover": <str>, "cover_big": <str>, "cover_medium": <str>, "cover_small": <str>, "cover_xl": <str>, "id": <int>, "md5_image": <str>, "title": <str>, "tracklist": <str>, "type": "album" }, "artist": { "id": <int>, "name": <str>, "picture": <str>, "picture_big": <str>, "picture_medium": <str>, "picture_small": <str>, "picture_xl": <str>, "tracklist": <str>, "type": "artist" }, "duration": <int>, "explicit_content_cover": <int>, "explicit_content_lyrics": <int>, "explicit_lyrics": <bool>, "id": <int>, "md5_image": <str>, "preview": <str>, "rank": <int>, "readable": <bool>, "title": <str>, "title_short": <str>, "title_version": <str>, "type": "track" } ], "next": <str>, "prev": <str>, "total": <int> }
- 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.
- user_idint or str; positional-only; default:
- Returns:
- tracksdict[str, Any]
Page of Deezer metadata for the user’s top tracks.
Sample response
{ "checksum": <str>, "data": [ { "album": { "cover": <str>, "cover_big": <str>, "cover_medium": <str>, "cover_small": <str>, "cover_xl": <str>, "id": <int>, "md5_image": <str>, "title": <str>, "tracklist": <str>, "type": "album" }, "artist": { "id": <int>, "name": <str>, "picture": <str>, "picture_big": <str>, "picture_medium": <str>, "picture_small": <str>, "picture_xl": <str>, "tracklist": <str>, "type": "artist" }, "duration": <int>, "explicit_content_cover": <int>, "explicit_content_lyrics": <int>, "explicit_lyrics": <bool>, "id": <int>, "md5_image": <str>, "preview": <str>, "rank": <int>, "readable": <bool>, "title": <str>, "title_short": <str>, "title_version": <str>, "type": "track" } ], "next": <str>, "prev": <str>, "total": <int> }
- 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.
- user_idint or str; positional-only; default:
- Returns:
- tracksdict[str, Any]
Page of Deezer metadata for the recommended tracks.
Sample response
{ "data": [ { "album": { "cover": <str>, "cover_big": <str>, "cover_medium": <str>, "cover_small": <str>, "cover_xl": <str>, "id": <int>, "md5_image": <str>, "title": <str>, "tracklist": <str>, "type": "album" }, "artist": { "id": <int>, "name": <str>, "picture": <str>, "picture_big": <str>, "picture_medium": <str>, "picture_small": <str>, "picture_xl": <str>, "tracklist": <str>, "type": "artist" }, "duration": <int>, "explicit_content_cover": <int>, "explicit_content_lyrics": <int>, "explicit_lyrics": <bool>, "id": <int>, "md5_image": <str>, "preview": <str>, "rank": <int>, "readable": <bool>, "timestamp": <int>, "title": <str>, "title_short": <str>, "title_version": <str>, "type": "track" } ], "next": <str>, "prev": <str>, "total": <int> }
- 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.
- user_idint or str; positional-only; default:
- Returns:
- tracksdict[str, Any]
Page of Deezer metadata for the user’s uploaded tracks.
Sample response
{ "data": [ { "album": { "cover": <str>, "cover_big": <str>, "cover_medium": <str>, "cover_small": <str>, "cover_xl": <str>, "id": <int>, "md5_image": <str>, "title": <str>, "tracklist": <str>, "type": "album" }, "artist": { "id": <int>, "name": <str>, "picture": <str>, "picture_big": <str>, "picture_medium": <str>, "picture_small": <str>, "picture_xl": <str>, "tracklist": <str>, "type": "artist" }, "duration": <int>, "explicit_content_cover": <int>, "explicit_content_lyrics": <int>, "explicit_lyrics": <bool>, "id": <int>, "md5_image": <str>, "preview": <str>, "rank": <int>, "readable": <bool>, "title": <str>, "title_short": <str>, "title_version": <str>, "type": "track" } ], "next": <str>, "prev": <str>, "total": <int> }
- remove_saved_track(track_id: int | str, /, *, user_id: int | str = 'me') bool[source]¶
User > Tracks: Unfavorite a track.
Permissions
manage_librarypermissionManage a user’s library. Learn more.
delete_librarypermissionDelete 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_librarypermissionManage 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_librarypermissionManage a user’s library. Learn more.
Important
At least one of
album,artist, ortitlemust 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.