Package-level declarations

Types

Link copied to clipboard
@Serializable
abstract class AbstractPagingObject<T : Any, Z : AbstractPagingObject<T, Z>> : PagingObjectBase<T, Z> , List<T?>

The offset-based paging object is a container for a set of objects. It contains a key called items (whose value is an array of the requested objects) along with other keys like previous, next and limit that can be useful in future calls.

Link copied to clipboard
@Serializable
data class Album(albumTypeString: String, availableMarketsString: List<String> = listOf(), externalIdsString: Map<String, String> = hashMapOf(), externalUrlsString: Map<String, String> = mapOf(), val href: String, val id: String, val uri: AlbumUri, val artists: List<SimpleArtist>, val copyrights: List<SpotifyCopyright>, val genres: List<String>, val images: List<SpotifyImage>? = null, val label: String, val name: String, val popularity: Double, releaseDateString: String, val releaseDatePrecision: String, val tracks: PagingObject<SimpleTrack>, val type: String, val totalTracks: Int, val restrictions: Restrictions? = null) : CoreObject

Represents an Album on Spotify

Link copied to clipboard

Album search type

Link copied to clipboard

Represents a Spotify Album URI (spotify:album:XXXXXXXXXX), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
object AlbumUriSerializer : KSerializer<AlbumUri>
Link copied to clipboard
@Serializable
data class Artist(externalUrlsString: Map<String, String>, val href: String, val id: String, val uri: ArtistUri, val followers: Followers, val genres: List<String>, val images: List<SpotifyImage>? = null, val name: String? = null, val popularity: Double, val type: String) : CoreObject

Represents an Artist (distinct from a regular user) on Spotify

Link copied to clipboard
@Serializable(with = ArtistUriSerializer::class)
class ArtistUri(input: String) : SpotifyUri, ContextUri

Represents a Spotify Artist URI (spotify:artist:XXXXXXXXXX), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
object ArtistUriSerializer : KSerializer<ArtistUri>
Link copied to clipboard
@Serializable
data class AudioAnalysis(val bars: List<TimeInterval>, val beats: List<TimeInterval>, val meta: AudioAnalysisMeta, val sections: List<AudioSection>, val segments: List<AudioSegment>, val tatums: List<TimeInterval>, val track: TrackAnalysis)

The Audio Analysis endpoint provides low-level audio analysis for all of the tracks in the Spotify catalog. The Audio Analysis describes the track’s structure and musical content, including rhythm, pitch, and timbre. All information is precise to the audio sample. Many elements of analysis include confidence values, a floating-point number ranging from 0.0 to 1.0. Confidence indicates the reliability of its corresponding attribute. Elements carrying a small confidence value should be considered speculative. There may not be sufficient data in the audio to compute the attribute with high certainty.

Link copied to clipboard
@Serializable
data class AudioAnalysisMeta(val analyzerVersion: String, val platform: String, val detailedStatus: String, val statusCode: Int? = null, val timestamp: Long, val analysisTime: Float, val inputProcess: String)

Information about the analysis run

Link copied to clipboard
@Serializable
data class AudioFeatures(val acousticness: Float, val analysisUrl: String, val danceability: Float, val durationMs: Int, val energy: Float, val id: String, val instrumentalness: Float, val key: Int, val liveness: Float, val loudness: Float, val mode: Int, val speechiness: Float, val tempo: Float, val timeSignature: Int, val trackHref: String, val type: String, val uri: PlayableUri, val valence: Float)

General attributes of a Track

Link copied to clipboard
@Serializable
data class AudioSection(val start: Float = 0.0f, val duration: Float, val confidence: Float, val loudness: Float, val tempo: Float? = null, val tempoConfidence: Float? = null, val key: Int, val keyConfidence: Float? = null, val mode: Int? = null, val modeConfidence: Float? = null, val timeSignature: Int, val timeSignatureConfidence: Float)

Sections are defined by large variations in rhythm or timbre, e.g. chorus, verse, bridge, guitar solo, etc. Each section contains its own descriptions of tempo, key, mode, time_signature, and loudness.*

