Tracks
API #
Implementation to make API calls with.
Parameters:
-
access_flow(AuthorizationCodeFlow | ClientCredentialsFlow) –Access flow to use for api requests.
get_track #
get_track(track_id: str, *, market: MissingOr[str] = MISSING) -> TrackWithSimpleArtist
Get Spotify catalog information for a single track.
Parameters:
-
track_id(str) –The ID of the track.
-
market(str, default:MISSING) –Only get content available in that market. Must be an ISO 3166-1 alpha-2 country code.
Returns:
-
TrackWithSimpleArtist–The requested track.
get_several_tracks #
get_several_tracks(track_ids: list[str], *, market: MissingOr[str] = MISSING) -> list[TrackWithSimpleArtist]
Get Spotify catalog information for several tracks.
Parameters:
-
track_ids(list[str]) –The IDs of the tracks. Maximum: 50.
-
market(str, default:MISSING) –Only get content available in that market. Must be an ISO 3166-1 alpha-2 country code.
Returns:
-
list[TrackWithSimpleArtist]–The requested tracks.
get_users_saved_tracks #
get_users_saved_tracks(*, limit: MissingOr[int] = MISSING, offset: MissingOr[int] = MISSING, market: MissingOr[str] = MISSING) -> Paginator[SavedTrack]
Get a list of the tracks saved in the current user's 'Your Music' library.
Required Authorization Scope
Parameters:
-
limit(int, default:20) –The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
-
offset(int, default:0) –The index of the first item to return. Default: 0 (the first item).
-
market(str, default:MISSING) –Only get content available in that market. Must be an ISO 3166-1 alpha-2 country code.
Returns:
-
Paginator[SavedTrack]–A paginator who's items are a list of tracks.
save_tracks_for_current_user #
Save one or more tracks to the current user's 'Your Music' library.
Required Authorization Scope
Parameters:
remove_users_saved_tracks #
Remove one or more tracks from the current user's 'Your Music' library.
Required Authorization Scope
Parameters:
check_users_saved_tracks #
Check if one or more tracks is already saved in the current user's 'Your Music' library.
Required Authorization Scope
Parameters:
Returns:
SimpleTrack #
A simplified track.
Track #
A track.
TrackWithSimpleArtist #
A track where the [artist][spotify.models.TrackWithSimpleArtist.artist] field is a SimpleArtist object.
LinkedFromTrack #
Information about the originally requested track when Track Relinking is applied.
SavedTrack #
Information about a track saved to a user's 'Your Music' library.