Spotify Models Reference

Spotify models

class AlbumModel(*, album_type: AlbumTypes, total_tracks: int, available_markets: Sequence[SpotifyMarketID] | None = None, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, images: Sequence[ImageModel], name: str, release_date: date, release_date_precision: Literal['year', 'month', 'day'], restrictions: RestrictionsModel | None = None, type: Literal['album'], uri: SpotifyAlbumURI, artists: Sequence[SimplifiedArtistModel], album_group: str | None = None, tracks: PagedResultModel[SimplifiedTrackModel], copyrights: Sequence[CopyrightModel], external_ids: ExternalIdsModel | None = None, genres: Sequence[str], label: str | None = None, popularity: int | None = None)

Bases: SimplifiedAlbumModel

Model representing Spotify catalog information for a single album.

album_group

This field describes the relationship between the artist and the album.

available_markets

The markets in which the album is available.

copyrights: Sequence[CopyrightModel]

The copyright statements of the album.

external_ids: ExternalIdsModel | None

Known external IDs for the album.

genres: Sequence[str]

A list of the genres the artist is associated with.

label: str | None

The label associated with the album.

popularity: int | None

The popularity of the album. The value will be between 0 and 100, with 100 being the most popular.

tracks: PagedResultModel[SimplifiedTrackModel]

The tracks of the album.

class ArtistModel(*, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, name: str, type: Literal['artist'], uri: SpotifyArtistURI, followers: FollowersModel | None = None, genres: Sequence[str], images: Sequence[ImageModel], popularity: int | None = None)

Bases: SimplifiedArtistModel

Model representing Spotify catalog information for a single artist identified by their unique Spotify ID.

followers: FollowersModel | None

Information about the followers of the artist.

genres: Sequence[str]

A list of the genres the artist is associated with. If not yet classified, the array is empty.

images: Sequence[ImageModel]

Images of the artist in various sizes, widest first.

popularity: int | None

The popularity of the artist. The value will be between 0 and 100, with 100 being the most popular. The artist’s popularity is calculated from the popularity of all the artist’s tracks.

class CategoryModel(*, href: HttpUrl, icons: Sequence[ImageModel], id: str, name: str)

Bases: BaseModel

Model representing a single category used to tag items in Spotify.

category_href: HttpUrl

A link to the Web API endpoint returning full details of the category.

category_id: str

The Spotify category ID of the category.

category_name: str

The name of the category.

icons: Sequence[ImageModel]

The category icon, in various sizes.

class CurrentUserModel(*, display_name: str | None = None, external_urls: ExternalUrlsModel, href: HttpUrl, id: str, images: Sequence[ImageModel], type: Literal['user'], uri: SpotifyUserURI, followers: FollowersModel | None = None, country: SpotifyMarketID | None = None, email: str | None = None, explicit_content: ExplicitContentModel | None = None, product: str | None = None)

Bases: UserModel

Model representing detailed profile information about the current user.

country: SpotifyMarketID | None

The country of the user, as set in the user’s account profile.

email: str | None

The user’s email address, as entered by the user when creating their account.

explicit_content: ExplicitContentModel | None

The user’s explicit content settings.

followers

Information about the followers of the user.

product: str | None

The user’s Spotify subscription level.

class CurrentlyPlayingItemModel(*, context: ContextModel | None = None, timestamp: datetime, progress_ms: timedelta, is_playing: bool, item: TrackModel | EpisodeModel | None = None, currently_playing_type: SpotifyItemType | Literal['unknown'], actions: PlaybackActionsModel)

Bases: BaseModel

Model representing the item currently being played on the user’s Spotify account.

classmethod convert_progress_ms_to_timedelta(value: int) timedelta

Converts track/episode progress given in milliseconds to timedelta object.

Parameters:

value – Track/Episode progress [milliseconds].

Returns:

Track/Episode progress as timedelta object.

actions: PlaybackActionsModel

Allows to update the user interface based on which playback actions are available within the current context.

context: ContextModel | None

A Context Object.

currently_playing_type: SpotifyItemType | Literal['unknown']

The object type of the currently playing item.

is_playing: bool

True if something is currently playing.

item: TrackModel | EpisodeModel | None

The currently playing track or episode.

progress: timedelta

Progress into the currently playing track or episode.

timestamp: datetime

Unix Millisecond Timestamp when playback state was last changed.