Link copied to clipboard
@Serializable
data class AudioSegment(val start: Float? = null, val duration: Float, val confidence: Float? = null, val loudnessStart: Float, val loudnessMaxTime: Float? = null, val loudnessMax: Float, val loudnessEnd: Float? = null, val pitches: List<Float>, val timbre: List<Float>)

Audio segments attempts to subdivide a song into many segments, with each segment containing a roughly consistent sound throughout its duration.

Link copied to clipboard
@Serializable
data class AuthenticationError(val error: String, val description: String? = null)

An exception during the authentication process

Link copied to clipboard
@Serializable(with = CollectionUriSerializer::class)
sealed class CollectionUri : SpotifyUri

Represents a Spotify Collection URI (one of PlaylistUri or ImmutableCollectionUri), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
object CollectionUriSerializer : KSerializer<CollectionUri>
Link copied to clipboard
@Serializable(with = ContextUriSerializer::class)
interface ContextUri : ISpotifyUri

Represents a Spotify Context URI (one of AlbumUri, ArtistUri, PlaylistUri, UserCollectionUri, or ShowUri),

Link copied to clipboard
object ContextUriSerializer : KSerializer<ContextUri>
Link copied to clipboard

Copyright statement type of an Album

Link copied to clipboard
@Serializable
abstract class CoreObject : Identifiable

Represents a core Spotify object such as a Track or Album

Link copied to clipboard
@Serializable
data class CurrentlyPlayingContext(val timestamp: Long, val device: Device, val progressMs: Int? = null, val isPlaying: Boolean, val item: Playable? = null, val shuffleState: Boolean, val repeatStateString: String, val context: SpotifyContext? = null)

Information about the current playback

Link copied to clipboard
@Serializable
data class CurrentlyPlayingObject(val context: SpotifyContext? = null, val timestamp: Long, val progressMs: Int? = null, val isPlaying: Boolean, val item: Playable? = null, currentlyPlayingTypeString: String, val actions: PlaybackActions)

Information about the currently playing track and context

Link copied to clipboard

The object type of the currently playing item

Link copied to clipboard
@Serializable
data class CurrentUserQueue(val currentlyPlaying: Playable? = null, val queue: List<Playable>)
Link copied to clipboard
@Serializable
data class Cursor(val before: String? = null, val after: String? = null)

The cursor to use as key to find the next (or previous) page of items.

Link copied to clipboard
@Serializable
data class CursorBasedPagingObject<T : Any>(val href: String, val items: List<T>, val limit: Int, val next: String? = null, val cursor: Cursor? = null, val total: Int = 0, val offset: Int = 0, val previous: String? = null) : PagingObjectBase<T, CursorBasedPagingObject<T>>

The cursor-based paging object is a container for a set of objects. It contains a key called items (whose value is an array of the requested objects) along with other keys like next and cursors that can be useful in future calls.

Link copied to clipboard
@Serializable
data class Device(val id: String? = null, val isActive: Boolean, val isPrivateSession: Boolean, val isRestricted: Boolean, val name: String, val typeString: String, val volumePercent: Int) : IdentifiableNullable

A device which is connected to the Spotify user

Link copied to clipboard

Electronic type of registered Spotify device

Link copied to clipboard
@Serializable
data class DisallowablePlaybackAction(val action: PlaybackAction, val disallowed: Boolean)

Maps a playback action to whether the user is disallowed from doing it

Link copied to clipboard
@Serializable
data class Episode(val audioPreviewUrl: String? = null, val description: String? = null, val durationMs: Int, val explicit: Boolean, externalUrlsString: Map<String, String>, val href: String, val id: String, val images: List<SpotifyImage>? = null, val isExternallyHosted: Boolean, val isPlayable: Boolean, language: String? = null, showLanguagesPrivate: List<String>, val name: String, releaseDateString: String? = null, val releaseDatePrecisionString: String? = null, val resumePoint: ResumePoint? = null, val show: SimpleShow, val type: String, val uri: EpisodeUri) : CoreObject, Playable

An episode (podcast) on Spotify

