spotifywebapipython.models.searchresultbase

@export
class SearchResultBase:

Base class used to return basic search results common to all Spotify types.

This class is not part of the Spotify Web API specification.

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

Known external URLs for this object.

Href: str

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

Id: str

The Spotify ID for the object.

Example: 5v5ETK9WFXAnGQ3MRubKuE

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.

Images for the object.

The array may be empty or contain up to three images.
The images are returned by size in descending order.
Note: If returned, the source URL for the image (url) is temporary and will expire in less than a day.

ImageUrl: str

Returns the highest resolution order image from the Images list, if images are defined; otherwise, null.

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.

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 object.

Type: str

The object type (e.g. album, artist, audiobook, episode, playlist, show, track, etc).

Uri: str

The Spotify URI for the object.

Example: spotify:playlist:5v5ETK9WFXAnGQ3MRubKuE

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.