class DeviceModel(*, id: str | None = None, is_active: bool, is_private_session: bool, is_restricted: bool, name: str, type: str, volume_percent: int | None = None, supports_volume: bool)

Bases: BaseModel

Model representing information about an user’s Spotify Connect device.

device_id: str | None

The device ID. This ID is unique and persistent to some extent.

device_name: str

A human-readable name for the device.

device_type: str

A device type.

is_active: bool

If this device is the currently active device.

is_private_session: bool

If this device is currently in a private session.

is_restricted: bool

Whether controlling this device is restricted. At present if this is True then no Web API commands will be accepted by this device.

supports_volume: bool

If this device can be used to set the volume.

volume_percent: int | None

The current volume in percent.

class EpisodeModel(*, audio_preview_url: HttpUrl | None = None, description: str, html_description: str, duration_ms: timedelta, explicit: bool, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, images: Sequence[ImageModel], is_externally_hosted: bool, is_playable: bool, language: str, languages: Sequence[str], name: str, release_date: date, release_date_precision: Literal['year', 'month', 'day'], resume_point: ResumePointModel | None = None, type: Literal['episode'], uri: SpotifyEpisodeURI, restrictions: RestrictionsModel | None = None, show: SimplifiedShowModel)

Bases: SimplifiedEpisodeModel

Model representing catalog information for a single episode identified by its unique Spotify ID.

audio_preview_url

A URL to a 30 second preview (MP3 format) of the episode.

language

The language used in the episode, identified by a ISO 639 code.

show: SimplifiedShowModel

The show on which the episode belongs.

class ImageModel(*, url: HttpUrl, height: int | None = None, width: int | None = None)

Bases: BaseModel

Model representing an image data.

height: int | None

The image height in pixels.

image_url: HttpUrl

The source URL of the image.

width: int | None

The image width in pixels.

class PagedResultModel(*, href: HttpUrl, limit: int, next: HttpUrl | None = None, offset: int, previous: HttpUrl | None = None, total: int, items: Sequence)

Bases: BaseModel, Generic

Model representing the information about paged result.

href: HttpUrl

A link to the Web API endpoint returning the full result of the request.

items: Sequence

An array of items collected from the current page.

limit: int

The maximum number of items in the response (as set in the query or by default).

next_page: HttpUrl | None

URL to the next page of items.

offset: int

The offset of the items returned (as set in the query or by default).

previous_page: HttpUrl | None

URL to the previous page of items.

total: int

The total number of items available to return.

class PagedResultWithCursorsModel(*, href: HttpUrl, limit: int, next: HttpUrl | None = None, cursors: CursorsModel, items: Sequence, total: int | None = None)

Bases: BaseModel, Generic

Model representing the information about paged result with cursors used to find the next set of items.

cursors: CursorsModel

The cursors used to find the next set of items.

href: HttpUrl

A link to the Web API endpoint returning the full result of the request.

items: Sequence

An array of items collected from the current page.

limit: int

The maximum number of items in the response (as set in the query or by default).

next_page: HttpUrl | None

URL to the next page of items.

total: int | None

The total number of items available to return.

class PlayHistoryModel(*, track: TrackModel, played_at: datetime, context: ContextModel | None = None)

Bases: BaseModel

Model representing information about a play history.

context: ContextModel | None

The context the track was played from.

played_at: datetime

The date and time the track was played.

track: TrackModel

The track the user listened to.

class PlaybackStateModel(*, context: ContextModel | None = None, timestamp: datetime, progress_ms: timedelta, is_playing: bool, item: TrackModel | EpisodeModel | None = None, currently_playing_type: SpotifyItemType | Literal['unknown'], actions: PlaybackActionsModel, device: DeviceModel, repeat_state: RepeatMode, shuffle_state: bool, smart_shuffle: bool | None = None)

Bases: CurrentlyPlayingItemModel

Model representing the playback state.

device: DeviceModel

The device that is currently active.

repeat_state: RepeatMode

off, track, context

shuffle_state: bool

If shuffle is on or off.

smart_shuffle: bool | None

If smart shuffle is on or off.

class PlaylistModel(*, collaborative: bool, description: str | None = None, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, images: Sequence[ImageModel] | None = None, name: str, owner: PlaylistOwnerModel, public: bool | None = None, snapshot_id: str, type: Literal['playlist'], uri: SpotifyPlaylistURI, items: PagedResultModel[PlaylistTrackModel])

Bases: PlaylistBaseModel

Model representing a playlist owned by a Spotify user.