Link copied to clipboard
@Serializable(with = EpisodeUriSerializer::class)
class EpisodeUri(input: String) : PlayableUri

Represents a Spotify Episode URI (spotify:episode:XXXXXXXXXX), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
object EpisodeUriSerializer : KSerializer<EpisodeUri>
Link copied to clipboard
@Serializable
data class ErrorObject(val status: Int, val message: String, val reason: String? = null)

An endpoint exception from Spotify

Link copied to clipboard
@Serializable
data class ErrorResponse(val error: ErrorObject, val exception: Exception? = null)

Wraps around ErrorObject. Serialized raw Spotify error response

Link copied to clipboard
@Serializable
data class ExplicitContentSettings(val filterEnabled: Boolean, val filterLocked: Boolean)
Link copied to clipboard
class ExternalId(val key: String, val id: String)

An external id linked to the result object

Link copied to clipboard
@Serializable
class ExternalUrl(val name: String, val url: String)

Key/value pair mapping a name to an arbitrary url

Link copied to clipboard
@Serializable
data class FeaturedPlaylists(val message: String, val playlists: PagingObject<SimplePlaylist>)

Spotify featured playlists (on the Browse tab)

Link copied to clipboard
@Serializable(with = FollowersSerializer::class)
data class Followers(val href: String? = null, val total: Int? = null)

Information about a Spotify user's followers

Link copied to clipboard
@Serializable
abstract class Identifiable : IdentifiableNullable

Represents an identifiable Spotify object such as an Album or Recommendation Seed

Link copied to clipboard
@Serializable
abstract class IdentifiableNullable : NeedsApi

Represents an identifiable Spotify object such as an Album or Recommendation Seed

Link copied to clipboard

Represents a Spotify Immutable Collection URI (one of AlbumUri or ShowUri), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
interface ISpotifyUri
Link copied to clipboard
@Serializable
data class LinkedTrack(externalUrlsString: Map<String, String>, val href: String, val id: String, val uri: PlayableUri, val type: String) : CoreObject

Represents a relinked track. This is playable in the searched market. If null, the API result is playable in the market.

Link copied to clipboard
@Serializable
data class LocalTrack(val album: SimpleLocalAlbum, val artists: List<SimpleLocalArtist>, val href: String? = null, val id: String? = null, val discNumber: String? = null, val durationMs: Int? = null, val explicit: Boolean? = null, val isLocal: Boolean = true, val name: String, val popularity: Double? = null, val trackNumber: Int? = null, val type: String, val uri: LocalTrackUri) : IdentifiableNullable, Playable

Local track object that representing a song uploaded from a client locally

Link copied to clipboard
@Serializable(with = LocalTrackUriSerializer::class)
class LocalTrackUri(input: String) : PlayableUri

Represents a Spotify Local Track URI (spotify:local:XXXXXXXXXX), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
object LocalTrackUriSerializer : KSerializer<LocalTrackUri>
Link copied to clipboard
@Serializable
abstract class NeedsApi

Provide access to the underlying SpotifyApi

Link copied to clipboard
@Serializable
class NullablePagingObject<T : Any>(val href: String, val items: List<T?>, val limit: Int, val next: String? = null, val offset: Int, val previous: String? = null, val total: Int = 0) : AbstractPagingObject<T, NullablePagingObject<T>>

The offset-based nullable paging object is a container for a set of objects. It contains a key called items (whose value is an array of the requested objects) along with other keys like previous, next and limit that can be useful in future calls. Its items are not guaranteed to be not null

Link copied to clipboard
@Serializable
data class PagingObject<T : Any>(val href: String, val items: List<T>, val limit: Int, val next: String? = null, val offset: Int, val previous: String? = null, val total: Int = 0) : AbstractPagingObject<T, PagingObject<T>>

The offset-based non-nullable paging object is a container for a set of objects. It contains a key called items (whose value is an array of the requested objects) along with other keys like previous, next and limit that can be useful in future calls.

Link copied to clipboard
@Serializable
abstract class PagingObjectBase<T : Any, Z : PagingObjectBase<T, Z>> : NeedsApi, List<T?>
Link copied to clipboard
@Serializable(with = PlayableSerializer::class)
interface Playable

