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 content (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.

IdOrigin: str

The origin Spotify ID for the track. The LinkedFrom.Id value is returned if present; otherwise, the Id value is returned.

This is a helper property, and is not part of the Spotify Web API specification.

ImageUrl: str

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

Added for compatibility with other objects.

IsLinkedFrom: bool

Whether or not the track is linked from another track.

If True, the LinkedFrom property contains track origin data; If False, the LinkedFrom property is an empty dictionary.

This is a helper property, and is not part of the Spotify Web API specification.

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.

LinkedFrom: spotifywebapipython.models.linkedfrom.LinkedFrom

Part of the response when Track Relinking is applied, and the requested track has been replaced with a different track. The track in the LinkedFrom object contains information about the originally requested track.

Name: str

The name of the track.

PreviewUrl: str

DEPRECATED - property no longer supported by Spotify as of 2024/11/27. More information about the deprecated functionality can be found on the Spotify Developer Forum Blog page.

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.

UriOrigin: str

The origin Spotify URI for the track. The LinkedFrom.Uri value is returned if present; otherwise, the Uri value is returned.

This is a helper property, and is not part of the Spotify Web API specification.

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.