items: PagedResultModel[PlaylistTrackModel]

The tracks of the playlist.

class PlaylistSummaryModel(*, href: HttpUrl, total: int)

Bases: BaseModel

Model representing information to retrieve full details of the playlist’s tracks.

tracks_href: HttpUrl

A link to the Web API endpoint where full details of the playlist’s tracks can be retrieved.

tracks_total: int

Number of tracks in the playlist.

class PlaylistTrackModel(*, added_at: datetime | None = None, added_by: PlaylistOwnerModel | None = None, is_local: bool, item: TrackModel | EpisodeModel)

Bases: BaseModel

Model representing full details of the items of a playlist owned by a Spotify user.

added_at: datetime | None

The date and time the track or episode was added.

added_by: PlaylistOwnerModel | None

The Spotify user who added the track or episode.

is_local: bool

Whether this track or episode is a local file or not.

item: TrackModel | EpisodeModel

Information about the track or episode.

class SavedAlbumModel(*, added_at: datetime, album: AlbumModel)

Bases: BaseModel

Model representing an album saved in the current Spotify user’s ‘Your Music’ library.

added_at: datetime

The date and time the album was saved Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ

album: AlbumModel

Information about the album.

class SavedEpisodeModel(*, added_at: datetime, episode: EpisodeModel)

Bases: BaseModel

Model representing an episode saved in the current Spotify user’s library.

added_at: datetime

The date and time the episode was saved. Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ.

episode: EpisodeModel

Information about the episode.

class SavedShowModel(*, added_at: datetime, show: SimplifiedShowModel)

Bases: BaseModel

Model representing a show saved in the current Spotify user’s library.

added_at: datetime

The date and time the episode was saved. Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ.

show: SimplifiedShowModel

Information about the show.

class SavedTrackModel(*, added_at: datetime, track: TrackModel)

Bases: BaseModel

Model representing a track saved in the current Spotify user’s ‘Your Music’ library.

added_at: datetime

The date and time the episode was saved. Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ.

track: TrackModel

Information about the track.

class ShowModel(*, available_markets: Sequence[SpotifyMarketID] | None = None, copyrights: Sequence[CopyrightModel], description: str, html_description: str, explicit: bool, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, images: Sequence[ImageModel], is_externally_hosted: bool, languages: Sequence[str], media_type: str, name: str, publisher: str | None = None, type: Literal['show'], uri: SpotifyShowURI, total_episodes: int, episodes: PagedResultModel[SimplifiedEpisodeModel])

Bases: SimplifiedShowModel

Model representing catalog information for a single show identified by its unique Spotify ID.

available_markets

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

episodes: PagedResultModel[SimplifiedEpisodeModel]

The episodes of the show.

publisher

The publisher of the show.

class SimplifiedAlbumModel(*, album_type: AlbumTypes, total_tracks: int, available_markets: Sequence[SpotifyMarketID] | None = None, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, images: Sequence[ImageModel], name: str, release_date: date, release_date_precision: Literal['year', 'month', 'day'], restrictions: RestrictionsModel | None = None, type: Literal['album'], uri: SpotifyAlbumURI, artists: Sequence[SimplifiedArtistModel], album_group: str | None = None)

Bases: BaseModel

Model representing simplified Spotify catalog information for a single album.

classmethod fix_date_by_precision(data: dict) dict

Fixes the release_date field based on the release_date_precision field.

Parameters:

data – The input data to validate.

Returns:

The validated data with fixed release_date field.

album_group: str | None

This field describes the relationship between the artist and the album.

album_href: HttpUrl

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

album_id: SpotifyItemID

The Spotify ID for the album.

album_name: str

The name of the album. In case of an album takedown, the value may be an empty string.

album_type: AlbumTypes

The type of the album.

album_uri: SpotifyAlbumURI

The Spotify URI for the album.

artists: Sequence[SimplifiedArtistModel]

The artists of the album.

available_markets: Sequence[SpotifyMarketID] | None

The markets in which the album is available.

external_urls: ExternalUrlsModel

Known external URLs for this album.

images: Sequence[ImageModel]

The cover art for the album in various sizes, widest first.

item_type: Literal['album']

The item type.

release_date: date

The date the album was first released.

release_date_precision: Literal['year', 'month', 'day']

The precision with which release_date value is known.

restrictions: RestrictionsModel | None

Included in the response when a content restriction is applied.

total_tracks: int

The number of tracks in the album.