A local track, episode, or track. Serialized with PlayableSerializer

Link copied to clipboard
object PlayableSerializer : KSerializer<Playable>
Link copied to clipboard
@Serializable(with = PlayableUriSerializer::class)
sealed class PlayableUri : SpotifyUri

Represents a Spotify Playable URI (one of SpotifyTrackUri, LocalTrackUri, or EpisodeUri), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
object PlayableUriSerializer : KSerializer<PlayableUri>
Link copied to clipboard

Action a user takes that will affect current playback

Link copied to clipboard
@Serializable
data class PlaybackActions(val disallowsString: Map<String, Boolean?>)

List of playback actions (pause, resume, etc) which a user is disallowed or allowed to do. Playback actions NOT in disallows are allowed.

Link copied to clipboard
@Serializable
data class PlayHistory(val track: Track, val playedAt: String, val context: SpotifyContext? = null)

Information about a previously-played track

Link copied to clipboard
@Serializable
data class Playlist(externalUrlsString: Map<String, String>, val href: String, val id: String, val uri: PlaylistUri, val collaborative: Boolean, val description: String? = null, val followers: Followers, val primaryColor: String? = null, val images: List<SpotifyImage>? = null, val name: String, val owner: SpotifyPublicUser, val public: Boolean? = null, snapshotIdString: String, val tracks: PagingObject<PlaylistTrack>, val type: String) : CoreObject

Represents a Playlist on Spotify

Link copied to clipboard
@Serializable
data class PlaylistTrack(val primaryColor: String? = null, val addedAt: String? = null, val addedBy: SpotifyPublicUser? = null, val isLocal: Boolean? = null, val track: Playable? = null, val videoThumbnail: VideoThumbnail? = null)

Represents a Spotify track inside a Playlist

Link copied to clipboard
@Serializable
data class PlaylistTrackInfo(val href: String, val total: Int? = null)

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

Link copied to clipboard

Represents a Spotify Playlist URI (spotify:playlist:XXXXXXXXXX), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
object PlaylistUriSerializer : KSerializer<PlaylistUri>
Link copied to clipboard
@Serializable
data class PodcastEpisodeTrack(val album: SimpleAlbum, val artists: List<SimpleArtist>, availableMarketsString: List<String> = listOf(), val discNumber: Int, val durationMs: Int, val episode: Boolean? = null, val explicit: Boolean, externalUrlsString: Map<String, String>, externalIdsString: Map<String, String> = hashMapOf(), val href: String, val id: String, val isLocal: Boolean? = null, val isPlayable: Boolean = true, val name: String, val popularity: Double, val previewUrl: String? = null, val track: Boolean? = null, val trackNumber: Int, val type: String, val uri: PlayableUri, val linkedTrack: LinkedTrack? = null) : RelinkingAvailableResponse, Playable

An episode (podcast) on Spotify

Link copied to clipboard
@Serializable
data class RecommendationResponse(val seeds: List<RecommendationSeed>, val tracks: List<Track>)
Link copied to clipboard
@Serializable
data class RecommendationSeed(val href: String? = null, val id: String, val initialPoolSize: Int, val afterFilteringSize: Int, val afterRelinkingSize: Int? = null, val type: String) : Identifiable

Seed from which the recommendation was constructed

Link copied to clipboard
@Serializable
data class ReleaseDate(val year: Int, val month: Int?, val day: Int?)
Link copied to clipboard
@Serializable
abstract class RelinkingAvailableResponse : CoreObject

Represents a response for which a relinked track could be available

Link copied to clipboard
@Serializable
data class Restrictions(val reason: String)

Contains an explanation of why a track is not available

Link copied to clipboard
interface ResultEnum

Interface that allows easy identifier retrieval for children with an implemented identifier

Link copied to clipboard
@Serializable
data class ResumePoint(val fullyPlayed: Boolean, val resumePositionMs: Int)

Represents the user’s most recent position in the episode. Set if the supplied access token is a user token and has the scope SpotifyScope.UserReadPlaybackPosition.

