spotifywebapipython.models.tracksimplified

@export
class TrackSimplified:

Spotify Web API SimplifiedTrack object.

TrackSimplified(root: dict = None)

Initializes a new instance of the class.

Arguments:
  • root (dict): Spotify Web API JSON response in dictionary format, used to load object attributes; otherwise, None to not load attributes.

A list of artists who performed the track.

AvailableMarkets: list[str]

A list of the countries in which the track can be played, identified by their ISO 3166-1 alpha-2 code.

DiscNumber: int

The disc number (usually 1 unless the album consists of more than one disc).

DurationMS: int

The track length in milliseconds.

Explicit: bool

Whether or not the track has explicit lyrics (true = yes it does; false = no it does not OR unknown).

Known external URLs for the track.

Href: str

A link to the Web API endpoint providing full details of the track.

Id: str

The Spotify ID for the track.

ImageUrl: str

Always returns null, as tracks currently do not support images.

Added for compatibility with other objects.

IsLocal: bool

Whether or not the track is from a local file.

IsPlayable: bool

Part of the response when Track Relinking is applied.
If true, the track is playable in the given market. Otherwise false.

Name: str

The name of the track.

PreviewUrl: str

A link to a 30 second preview (MP3 format) of the track. Can be null.

Important policy note:

  • Spotify Audio preview clips can not be a standalone service.

Included in the response when a content restriction is applied.

TrackNumber: int

The number of the track.

If an album has several discs, the track number is the number on the specified disc.

Type: str

The object type: track.

Uri: str

The Spotify URI for the track.

def ToDictionary(self) -> dict:

Returns a dictionary representation of the class.

def ToString(self, includeTitle: bool = True) -> str:

Returns a displayable string representation of the class.

Arguments:
  • includeTitle (str): True to include the class name title prefix.