class SimplifiedArtistModel(*, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, name: str, type: Literal['artist'], uri: SpotifyArtistURI)

Bases: BaseModel

Model representing simplified Spotify catalog information for a single artist.

artist_href: HttpUrl

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

artist_id: SpotifyItemID

The Spotify ID for the artist.

artist_name: str

The name of the artist.

artist_uri: SpotifyArtistURI

The Spotify URI for the artist.

external_urls: ExternalUrlsModel

Known external URLs for this artist.

item_type: Literal['artist']

The object type.

class SimplifiedEpisodeModel(*, audio_preview_url: HttpUrl | None = None, description: str, html_description: str, duration_ms: timedelta, explicit: bool, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, images: Sequence[ImageModel], is_externally_hosted: bool, is_playable: bool, language: str, languages: Sequence[str], name: str, release_date: date, release_date_precision: Literal['year', 'month', 'day'], resume_point: ResumePointModel | None = None, type: Literal['episode'], uri: SpotifyEpisodeURI, restrictions: RestrictionsModel | None = None)

Bases: BaseModel

Model representing simplified Spotify catalog information for a single episode.

classmethod convert_duration_ms_to_timedelta(value: int) timedelta

Converts episode duration given in milliseconds to timedelta object.

Parameters:

value – Episode duration [milliseconds].

Returns:

Episode duration as timedelta object.

classmethod fix_date_by_precision(data: dict) dict

Fixes the release_date field based on the release_date_precision field.

Parameters:

data – The input data to validate.

Returns:

The validated data with fixed release_date field.

audio_preview_url: HttpUrl | None

A URL to a 30 second preview (MP3 format) of the episode.

description: str

A description of the episode.

duration: timedelta

The episode length in milliseconds.

episode_href: HttpUrl

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

episode_id: SpotifyItemID

The Spotify ID for the episode.

episode_name: str

The name of the episode.

episode_uri: SpotifyEpisodeURI

The Spotify URI for the episode.

explicit: bool

Whether or not the episode has explicit content.

external_urls: ExternalUrlsModel

External URLs for this episode.

html_description: str

A description of the episode. This field may contain HTML tags.

images: Sequence[ImageModel]

The cover art for the episode in various sizes, widest first.

is_externally_hosted: bool

True if the episode is hosted outside of Spotify’s CDN.

is_playable: bool

True if the episode is playable in the given market. Otherwise False.

item_type: Literal['episode']

The item type.

language: str

The language used in the episode, identified by a ISO 639 code.

languages: Sequence[str]

A list of the languages used in the episode, identified by their ISO 639-1 code.

release_date: date

The date the episode was first released.

release_date_precision: Literal['year', 'month', 'day']

The precision with which release_date value is known.

restrictions: RestrictionsModel | None

Included in the response when a content restriction is applied.

resume_point: ResumePointModel | None

The user’s most recent position in the episode

class SimplifiedPlaylistModel(*, collaborative: bool, description: str | None = None, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, images: Sequence[ImageModel] | None = None, name: str, owner: PlaylistOwnerModel, public: bool | None = None, snapshot_id: str, type: Literal['playlist'], uri: SpotifyPlaylistURI, tracks: PlaylistSummaryModel | None = None)

Bases: PlaylistBaseModel

Model representing simplified Spotify catalog information for a single playlist.

tracks: PlaylistSummaryModel | None

A collection containing a link ( href ) to the Web API endpoint where full details of the playlist’s tracks can be retrieved.

class SimplifiedShowModel(*, available_markets: Sequence[SpotifyMarketID] | None = None, copyrights: Sequence[CopyrightModel], description: str, html_description: str, explicit: bool, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, images: Sequence[ImageModel], is_externally_hosted: bool, languages: Sequence[str], media_type: str, name: str, publisher: str | None = None, type: Literal['show'], uri: SpotifyShowURI, total_episodes: int)

Bases: BaseModel

Model representing simplified Spotify catalog information for a single show.

available_markets: Sequence[SpotifyMarketID] | None

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

copyrights: Sequence[CopyrightModel]

The copyright statements of the show.

description: str

A description of the show. HTML tags are stripped away from this field.

explicit: bool

Whether or not the show has explicit content.

external_urls: ExternalUrlsModel

External URLs for this show.

html_description: str

A description of the show. This field may contain HTML tags.

images: Sequence[ImageModel]

The cover art for the show in various sizes, widest first.

is_externally_hosted: bool