Link copied to clipboard
@Serializable
data class SavedAlbum(val addedAt: String, val album: Album)

Represents an album saved in a user's library

Link copied to clipboard
@Serializable
data class SavedEpisode(val addedAt: String, val episode: Episode)

Represents an episode saved in a user's library

Link copied to clipboard
@Serializable
data class SavedShow(val addedAt: String, val show: SimpleShow)

Represents a show saved in a user's library

Link copied to clipboard
@Serializable
data class SavedTrack(val addedAt: String, val track: Track)

Represents a track saved in a user's library

Link copied to clipboard
data class SearchFilter(val filterType: SearchFilterType, val filterValue: String)

A filter of type SearchFilterType. Should be unique by type.

Link copied to clipboard

Available filters that Spotify allows in search, in addition to filtering by object type.

Link copied to clipboard
@Serializable
data class Show(availableMarketsString: List<String> = listOf(), val copyrights: List<SpotifyCopyright>, val description: String? = null, val explicit: Boolean, val episodes: NullablePagingObject<SimpleEpisode>, externalUrlsString: Map<String, String>, val href: String, val id: String, val images: List<SpotifyImage>, val isExternallyHosted: Boolean? = null, val languagesString: List<String>, val mediaType: String, val name: String, val publisher: String, val type: String, val uri: ShowUri) : CoreObject

Information about a Spotify show, including its episodes

Link copied to clipboard

Represents a Spotify Show URI (spotify:show:XXXXXXXXXX), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
object ShowUriSerializer : KSerializer<ShowUri>
Link copied to clipboard
@Serializable
data class SimpleAlbum(albumTypeString: String, availableMarketsString: List<String> = listOf(), externalUrlsString: Map<String, String>, val href: String, val id: String, val uri: SpotifyUri, val artists: List<SimpleArtist>, val images: List<SpotifyImage>? = null, val name: String, val type: String, val restrictions: Restrictions? = null, releaseDateString: String? = null, val releaseDatePrecisionString: String? = null, val totalTracks: Int? = null, albumGroupString: String? = null) : CoreObject

Simplified Album object that can be used to retrieve a full Album

Link copied to clipboard
@Serializable
data class SimpleArtist(externalUrlsString: Map<String, String>, val href: String, val id: String, val uri: SpotifyUri, val name: String? = null, val type: String) : CoreObject

Simplified Artist object that can be used to retrieve a full Artist

Link copied to clipboard
@Serializable
data class SimpleEpisode(val audioPreviewUrl: String? = null, val description: String? = null, val durationMs: Int, val explicit: Boolean, externalUrlsString: Map<String, String>, val href: String, val id: String, val images: List<SpotifyImage>? = null, val isExternallyHosted: Boolean, val isPlayable: Boolean, language: String? = null, showLanguagesPrivate: List<String>, val name: String, releaseDateString: String? = null, val releaseDatePrecisionString: String? = null, val resumePoint: ResumePoint? = null, val type: String, val uri: SpotifyUri) : CoreObject

A simplified episode (podcast) on Spotify

Link copied to clipboard
@Serializable
data class SimpleLocalAlbum(val albumType: String? = null, val artists: List<SimpleLocalArtist> = listOf(), val name: String, releaseDate: String? = null, val releaseDatePrecision: String? = null, val type: String)

Local album object that goes with LocalTrack - represents the local album it was obtained from (likely "Local Files")

Link copied to clipboard
@Serializable
data class SimpleLocalArtist(val name: String, val type: String)

Local artist object (goes with LocalTrack) representing an artist on a local track

Link copied to clipboard
@Serializable
data class SimplePlaylist(externalUrlsString: Map<String, String>, val href: String, val id: String, val uri: SpotifyUri, val collaborative: Boolean, val images: List<SpotifyImage>? = null, val name: String, val description: String? = null, val owner: SpotifyPublicUser, val primaryColor: String? = null, val public: Boolean? = null, snapshotIdString: String, val tracks: PlaylistTrackInfo, val type: String) : CoreObject

Simplified Playlist object that can be used to retrieve a full Playlist