True if all of the shows episodes are hosted outside of Spotify’s CDN.

item_type: Literal['show']

The item type.

languages: Sequence[str]

A list of the languages used in the show, identified by their ISO 639 code.

media_type: str

The media type of the show.

publisher: str | None

The publisher of the show.

show_href: HttpUrl

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

show_id: SpotifyItemID

The Spotify ID for the show.

show_name: str

The name of the episode.

show_uri: SpotifyShowURI

The Spotify URI for the show.

total_episodes: int

The total number of episodes in the show.

class SimplifiedTrackModel(*, artists: Sequence[SimplifiedArtistModel], available_markets: Sequence[SpotifyMarketID] | None = None, disc_number: int, duration_ms: timedelta, explicit: bool, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, is_playable: bool | None = None, linked_from: LinkedFromModel | None = None, restrictions: RestrictionsModel | None = None, name: str, preview_url: str | None = None, track_number: int, type: Literal['track'], uri: SpotifyTrackURI, is_local: bool)

Bases: BaseModel

Model representing simplified Spotify catalog information for a single track.

classmethod convert_duration_ms_to_timedelta(value: int) timedelta

Converts track duration given in milliseconds to timedelta object.

Parameters:

value – Track duration [milliseconds].

Returns:

Track duration as timedelta object.

artists: Sequence[SimplifiedArtistModel]

The artists who performed the track.

available_markets: Sequence[SpotifyMarketID] | None

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

disc_number: int

The disc number.

duration: timedelta

The track length in milliseconds.

explicit: bool

Whether or not the track has explicit lyrics.

external_urls: ExternalUrlsModel

Known external URLs for this track.

is_local: bool

Whether or not the track is from a local file.

is_playable: bool | None

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

item_type: Literal['track']

The item type.

linked_from: LinkedFromModel | None

Part of the response when Track Relinking is applied, and the requested track has been replaced with different track.

preview_url: str | None

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

restrictions: RestrictionsModel | None

Included in the response when a content restriction is applied.

track_href: HttpUrl

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

track_id: SpotifyItemID

The Spotify ID for the track.

track_name: str

The name of the track.

track_number: int

The number of the track.

track_uri: SpotifyTrackURI

The Spotify URI for the track.

class TrackModel(*, artists: Sequence[SimplifiedArtistModel], available_markets: Sequence[SpotifyMarketID] | None = None, disc_number: int, duration_ms: timedelta, explicit: bool, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, is_playable: bool | None = None, linked_from: LinkedFromModel | None = None, restrictions: RestrictionsModel | None = None, name: str, preview_url: str | None = None, track_number: int, type: Literal['track'], uri: SpotifyTrackURI, is_local: bool, album: SimplifiedAlbumModel, external_ids: ExternalIdsModel | None = None, popularity: int | None = None)

Bases: SimplifiedTrackModel

Model representing Spotify catalog information for a single track identified by its unique Spotify ID.

album: SimplifiedAlbumModel

The album on which the track appears.

available_markets

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

external_ids: ExternalIdsModel | None

Known external IDs for the track.

linked_from

Part of the response when Track Relinking is applied, and the requested track has been replaced with different track.

popularity: int | None

The popularity of the track.

preview_url

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

class UserModel(*, display_name: str | None = None, external_urls: ExternalUrlsModel, href: HttpUrl, id: str, images: Sequence[ImageModel], type: Literal['user'], uri: SpotifyUserURI, followers: FollowersModel | None = None)

Bases: BaseModel

Model representing public profile information about a Spotify user.

display_name: str | None

The name displayed on the user’s profile.

external_urls: ExternalUrlsModel

Known external URLs for this user.

followers: FollowersModel | None

Information about the followers of the user.

images: Sequence[ImageModel]

The user’s profile image.

item_type: Literal['user']

The item type.

user_href: HttpUrl

A link to the Web API endpoint for this user.

user_id: str

The Spotify user ID for the user.

user_uri: SpotifyUserURI

The Spotify URI for the user.

Spotify submodels

class ContextModel(*, type: SpotifyItemType, href: HttpUrl, external_urls: ExternalUrlsModel, uri: SpotifyItemURI)

Bases: BaseModel

Model representing information about playback context.

context_href: HttpUrl

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

context_type: SpotifyItemType

The item type.

context_uri: SpotifyItemURI

The Spotify URI for the context.

external_urls: ExternalUrlsModel

External URLs for this context.

class CopyrightModel(*, text: str, type: Literal['C', 'P'])

Bases: BaseModel

Model representing the copyright statements.

copyright_type: Literal['C', 'P']

The type of copyright.

text: str

The copyright text for this content.

class CursorsModel(*, after: str | None = None, before: str | None = None)

Bases: BaseModel

Model representing the cursors used to find the next set of items.

after: str | None

The cursor to use as key to find the next page of items.

before: str | None

The cursor to use as key to find the previous page of items.

class ExplicitContentModel(*, filter_enabled: bool, filter_locked: bool)

Bases: BaseModel

Model representing user’s explicit content settings.

filter_enabled: bool

When True, indicates that explicit content should not be played.

filter_locked: bool

When True, indicates that the explicit content setting is locked and can’t be changed by the user.

class ExternalIdsModel(*, isrc: str | None = None, ean: str | None = None, upc: str | None = None)

Bases: BaseModel

Model representing known external IDs.

international_article_number: str | None

International Article Number.

international_standard_recording_code: str | None

International Standard Recording Code.

universal_product_code: str | None

Universal Product Code.

class ExternalUrlsModel(*, spotify: HttpUrl | None = None)

Bases: BaseModel

Model representing information about external URLs for an item.

spotify: HttpUrl | None

The Spotify URL for the object.

class FollowersModel(*, href: HttpUrl | None = None, total: int)

Bases: BaseModel

Model representing the information about the followers of an item.

href: HttpUrl | None

This will always be set to null, as the Web API does not support it at the moment.

total: int

The total number of followers.

class LinkedFromModel(*, external_urls: ExternalUrlsModel, href: HttpUrl, id: SpotifyItemID, type: Literal['track'], uri: SpotifyTrackURI)

Bases: BaseModel

Model representing information about the Track Relinking.

external_urls: ExternalUrlsModel

Known external URLs for this track.

item_type: Literal['track']

The item type.

track_href: HttpUrl

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

track_id: SpotifyItemID

The Spotify ID for the track.

track_uri: SpotifyTrackURI

The Spotify URI for the track.

class PlaybackActionsModel(*, interrupting_playback: bool | None = None, pausing: bool | None = None, resuming: bool | None = None, seeking: bool | None = None, skipping_next: bool | None = None, skipping_prev: bool | None = None, toggling_repeat_context: bool | None = None, toggling_shuffle: bool | None = None, toggling_repeat_track: bool | None = None, transferring_playback: bool | None = None)

Bases: BaseModel

Model representing information about playback actions that are available within the current context.

interrupting_playback: bool | None

Interrupting playback.

pausing: bool | None

Pausing.

resuming: bool | None

Resuming.

seeking: bool | None

Seeking playback location.

skipping_next: bool | None

Skipping to the next context.

skipping_prev: bool | None

Skipping to the previous context.

toggling_repeat_context: bool | None

Toggling repeat context flag.

toggling_repeat_track: bool | None

Toggling repeat track flag.

toggling_shuffle: bool | None

Toggling shuffle flag.

transferring_playback: bool | None

Transfering playback between devices.

class PlaylistOwnerModel(*, external_urls: ExternalUrlsModel, href: HttpUrl, id: str, type: Literal['user'], uri: SpotifyUserURI, display_name: str | None = None)

Bases: BaseModel

Model representing information about the user who owns the playlist.

display_name: str | None

The name displayed on the user’s profile.

external_urls: ExternalUrlsModel

Known public external URLs for this user.

item_type: Literal['user']

The item type.

user_href: HttpUrl

A link to the Web API endpoint for this user.

user_id: str

The Spotify user ID for this user.

user_uri: SpotifyUserURI

The Spotify URI for this user.

class RestrictionsModel(*, reason: Literal['market', 'product', 'explicit'] | None = None)

Bases: BaseModel

Model representing content restriction.

reason: Literal['market', 'product', 'explicit'] | None

The reason for the restriction.

class ResumePointModel(*, fully_played: bool, resume_position_ms: timedelta)

Bases: BaseModel

Model representing user’s most recent position in the episode.

classmethod convert_resume_position_ms_to_timedelta(value: int) timedelta

Converts a resume position given in milliseconds to timedelta object.

Parameters:

value – Resume position [milliseconds].

Returns:

Resume position as timedelta object.

fully_played: bool

Whether or not the episode has been fully played by the user.

resume_position: timedelta

The user’s most recent position in the episode in milliseconds.