Link copied to clipboard
@Serializable
data class SimpleShow(availableMarketsString: List<String> = listOf(), externalUrlsString: Map<String, String>, val copyrights: List<SpotifyCopyright>, val description: String? = null, val explicit: Boolean, val href: String, val id: String, val images: List<SpotifyImage>, val isExternallyHosted: Boolean? = null, languagesString: List<String>, val mediaType: String, val name: String, val publisher: String, val type: String, val uri: SpotifyUri) : CoreObject

Basic information about a Spotify show

Link copied to clipboard
@Serializable
data class SimpleTrack(externalUrlsString: Map<String, String>, availableMarketsString: List<String> = listOf(), externalIdsString: Map<String, String> = hashMapOf(), val href: String, val id: String, val uri: SpotifyUri, val artists: List<SimpleArtist>, val discNumber: Int, val durationMs: Int, val explicit: Boolean, val isPlayable: Boolean = true, val linkedTrack: LinkedTrack? = null, val name: String, val previewUrl: String? = null, val trackNumber: Int, val type: String, val isLocal: Boolean? = null, val popularity: Double? = null, val restrictions: Restrictions? = null) : RelinkingAvailableResponse

Simplified Playlist object that can be used to retrieve a full Playlist

Link copied to clipboard
@Serializable
data class SpotifyCategory(val href: String, val id: String, val icons: List<SpotifyImage>, val name: String) : Identifiable

Spotify music category

Link copied to clipboard
@Serializable
data class SpotifyContext(externalUrlsString: Map<String, String>, val href: String, val uri: ContextUri, val typeString: String)

Context in which a track was played

Link copied to clipboard
@Serializable
data class SpotifyCopyright(textString: String, typeString: String)

Describes an album's copyright information

Link copied to clipboard
@Serializable
data class SpotifyImage(val height: Double? = null, val url: String, val width: Double? = null)

A Spotify image

Link copied to clipboard
@Serializable
data class SpotifyPublicUser(externalUrlsString: Map<String, String>, val href: String, val id: String, val uri: UserUri, val displayName: String? = null, val followers: Followers = Followers(null, -1), val images: List<SpotifyImage> = listOf(), val type: String) : CoreObject

Public information about a Spotify user

Link copied to clipboard

Thrown when SpotifyApiOptions.retryWhenRateLimited is false and requests have been ratelimited

Link copied to clipboard
@Serializable
data class SpotifySearchResult(val albums: PagingObject<SimpleAlbum>? = null, val artists: PagingObject<Artist>? = null, val playlists: PagingObject<SimplePlaylist>? = null, val tracks: PagingObject<Track>? = null, val episodes: NullablePagingObject<SimpleEpisode>? = null, val shows: NullablePagingObject<SimpleShow>? = null)
Link copied to clipboard

Represents a Spotify Track URI (spotify:track:XXXXXXXXXX), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
Link copied to clipboard
@Serializable(with = SpotifyUriSerializer::class)
sealed class SpotifyUri : ISpotifyUri

Represents any Spotify URI (one of ArtistUri, PlayableUri, ImmutableCollectionUri, UserUri, PlaylistUri), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard

Exception instantiating or deserializing a uri perceived as invalid

Link copied to clipboard
object SpotifyUriSerializer : KSerializer<SpotifyUri>
Link copied to clipboard
@Serializable
data class SpotifyUserInformation(externalUrlsString: Map<String, String>, val href: String, val id: String, val uri: UserUri, val country: String? = null, val displayName: String? = null, val email: String? = null, val followers: Followers, val images: List<SpotifyImage>? = null, val product: String? = null, val explicitContentSettings: ExplicitContentSettings? = null, val type: String) : CoreObject

Private information about a Spotify user. Each field may require a specific scope.

Link copied to clipboard
@Serializable
data class TimeInterval(val start: Float, val duration: Float, val confidence: Float)

This is a generic object used to represent various time intervals within Audio Analysis.

Link copied to clipboard
@Serializable
data class Token(var accessToken: String, val tokenType: String, var expiresIn: Int, var refreshToken: String? = null, scopeString: String? = null)

Represents a Spotify Token, retrieved through instantiating a SpotifyApi

Link copied to clipboard
@Serializable
data class TokenValidityResponse(val isValid: Boolean, val exception: Exception? = null)
Link copied to clipboard
@Serializable
data class Track(externalUrlsString: Map<String, String>, externalIdsString: Map<String, String> = hashMapOf(), availableMarketsString: List<String> = listOf(), val href: String, val id: String, val uri: PlayableUri, val album: SimpleAlbum, val artists: List<SimpleArtist>, val isPlayable: Boolean = true, val discNumber: Int, val durationMs: Int, val explicit: Boolean, val linkedTrack: LinkedTrack? = null, val name: String, val popularity: Double, val previewUrl: String? = null, val trackNumber: Int, val type: String, val isLocal: Boolean? = null, val restrictions: Restrictions? = null, val episode: Boolean? = null, val track: Boolean? = null) : RelinkingAvailableResponse, Playable

Represents a music track on Spotify

Link copied to clipboard
@Serializable
data class TrackAnalysis(val numSamples: Int, val duration: Float, val sampleMd5: String? = null, val offsetSeconds: Int? = null, val windowSeconds: Int? = null, val analysisSampleRate: Float, val analysisChannels: Int, val endOfFadeIn: Float, val startOfFadeOut: Float, val loudness: Float, val tempo: Float, val tempoConfidence: Float, val timeSignature: Int, val timeSignatureConfidence: Float, val key: Int, val keyConfidence: Float, val mode: Int? = null, val modeConfidence: Float, val codestring: String, val codeVersion: Float, val echoprintstring: String, val echoprintVersion: Float, val synchstring: String, val synchVersion: Float, val rhythmstring: String, val rhythmVersion: Float)

General information about the track as a whole

Link copied to clipboard

Represents a Spotify User Collection URI URI (spotify:user:XXXX:collection), parsed from either a Spotify ID or taken from an endpoint. It appears that this URI corresponds to the user's saved tracks collection in their library.

Link copied to clipboard
Link copied to clipboard
@Serializable(with = UserUriSerializer::class)
class UserUri(input: String) : SpotifyUri

Represents a Spotify User URI (spotify:user:XXXXXXXXXX), parsed from either a Spotify ID or taken from an endpoint.

Link copied to clipboard
object UserUriSerializer : KSerializer<UserUri>
Link copied to clipboard
@Serializable
data class VideoThumbnail(val url: String? = null)

Functions

Link copied to clipboard

Convert an album id or uri string to an AlbumUri object

Link copied to clipboard

Convert an artist id or uri string to an ArtistUri object

Link copied to clipboard

Convert a collection (playlist/ImmutableCollectionUri) id or uri string to an ImmutableCollectionUri object. If an id is provided or the input is ambiguous, PlaylistUri is preferred.

Link copied to clipboard

Convert any (artist, album, playlist, or show) uri string to a ContextUri object.

Link copied to clipboard

Convert an episode id or uri string to an EpisodeUri object

Link copied to clipboard

Convert an immutable collection (album/show) id or uri string to an ImmutableCollectionUri object. If an id is provided or the input is ambiguous, AlbumUri is preferred.

Link copied to clipboard

Convert a local track id or uri string to a LocalTrackUri object

Link copied to clipboard

Convert a playable (track/local track/episode) id or uri string to a PlayableUri object. If an id is provided or the input is ambiguous, SpotifyTrackUri is preferred.

Link copied to clipboard

Convert a playlist id or uri string to a PlaylistUri object

Link copied to clipboard

Convert a show id or uri string to a ShowUri object

Link copied to clipboard

Convert any (artist, PlayableUri, ImmutableCollectionUri, user, playlist) uri string to a SpotifyUri object. Ambiguity is not allowed.

Link copied to clipboard

Convert a track (non-local) id or uri string to a SpotifyTrackUri object

Link copied to clipboard

Convert a show id or uri string to a ShowUri object

Link copied to clipboard

Convert a user id or uri string to a UserUri object