Models
Model classes are Pydantic-based representations of Spotify API responses. They are shared by sync and async clients.
Auto-generated reference
The sections below are rendered from the source models to keep the reference consistent with the SDK.
Album models
Album models.
Album
pydantic-model
Bases: SimplifiedAlbum
Complete album with tracks, copyrights, and label info.
Show JSON schema:
{
"$defs": {
"Copyright": {
"additionalProperties": true,
"description": "Copyright statement. Type is 'C' (copyright) or 'P' (performance).",
"properties": {
"text": {
"title": "Text",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
}
},
"required": [
"text",
"type"
],
"title": "Copyright",
"type": "object"
},
"ExternalIds": {
"additionalProperties": true,
"description": "External identifiers: ISRC for tracks, EAN or UPC for albums.",
"properties": {
"isrc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Isrc"
},
"ean": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ean"
},
"upc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Upc"
}
},
"title": "ExternalIds",
"type": "object"
},
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
},
"LinkedFrom": {
"additionalProperties": true,
"description": "Original track info when track relinking has replaced the requested track.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "LinkedFrom",
"type": "object"
},
"Page_SimplifiedTrack_": {
"additionalProperties": true,
"properties": {
"href": {
"title": "Href",
"type": "string"
},
"limit": {
"title": "Limit",
"type": "integer"
},
"next": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Next"
},
"offset": {
"title": "Offset",
"type": "integer"
},
"previous": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Previous"
},
"total": {
"title": "Total",
"type": "integer"
},
"items": {
"items": {
"$ref": "#/$defs/SimplifiedTrack"
},
"title": "Items",
"type": "array"
}
},
"required": [
"href",
"limit",
"next",
"offset",
"previous",
"total",
"items"
],
"title": "Page[SimplifiedTrack]",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"SimplifiedArtist": {
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
},
"SimplifiedTrack": {
"additionalProperties": true,
"description": "Basic track info embedded in other objects.",
"properties": {
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"disc_number": {
"title": "Disc Number",
"type": "integer"
},
"duration_ms": {
"title": "Duration Ms",
"type": "integer"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"is_playable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Playable"
},
"linked_from": {
"anyOf": [
{
"$ref": "#/$defs/LinkedFrom"
},
{
"type": "null"
}
],
"default": null
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"preview_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Preview Url"
},
"track_number": {
"title": "Track Number",
"type": "integer"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"is_local": {
"title": "Is Local",
"type": "boolean"
}
},
"required": [
"artists",
"disc_number",
"duration_ms",
"explicit",
"external_urls",
"href",
"id",
"name",
"preview_url",
"track_number",
"type",
"uri",
"is_local"
],
"title": "SimplifiedTrack",
"type": "object"
}
},
"additionalProperties": true,
"description": "Complete album with tracks, copyrights, and label info.",
"properties": {
"album_type": {
"title": "Album Type",
"type": "string"
},
"total_tracks": {
"title": "Total Tracks",
"type": "integer"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"release_date": {
"title": "Release Date",
"type": "string"
},
"release_date_precision": {
"title": "Release Date Precision",
"type": "string"
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"type": {
"const": "album",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
},
"tracks": {
"$ref": "#/$defs/Page_SimplifiedTrack_"
},
"copyrights": {
"items": {
"$ref": "#/$defs/Copyright"
},
"title": "Copyrights",
"type": "array"
},
"external_ids": {
"$ref": "#/$defs/ExternalIds"
},
"label": {
"title": "Label",
"type": "string"
},
"popularity": {
"title": "Popularity",
"type": "integer"
}
},
"required": [
"album_type",
"total_tracks",
"external_urls",
"href",
"id",
"images",
"name",
"release_date",
"release_date_precision",
"type",
"uri",
"artists",
"tracks",
"copyrights",
"external_ids",
"label",
"popularity"
],
"title": "Album",
"type": "object"
}
Fields:
-
album_type(str) -
total_tracks(int) -
available_markets(list[str] | None) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
images(list[Image]) -
name(str) -
release_date(str) -
release_date_precision(str) -
restrictions(Restriction | None) -
type_(Literal['album']) -
uri(str) -
artists(list[SimplifiedArtist]) -
tracks(Page[SimplifiedTrack]) -
copyrights(list[Copyright]) -
external_ids(ExternalIds) -
label(str) -
popularity(int)
album_type
pydantic-field
artists
pydantic-field
available_markets = None
pydantic-field
copyrights
pydantic-field
external_ids
pydantic-field
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
images
pydantic-field
label
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
popularity
pydantic-field
release_date
pydantic-field
release_date_precision
pydantic-field
restrictions = None
pydantic-field
total_tracks
pydantic-field
tracks
pydantic-field
type_
pydantic-field
uri
pydantic-field
Copyright
pydantic-model
Bases: SpotifyModel
Copyright statement. Type is 'C' (copyright) or 'P' (performance).
Show JSON schema:
{
"additionalProperties": true,
"description": "Copyright statement. Type is 'C' (copyright) or 'P' (performance).",
"properties": {
"text": {
"title": "Text",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
}
},
"required": [
"text",
"type"
],
"title": "Copyright",
"type": "object"
}
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
text
pydantic-field
type_
pydantic-field
ExternalIds
pydantic-model
Bases: SpotifyModel
External identifiers: ISRC for tracks, EAN or UPC for albums.
Show JSON schema:
{
"additionalProperties": true,
"description": "External identifiers: ISRC for tracks, EAN or UPC for albums.",
"properties": {
"isrc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Isrc"
},
"ean": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ean"
},
"upc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Upc"
}
},
"title": "ExternalIds",
"type": "object"
}
Fields:
ean = None
pydantic-field
isrc = None
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
upc = None
pydantic-field
ExternalUrls
pydantic-model
Bases: SpotifyModel
URLs for opening a resource in the Spotify web player.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
spotify
pydantic-field
Image
pydantic-model
Bases: SpotifyModel
Cover art or profile image. Dimensions may be null for user-uploaded images.
Show JSON schema:
{
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
}
Fields:
height
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
url
pydantic-field
width
pydantic-field
Page
pydantic-model
Bases: SpotifyModel, Generic[T]
Paginated response containing items and navigation links.
Show JSON schema:
{
"additionalProperties": true,
"description": "Paginated response containing items and navigation links.",
"properties": {
"href": {
"title": "Href",
"type": "string"
},
"limit": {
"title": "Limit",
"type": "integer"
},
"next": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Next"
},
"offset": {
"title": "Offset",
"type": "integer"
},
"previous": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Previous"
},
"total": {
"title": "Total",
"type": "integer"
},
"items": {
"items": {},
"title": "Items",
"type": "array"
}
},
"required": [
"href",
"limit",
"next",
"offset",
"previous",
"total",
"items"
],
"title": "Page",
"type": "object"
}
Fields:
-
href(str) -
limit(int) -
next(str | None) -
offset(int) -
previous(str | None) -
total(int) -
items(list[T])
href
pydantic-field
items
pydantic-field
limit
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
next
pydantic-field
offset
pydantic-field
previous
pydantic-field
total
pydantic-field
Restriction
pydantic-model
Bases: SpotifyModel
Content restriction. Reason is 'market', 'product', or 'explicit'.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
reason
pydantic-field
SimplifiedAlbum
pydantic-model
Bases: SpotifyModel
Basic album info embedded in other objects.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"SimplifiedArtist": {
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
}
},
"additionalProperties": true,
"description": "Basic album info embedded in other objects.",
"properties": {
"album_type": {
"title": "Album Type",
"type": "string"
},
"total_tracks": {
"title": "Total Tracks",
"type": "integer"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"release_date": {
"title": "Release Date",
"type": "string"
},
"release_date_precision": {
"title": "Release Date Precision",
"type": "string"
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"type": {
"const": "album",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
}
},
"required": [
"album_type",
"total_tracks",
"external_urls",
"href",
"id",
"images",
"name",
"release_date",
"release_date_precision",
"type",
"uri",
"artists"
],
"title": "SimplifiedAlbum",
"type": "object"
}
Fields:
-
album_type(str) -
total_tracks(int) -
available_markets(list[str] | None) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
images(list[Image]) -
name(str) -
release_date(str) -
release_date_precision(str) -
restrictions(Restriction | None) -
type_(Literal['album']) -
uri(str) -
artists(list[SimplifiedArtist])
album_type
pydantic-field
artists
pydantic-field
available_markets = None
pydantic-field
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
images
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
release_date
pydantic-field
release_date_precision
pydantic-field
restrictions = None
pydantic-field
total_tracks
pydantic-field
type_
pydantic-field
uri
pydantic-field
SimplifiedArtist
pydantic-model
Bases: SpotifyModel
Basic artist info embedded in other objects.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
}
},
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
}
Fields:
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
type_
pydantic-field
uri
pydantic-field
SimplifiedTrack
pydantic-model
Bases: SpotifyModel
Basic track info embedded in other objects.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"LinkedFrom": {
"additionalProperties": true,
"description": "Original track info when track relinking has replaced the requested track.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "LinkedFrom",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"SimplifiedArtist": {
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
}
},
"additionalProperties": true,
"description": "Basic track info embedded in other objects.",
"properties": {
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"disc_number": {
"title": "Disc Number",
"type": "integer"
},
"duration_ms": {
"title": "Duration Ms",
"type": "integer"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"is_playable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Playable"
},
"linked_from": {
"anyOf": [
{
"$ref": "#/$defs/LinkedFrom"
},
{
"type": "null"
}
],
"default": null
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"preview_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Preview Url"
},
"track_number": {
"title": "Track Number",
"type": "integer"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"is_local": {
"title": "Is Local",
"type": "boolean"
}
},
"required": [
"artists",
"disc_number",
"duration_ms",
"explicit",
"external_urls",
"href",
"id",
"name",
"preview_url",
"track_number",
"type",
"uri",
"is_local"
],
"title": "SimplifiedTrack",
"type": "object"
}
Config:
extra:allow
Fields:
-
artists(list[SimplifiedArtist]) -
available_markets(list[str] | None) -
disc_number(int) -
duration_ms(int) -
explicit(bool) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
is_playable(bool | None) -
linked_from(LinkedFrom | None) -
restrictions(Restriction | None) -
name(str) -
preview_url(str | None) -
track_number(int) -
type_(Literal['track']) -
uri(str) -
is_local(bool)
artists
pydantic-field
available_markets = None
pydantic-field
disc_number
pydantic-field
duration_ms
pydantic-field
explicit
pydantic-field
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
is_local
pydantic-field
is_playable = None
pydantic-field
linked_from = None
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
preview_url
pydantic-field
restrictions = None
pydantic-field
track_number
pydantic-field
type_
pydantic-field
uri
pydantic-field
SpotifyModel
pydantic-model
Bases: BaseModel
Base model for all Spotify API objects. Allows extra fields for forward compatibility.
Show JSON schema:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
Audiobook models
Audiobook and chapter models.
Audiobook
pydantic-model
Bases: SimplifiedAudiobook
Complete audiobook with chapter list.
Show JSON schema:
{
"$defs": {
"AudiobookAuthor": {
"additionalProperties": true,
"description": "Author of an audiobook.",
"properties": {
"name": {
"title": "Name",
"type": "string"
}
},
"required": [
"name"
],
"title": "AudiobookAuthor",
"type": "object"
},
"AudiobookNarrator": {
"additionalProperties": true,
"description": "Narrator of an audiobook.",
"properties": {
"name": {
"title": "Name",
"type": "string"
}
},
"required": [
"name"
],
"title": "AudiobookNarrator",
"type": "object"
},
"Copyright": {
"additionalProperties": true,
"description": "Copyright statement. Type is 'C' (copyright) or 'P' (performance).",
"properties": {
"text": {
"title": "Text",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
}
},
"required": [
"text",
"type"
],
"title": "Copyright",
"type": "object"
},
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
},
"Page_SimplifiedChapter_": {
"additionalProperties": true,
"properties": {
"href": {
"title": "Href",
"type": "string"
},
"limit": {
"title": "Limit",
"type": "integer"
},
"next": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Next"
},
"offset": {
"title": "Offset",
"type": "integer"
},
"previous": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Previous"
},
"total": {
"title": "Total",
"type": "integer"
},
"items": {
"items": {
"$ref": "#/$defs/SimplifiedChapter"
},
"title": "Items",
"type": "array"
}
},
"required": [
"href",
"limit",
"next",
"offset",
"previous",
"total",
"items"
],
"title": "Page[SimplifiedChapter]",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"ResumePoint": {
"additionalProperties": true,
"description": "Resume point for a chapter.",
"properties": {
"fully_played": {
"title": "Fully Played",
"type": "boolean"
},
"resume_position_ms": {
"title": "Resume Position Ms",
"type": "integer"
}
},
"required": [
"fully_played",
"resume_position_ms"
],
"title": "ResumePoint",
"type": "object"
},
"SimplifiedChapter": {
"additionalProperties": true,
"description": "Basic chapter info embedded in other objects.",
"properties": {
"audio_preview_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Audio Preview Url"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"chapter_number": {
"title": "Chapter Number",
"type": "integer"
},
"description": {
"title": "Description",
"type": "string"
},
"html_description": {
"title": "Html Description",
"type": "string"
},
"duration_ms": {
"title": "Duration Ms",
"type": "integer"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"is_playable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Playable"
},
"languages": {
"items": {
"type": "string"
},
"title": "Languages",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"release_date": {
"title": "Release Date",
"type": "string"
},
"release_date_precision": {
"title": "Release Date Precision",
"type": "string"
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"resume_point": {
"anyOf": [
{
"$ref": "#/$defs/ResumePoint"
},
{
"type": "null"
}
],
"default": null
},
"type": {
"const": "chapter",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"audio_preview_url",
"chapter_number",
"description",
"html_description",
"duration_ms",
"explicit",
"external_urls",
"href",
"id",
"images",
"languages",
"name",
"release_date",
"release_date_precision",
"type",
"uri"
],
"title": "SimplifiedChapter",
"type": "object"
}
},
"additionalProperties": true,
"description": "Complete audiobook with chapter list.",
"properties": {
"authors": {
"items": {
"$ref": "#/$defs/AudiobookAuthor"
},
"title": "Authors",
"type": "array"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"copyrights": {
"items": {
"$ref": "#/$defs/Copyright"
},
"title": "Copyrights",
"type": "array"
},
"description": {
"title": "Description",
"type": "string"
},
"html_description": {
"title": "Html Description",
"type": "string"
},
"edition": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Edition"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"languages": {
"items": {
"type": "string"
},
"title": "Languages",
"type": "array"
},
"media_type": {
"title": "Media Type",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"narrators": {
"items": {
"$ref": "#/$defs/AudiobookNarrator"
},
"title": "Narrators",
"type": "array"
},
"publisher": {
"title": "Publisher",
"type": "string"
},
"type": {
"const": "audiobook",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"total_chapters": {
"title": "Total Chapters",
"type": "integer"
},
"chapters": {
"$ref": "#/$defs/Page_SimplifiedChapter_"
}
},
"required": [
"authors",
"copyrights",
"description",
"html_description",
"explicit",
"external_urls",
"href",
"id",
"images",
"languages",
"media_type",
"name",
"narrators",
"publisher",
"type",
"uri",
"total_chapters",
"chapters"
],
"title": "Audiobook",
"type": "object"
}
Fields:
-
authors(list[AudiobookAuthor]) -
available_markets(list[str] | None) -
copyrights(list[Copyright]) -
description(str) -
html_description(str) -
edition(str | None) -
explicit(bool) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
images(list[Image]) -
languages(list[str]) -
media_type(str) -
name(str) -
narrators(list[AudiobookNarrator]) -
publisher(str) -
type_(Literal['audiobook']) -
uri(str) -
total_chapters(int) -
chapters(Page[SimplifiedChapter])
authors
pydantic-field
available_markets = None
pydantic-field
chapters
pydantic-field
copyrights
pydantic-field
description
pydantic-field
edition = None
pydantic-field
explicit
pydantic-field
external_urls
pydantic-field
href
pydantic-field
html_description
pydantic-field
id
pydantic-field
images
pydantic-field
languages
pydantic-field
media_type
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
narrators
pydantic-field
publisher
pydantic-field
total_chapters
pydantic-field
type_
pydantic-field
uri
pydantic-field
AudiobookAuthor
pydantic-model
Bases: SpotifyModel
Author of an audiobook.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
AudiobookNarrator
pydantic-model
Bases: SpotifyModel
Narrator of an audiobook.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
Copyright
pydantic-model
Bases: SpotifyModel
Copyright statement. Type is 'C' (copyright) or 'P' (performance).
Show JSON schema:
{
"additionalProperties": true,
"description": "Copyright statement. Type is 'C' (copyright) or 'P' (performance).",
"properties": {
"text": {
"title": "Text",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
}
},
"required": [
"text",
"type"
],
"title": "Copyright",
"type": "object"
}
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
text
pydantic-field
type_
pydantic-field
ExternalUrls
pydantic-model
Bases: SpotifyModel
URLs for opening a resource in the Spotify web player.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
spotify
pydantic-field
Image
pydantic-model
Bases: SpotifyModel
Cover art or profile image. Dimensions may be null for user-uploaded images.
Show JSON schema:
{
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
}
Fields:
height
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
url
pydantic-field
width
pydantic-field
Page
pydantic-model
Bases: SpotifyModel, Generic[T]
Paginated response containing items and navigation links.
Show JSON schema:
{
"additionalProperties": true,
"description": "Paginated response containing items and navigation links.",
"properties": {
"href": {
"title": "Href",
"type": "string"
},
"limit": {
"title": "Limit",
"type": "integer"
},
"next": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Next"
},
"offset": {
"title": "Offset",
"type": "integer"
},
"previous": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Previous"
},
"total": {
"title": "Total",
"type": "integer"
},
"items": {
"items": {},
"title": "Items",
"type": "array"
}
},
"required": [
"href",
"limit",
"next",
"offset",
"previous",
"total",
"items"
],
"title": "Page",
"type": "object"
}
Fields:
-
href(str) -
limit(int) -
next(str | None) -
offset(int) -
previous(str | None) -
total(int) -
items(list[T])
href
pydantic-field
items
pydantic-field
limit
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
next
pydantic-field
offset
pydantic-field
previous
pydantic-field
total
pydantic-field
Restriction
pydantic-model
Bases: SpotifyModel
Content restriction. Reason is 'market', 'product', or 'explicit'.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
reason
pydantic-field
ResumePoint
pydantic-model
Bases: SpotifyModel
Resume point for a chapter.
Show JSON schema:
{
"additionalProperties": true,
"description": "Resume point for a chapter.",
"properties": {
"fully_played": {
"title": "Fully Played",
"type": "boolean"
},
"resume_position_ms": {
"title": "Resume Position Ms",
"type": "integer"
}
},
"required": [
"fully_played",
"resume_position_ms"
],
"title": "ResumePoint",
"type": "object"
}
Fields:
fully_played
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
resume_position_ms
pydantic-field
SimplifiedAudiobook
pydantic-model
Bases: SpotifyModel
Basic audiobook info embedded in other objects.
Show JSON schema:
{
"$defs": {
"AudiobookAuthor": {
"additionalProperties": true,
"description": "Author of an audiobook.",
"properties": {
"name": {
"title": "Name",
"type": "string"
}
},
"required": [
"name"
],
"title": "AudiobookAuthor",
"type": "object"
},
"AudiobookNarrator": {
"additionalProperties": true,
"description": "Narrator of an audiobook.",
"properties": {
"name": {
"title": "Name",
"type": "string"
}
},
"required": [
"name"
],
"title": "AudiobookNarrator",
"type": "object"
},
"Copyright": {
"additionalProperties": true,
"description": "Copyright statement. Type is 'C' (copyright) or 'P' (performance).",
"properties": {
"text": {
"title": "Text",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
}
},
"required": [
"text",
"type"
],
"title": "Copyright",
"type": "object"
},
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
}
},
"additionalProperties": true,
"description": "Basic audiobook info embedded in other objects.",
"properties": {
"authors": {
"items": {
"$ref": "#/$defs/AudiobookAuthor"
},
"title": "Authors",
"type": "array"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"copyrights": {
"items": {
"$ref": "#/$defs/Copyright"
},
"title": "Copyrights",
"type": "array"
},
"description": {
"title": "Description",
"type": "string"
},
"html_description": {
"title": "Html Description",
"type": "string"
},
"edition": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Edition"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"languages": {
"items": {
"type": "string"
},
"title": "Languages",
"type": "array"
},
"media_type": {
"title": "Media Type",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"narrators": {
"items": {
"$ref": "#/$defs/AudiobookNarrator"
},
"title": "Narrators",
"type": "array"
},
"publisher": {
"title": "Publisher",
"type": "string"
},
"type": {
"const": "audiobook",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"total_chapters": {
"title": "Total Chapters",
"type": "integer"
}
},
"required": [
"authors",
"copyrights",
"description",
"html_description",
"explicit",
"external_urls",
"href",
"id",
"images",
"languages",
"media_type",
"name",
"narrators",
"publisher",
"type",
"uri",
"total_chapters"
],
"title": "SimplifiedAudiobook",
"type": "object"
}
Fields:
-
authors(list[AudiobookAuthor]) -
available_markets(list[str] | None) -
copyrights(list[Copyright]) -
description(str) -
html_description(str) -
edition(str | None) -
explicit(bool) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
images(list[Image]) -
languages(list[str]) -
media_type(str) -
name(str) -
narrators(list[AudiobookNarrator]) -
publisher(str) -
type_(Literal['audiobook']) -
uri(str) -
total_chapters(int)
authors
pydantic-field
available_markets = None
pydantic-field
copyrights
pydantic-field
description
pydantic-field
edition = None
pydantic-field
explicit
pydantic-field
external_urls
pydantic-field
href
pydantic-field
html_description
pydantic-field
id
pydantic-field
images
pydantic-field
languages
pydantic-field
media_type
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
narrators
pydantic-field
publisher
pydantic-field
total_chapters
pydantic-field
type_
pydantic-field
uri
pydantic-field
SimplifiedChapter
pydantic-model
Bases: SpotifyModel
Basic chapter info embedded in other objects.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"ResumePoint": {
"additionalProperties": true,
"description": "Resume point for a chapter.",
"properties": {
"fully_played": {
"title": "Fully Played",
"type": "boolean"
},
"resume_position_ms": {
"title": "Resume Position Ms",
"type": "integer"
}
},
"required": [
"fully_played",
"resume_position_ms"
],
"title": "ResumePoint",
"type": "object"
}
},
"additionalProperties": true,
"description": "Basic chapter info embedded in other objects.",
"properties": {
"audio_preview_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Audio Preview Url"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"chapter_number": {
"title": "Chapter Number",
"type": "integer"
},
"description": {
"title": "Description",
"type": "string"
},
"html_description": {
"title": "Html Description",
"type": "string"
},
"duration_ms": {
"title": "Duration Ms",
"type": "integer"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"is_playable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Playable"
},
"languages": {
"items": {
"type": "string"
},
"title": "Languages",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"release_date": {
"title": "Release Date",
"type": "string"
},
"release_date_precision": {
"title": "Release Date Precision",
"type": "string"
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"resume_point": {
"anyOf": [
{
"$ref": "#/$defs/ResumePoint"
},
{
"type": "null"
}
],
"default": null
},
"type": {
"const": "chapter",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"audio_preview_url",
"chapter_number",
"description",
"html_description",
"duration_ms",
"explicit",
"external_urls",
"href",
"id",
"images",
"languages",
"name",
"release_date",
"release_date_precision",
"type",
"uri"
],
"title": "SimplifiedChapter",
"type": "object"
}
Fields:
-
audio_preview_url(str | None) -
available_markets(list[str] | None) -
chapter_number(int) -
description(str) -
html_description(str) -
duration_ms(int) -
explicit(bool) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
images(list[Image]) -
is_playable(bool | None) -
languages(list[str]) -
name(str) -
release_date(str) -
release_date_precision(str) -
restrictions(Restriction | None) -
resume_point(ResumePoint | None) -
type_(Literal['chapter']) -
uri(str)
audio_preview_url
pydantic-field
available_markets = None
pydantic-field
chapter_number
pydantic-field
description
pydantic-field
duration_ms
pydantic-field
explicit
pydantic-field
external_urls
pydantic-field
href
pydantic-field
html_description
pydantic-field
id
pydantic-field
images
pydantic-field
is_playable = None
pydantic-field
languages
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
release_date
pydantic-field
release_date_precision
pydantic-field
restrictions = None
pydantic-field
resume_point = None
pydantic-field
type_
pydantic-field
uri
pydantic-field
SpotifyModel
pydantic-model
Bases: BaseModel
Base model for all Spotify API objects. Allows extra fields for forward compatibility.
Show JSON schema:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
Artist models
Artist models.
Artist
pydantic-model
Bases: SimplifiedArtist
Complete artist profile with followers, genres, and images.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Followers": {
"additionalProperties": true,
"description": "Follower information for an artist or playlist.",
"properties": {
"href": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Href"
},
"total": {
"title": "Total",
"type": "integer"
}
},
"required": [
"href",
"total"
],
"title": "Followers",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
}
},
"additionalProperties": true,
"description": "Complete artist profile with followers, genres, and images.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"followers": {
"$ref": "#/$defs/Followers"
},
"genres": {
"items": {
"type": "string"
},
"title": "Genres",
"type": "array"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"popularity": {
"title": "Popularity",
"type": "integer"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri",
"followers",
"genres",
"images",
"popularity"
],
"title": "Artist",
"type": "object"
}
Fields:
-
external_urls(ExternalUrls) -
href(str) -
id(str) -
name(str) -
type_(Literal['artist']) -
uri(str) -
followers(Followers) -
genres(list[str]) -
images(list[Image]) -
popularity(int)
external_urls
pydantic-field
followers
pydantic-field
genres
pydantic-field
href
pydantic-field
id
pydantic-field
images
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
popularity
pydantic-field
type_
pydantic-field
uri
pydantic-field
ExternalUrls
pydantic-model
Bases: SpotifyModel
URLs for opening a resource in the Spotify web player.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
spotify
pydantic-field
Followers
pydantic-model
Bases: SpotifyModel
Follower information for an artist or playlist.
Show JSON schema:
{
"additionalProperties": true,
"description": "Follower information for an artist or playlist.",
"properties": {
"href": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Href"
},
"total": {
"title": "Total",
"type": "integer"
}
},
"required": [
"href",
"total"
],
"title": "Followers",
"type": "object"
}
Fields:
href
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
total
pydantic-field
Image
pydantic-model
Bases: SpotifyModel
Cover art or profile image. Dimensions may be null for user-uploaded images.
Show JSON schema:
{
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
}
Fields:
height
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
url
pydantic-field
width
pydantic-field
SimplifiedArtist
pydantic-model
Bases: SpotifyModel
Basic artist info embedded in other objects.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
}
},
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
}
Fields:
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
type_
pydantic-field
uri
pydantic-field
SpotifyModel
pydantic-model
Bases: BaseModel
Base model for all Spotify API objects. Allows extra fields for forward compatibility.
Show JSON schema:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
Playlist models
Playlist models.
ExternalUrls
pydantic-model
Bases: SpotifyModel
URLs for opening a resource in the Spotify web player.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
spotify
pydantic-field
Image
pydantic-model
Bases: SpotifyModel
Cover art or profile image. Dimensions may be null for user-uploaded images.
Show JSON schema:
{
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
}
Fields:
height
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
url
pydantic-field
width
pydantic-field
Page
pydantic-model
Bases: SpotifyModel, Generic[T]
Paginated response containing items and navigation links.
Show JSON schema:
{
"additionalProperties": true,
"description": "Paginated response containing items and navigation links.",
"properties": {
"href": {
"title": "Href",
"type": "string"
},
"limit": {
"title": "Limit",
"type": "integer"
},
"next": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Next"
},
"offset": {
"title": "Offset",
"type": "integer"
},
"previous": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Previous"
},
"total": {
"title": "Total",
"type": "integer"
},
"items": {
"items": {},
"title": "Items",
"type": "array"
}
},
"required": [
"href",
"limit",
"next",
"offset",
"previous",
"total",
"items"
],
"title": "Page",
"type": "object"
}
Fields:
-
href(str) -
limit(int) -
next(str | None) -
offset(int) -
previous(str | None) -
total(int) -
items(list[T])
href
pydantic-field
items
pydantic-field
limit
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
next
pydantic-field
offset
pydantic-field
previous
pydantic-field
total
pydantic-field
Playlist
pydantic-model
Bases: SimplifiedPlaylist
Complete playlist with tracks info.
Show JSON schema:
{
"$defs": {
"ExternalIds": {
"additionalProperties": true,
"description": "External identifiers: ISRC for tracks, EAN or UPC for albums.",
"properties": {
"isrc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Isrc"
},
"ean": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ean"
},
"upc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Upc"
}
},
"title": "ExternalIds",
"type": "object"
},
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
},
"LinkedFrom": {
"additionalProperties": true,
"description": "Original track info when track relinking has replaced the requested track.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "LinkedFrom",
"type": "object"
},
"Page_PlaylistTrack_": {
"additionalProperties": true,
"properties": {
"href": {
"title": "Href",
"type": "string"
},
"limit": {
"title": "Limit",
"type": "integer"
},
"next": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Next"
},
"offset": {
"title": "Offset",
"type": "integer"
},
"previous": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Previous"
},
"total": {
"title": "Total",
"type": "integer"
},
"items": {
"items": {
"$ref": "#/$defs/PlaylistTrack"
},
"title": "Items",
"type": "array"
}
},
"required": [
"href",
"limit",
"next",
"offset",
"previous",
"total",
"items"
],
"title": "Page[PlaylistTrack]",
"type": "object"
},
"PlaylistTrack": {
"additionalProperties": true,
"description": "Track item in a playlist with metadata about when/who added it.",
"properties": {
"added_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Added At"
},
"added_by": {
"anyOf": [
{
"$ref": "#/$defs/PublicUser"
},
{
"type": "null"
}
],
"default": null
},
"is_local": {
"title": "Is Local",
"type": "boolean"
},
"track": {
"anyOf": [
{
"$ref": "#/$defs/Track"
},
{
"type": "null"
}
]
}
},
"required": [
"is_local",
"track"
],
"title": "PlaylistTrack",
"type": "object"
},
"PublicUser": {
"additionalProperties": true,
"description": "Public user profile for embedded user references.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "user",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"display_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Display Name"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "PublicUser",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"SimplifiedAlbum": {
"additionalProperties": true,
"description": "Basic album info embedded in other objects.",
"properties": {
"album_type": {
"title": "Album Type",
"type": "string"
},
"total_tracks": {
"title": "Total Tracks",
"type": "integer"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"release_date": {
"title": "Release Date",
"type": "string"
},
"release_date_precision": {
"title": "Release Date Precision",
"type": "string"
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"type": {
"const": "album",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
}
},
"required": [
"album_type",
"total_tracks",
"external_urls",
"href",
"id",
"images",
"name",
"release_date",
"release_date_precision",
"type",
"uri",
"artists"
],
"title": "SimplifiedAlbum",
"type": "object"
},
"SimplifiedArtist": {
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
},
"Track": {
"additionalProperties": true,
"description": "Complete track with album, popularity, and external IDs.",
"properties": {
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"disc_number": {
"title": "Disc Number",
"type": "integer"
},
"duration_ms": {
"title": "Duration Ms",
"type": "integer"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"is_playable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Playable"
},
"linked_from": {
"anyOf": [
{
"$ref": "#/$defs/LinkedFrom"
},
{
"type": "null"
}
],
"default": null
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"preview_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Preview Url"
},
"track_number": {
"title": "Track Number",
"type": "integer"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"is_local": {
"title": "Is Local",
"type": "boolean"
},
"album": {
"$ref": "#/$defs/SimplifiedAlbum"
},
"external_ids": {
"$ref": "#/$defs/ExternalIds"
},
"popularity": {
"title": "Popularity",
"type": "integer"
}
},
"required": [
"artists",
"disc_number",
"duration_ms",
"explicit",
"external_urls",
"href",
"id",
"name",
"preview_url",
"track_number",
"type",
"uri",
"is_local",
"album",
"external_ids",
"popularity"
],
"title": "Track",
"type": "object"
}
},
"additionalProperties": true,
"description": "Complete playlist with tracks info.",
"properties": {
"collaborative": {
"title": "Collaborative",
"type": "boolean"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"owner": {
"$ref": "#/$defs/PublicUser"
},
"public": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Public"
},
"snapshot_id": {
"title": "Snapshot Id",
"type": "string"
},
"tracks": {
"$ref": "#/$defs/Page_PlaylistTrack_"
},
"type": {
"const": "playlist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"collaborative",
"description",
"external_urls",
"href",
"id",
"images",
"name",
"owner",
"public",
"snapshot_id",
"tracks",
"type",
"uri"
],
"title": "Playlist",
"type": "object"
}
Fields:
-
collaborative(bool) -
description(str | None) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
images(list[Image]) -
name(str) -
owner(PublicUser) -
public(bool | None) -
snapshot_id(str) -
type_(Literal['playlist']) -
uri(str) -
tracks(Page[PlaylistTrack])
collaborative
pydantic-field
description
pydantic-field
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
images
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
owner
pydantic-field
public
pydantic-field
snapshot_id
pydantic-field
tracks
pydantic-field
type_
pydantic-field
uri
pydantic-field
PlaylistTrack
pydantic-model
Bases: SpotifyModel
Track item in a playlist with metadata about when/who added it.
Show JSON schema:
{
"$defs": {
"ExternalIds": {
"additionalProperties": true,
"description": "External identifiers: ISRC for tracks, EAN or UPC for albums.",
"properties": {
"isrc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Isrc"
},
"ean": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ean"
},
"upc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Upc"
}
},
"title": "ExternalIds",
"type": "object"
},
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
},
"LinkedFrom": {
"additionalProperties": true,
"description": "Original track info when track relinking has replaced the requested track.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "LinkedFrom",
"type": "object"
},
"PublicUser": {
"additionalProperties": true,
"description": "Public user profile for embedded user references.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "user",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"display_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Display Name"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "PublicUser",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"SimplifiedAlbum": {
"additionalProperties": true,
"description": "Basic album info embedded in other objects.",
"properties": {
"album_type": {
"title": "Album Type",
"type": "string"
},
"total_tracks": {
"title": "Total Tracks",
"type": "integer"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"release_date": {
"title": "Release Date",
"type": "string"
},
"release_date_precision": {
"title": "Release Date Precision",
"type": "string"
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"type": {
"const": "album",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
}
},
"required": [
"album_type",
"total_tracks",
"external_urls",
"href",
"id",
"images",
"name",
"release_date",
"release_date_precision",
"type",
"uri",
"artists"
],
"title": "SimplifiedAlbum",
"type": "object"
},
"SimplifiedArtist": {
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
},
"Track": {
"additionalProperties": true,
"description": "Complete track with album, popularity, and external IDs.",
"properties": {
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"disc_number": {
"title": "Disc Number",
"type": "integer"
},
"duration_ms": {
"title": "Duration Ms",
"type": "integer"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"is_playable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Playable"
},
"linked_from": {
"anyOf": [
{
"$ref": "#/$defs/LinkedFrom"
},
{
"type": "null"
}
],
"default": null
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"preview_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Preview Url"
},
"track_number": {
"title": "Track Number",
"type": "integer"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"is_local": {
"title": "Is Local",
"type": "boolean"
},
"album": {
"$ref": "#/$defs/SimplifiedAlbum"
},
"external_ids": {
"$ref": "#/$defs/ExternalIds"
},
"popularity": {
"title": "Popularity",
"type": "integer"
}
},
"required": [
"artists",
"disc_number",
"duration_ms",
"explicit",
"external_urls",
"href",
"id",
"name",
"preview_url",
"track_number",
"type",
"uri",
"is_local",
"album",
"external_ids",
"popularity"
],
"title": "Track",
"type": "object"
}
},
"additionalProperties": true,
"description": "Track item in a playlist with metadata about when/who added it.",
"properties": {
"added_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Added At"
},
"added_by": {
"anyOf": [
{
"$ref": "#/$defs/PublicUser"
},
{
"type": "null"
}
],
"default": null
},
"is_local": {
"title": "Is Local",
"type": "boolean"
},
"track": {
"anyOf": [
{
"$ref": "#/$defs/Track"
},
{
"type": "null"
}
]
}
},
"required": [
"is_local",
"track"
],
"title": "PlaylistTrack",
"type": "object"
}
Fields:
added_at = None
pydantic-field
added_by = None
pydantic-field
is_local
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
track
pydantic-field
PlaylistTracksRef
pydantic-model
Bases: SpotifyModel
Reference to playlist tracks with total count (used in SimplifiedPlaylist).
Show JSON schema:
{
"additionalProperties": true,
"description": "Reference to playlist tracks with total count (used in SimplifiedPlaylist).",
"properties": {
"href": {
"title": "Href",
"type": "string"
},
"total": {
"title": "Total",
"type": "integer"
}
},
"required": [
"href",
"total"
],
"title": "PlaylistTracksRef",
"type": "object"
}
Fields:
href
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
total
pydantic-field
PublicUser
pydantic-model
Bases: SpotifyModel
Public user profile for embedded user references.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
}
},
"additionalProperties": true,
"description": "Public user profile for embedded user references.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "user",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"display_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Display Name"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "PublicUser",
"type": "object"
}
Fields:
-
external_urls(ExternalUrls) -
href(str) -
id(str) -
type_(Literal['user']) -
uri(str) -
display_name(str | None)
display_name = None
pydantic-field
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
type_
pydantic-field
uri
pydantic-field
SimplifiedPlaylist
pydantic-model
Bases: SpotifyModel
Basic playlist info embedded in other objects.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
},
"PlaylistTracksRef": {
"additionalProperties": true,
"description": "Reference to playlist tracks with total count (used in SimplifiedPlaylist).",
"properties": {
"href": {
"title": "Href",
"type": "string"
},
"total": {
"title": "Total",
"type": "integer"
}
},
"required": [
"href",
"total"
],
"title": "PlaylistTracksRef",
"type": "object"
},
"PublicUser": {
"additionalProperties": true,
"description": "Public user profile for embedded user references.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "user",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"display_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Display Name"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "PublicUser",
"type": "object"
}
},
"additionalProperties": true,
"description": "Basic playlist info embedded in other objects.",
"properties": {
"collaborative": {
"title": "Collaborative",
"type": "boolean"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"owner": {
"$ref": "#/$defs/PublicUser"
},
"public": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Public"
},
"snapshot_id": {
"title": "Snapshot Id",
"type": "string"
},
"tracks": {
"$ref": "#/$defs/PlaylistTracksRef"
},
"type": {
"const": "playlist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"collaborative",
"description",
"external_urls",
"href",
"id",
"images",
"name",
"owner",
"public",
"snapshot_id",
"tracks",
"type",
"uri"
],
"title": "SimplifiedPlaylist",
"type": "object"
}
Fields:
-
collaborative(bool) -
description(str | None) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
images(list[Image]) -
name(str) -
owner(PublicUser) -
public(bool | None) -
snapshot_id(str) -
tracks(PlaylistTracksRef) -
type_(Literal['playlist']) -
uri(str)
collaborative
pydantic-field
description
pydantic-field
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
images
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
owner
pydantic-field
public
pydantic-field
snapshot_id
pydantic-field
tracks
pydantic-field
type_
pydantic-field
uri
pydantic-field
SpotifyModel
pydantic-model
Bases: BaseModel
Base model for all Spotify API objects. Allows extra fields for forward compatibility.
Show JSON schema:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
Track
pydantic-model
Bases: SimplifiedTrack
Complete track with album, popularity, and external IDs.
Show JSON schema:
{
"$defs": {
"ExternalIds": {
"additionalProperties": true,
"description": "External identifiers: ISRC for tracks, EAN or UPC for albums.",
"properties": {
"isrc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Isrc"
},
"ean": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ean"
},
"upc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Upc"
}
},
"title": "ExternalIds",
"type": "object"
},
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
},
"LinkedFrom": {
"additionalProperties": true,
"description": "Original track info when track relinking has replaced the requested track.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "LinkedFrom",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"SimplifiedAlbum": {
"additionalProperties": true,
"description": "Basic album info embedded in other objects.",
"properties": {
"album_type": {
"title": "Album Type",
"type": "string"
},
"total_tracks": {
"title": "Total Tracks",
"type": "integer"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"release_date": {
"title": "Release Date",
"type": "string"
},
"release_date_precision": {
"title": "Release Date Precision",
"type": "string"
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"type": {
"const": "album",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
}
},
"required": [
"album_type",
"total_tracks",
"external_urls",
"href",
"id",
"images",
"name",
"release_date",
"release_date_precision",
"type",
"uri",
"artists"
],
"title": "SimplifiedAlbum",
"type": "object"
},
"SimplifiedArtist": {
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
}
},
"additionalProperties": true,
"description": "Complete track with album, popularity, and external IDs.",
"properties": {
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"disc_number": {
"title": "Disc Number",
"type": "integer"
},
"duration_ms": {
"title": "Duration Ms",
"type": "integer"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"is_playable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Playable"
},
"linked_from": {
"anyOf": [
{
"$ref": "#/$defs/LinkedFrom"
},
{
"type": "null"
}
],
"default": null
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"preview_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Preview Url"
},
"track_number": {
"title": "Track Number",
"type": "integer"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"is_local": {
"title": "Is Local",
"type": "boolean"
},
"album": {
"$ref": "#/$defs/SimplifiedAlbum"
},
"external_ids": {
"$ref": "#/$defs/ExternalIds"
},
"popularity": {
"title": "Popularity",
"type": "integer"
}
},
"required": [
"artists",
"disc_number",
"duration_ms",
"explicit",
"external_urls",
"href",
"id",
"name",
"preview_url",
"track_number",
"type",
"uri",
"is_local",
"album",
"external_ids",
"popularity"
],
"title": "Track",
"type": "object"
}
Fields:
-
artists(list[SimplifiedArtist]) -
available_markets(list[str] | None) -
disc_number(int) -
duration_ms(int) -
explicit(bool) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
is_playable(bool | None) -
linked_from(LinkedFrom | None) -
restrictions(Restriction | None) -
name(str) -
preview_url(str | None) -
track_number(int) -
type_(Literal['track']) -
uri(str) -
is_local(bool) -
album(SimplifiedAlbum) -
external_ids(ExternalIds) -
popularity(int)
album
pydantic-field
artists
pydantic-field
available_markets = None
pydantic-field
disc_number
pydantic-field
duration_ms
pydantic-field
explicit
pydantic-field
external_ids
pydantic-field
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
is_local
pydantic-field
is_playable = None
pydantic-field
linked_from = None
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
popularity
pydantic-field
preview_url
pydantic-field
restrictions = None
pydantic-field
track_number
pydantic-field
type_
pydantic-field
uri
pydantic-field
Track models
Track models.
ExternalIds
pydantic-model
Bases: SpotifyModel
External identifiers: ISRC for tracks, EAN or UPC for albums.
Show JSON schema:
{
"additionalProperties": true,
"description": "External identifiers: ISRC for tracks, EAN or UPC for albums.",
"properties": {
"isrc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Isrc"
},
"ean": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ean"
},
"upc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Upc"
}
},
"title": "ExternalIds",
"type": "object"
}
Fields:
ean = None
pydantic-field
isrc = None
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
upc = None
pydantic-field
ExternalUrls
pydantic-model
Bases: SpotifyModel
URLs for opening a resource in the Spotify web player.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
spotify
pydantic-field
LinkedFrom
pydantic-model
Bases: SpotifyModel
Original track info when track relinking has replaced the requested track.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
}
},
"additionalProperties": true,
"description": "Original track info when track relinking has replaced the requested track.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "LinkedFrom",
"type": "object"
}
Fields:
-
external_urls(ExternalUrls) -
href(str) -
id(str) -
type_(Literal['track']) -
uri(str)
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
type_
pydantic-field
uri
pydantic-field
Restriction
pydantic-model
Bases: SpotifyModel
Content restriction. Reason is 'market', 'product', or 'explicit'.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
reason
pydantic-field
SimplifiedAlbum
pydantic-model
Bases: SpotifyModel
Basic album info embedded in other objects.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"SimplifiedArtist": {
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
}
},
"additionalProperties": true,
"description": "Basic album info embedded in other objects.",
"properties": {
"album_type": {
"title": "Album Type",
"type": "string"
},
"total_tracks": {
"title": "Total Tracks",
"type": "integer"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"release_date": {
"title": "Release Date",
"type": "string"
},
"release_date_precision": {
"title": "Release Date Precision",
"type": "string"
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"type": {
"const": "album",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
}
},
"required": [
"album_type",
"total_tracks",
"external_urls",
"href",
"id",
"images",
"name",
"release_date",
"release_date_precision",
"type",
"uri",
"artists"
],
"title": "SimplifiedAlbum",
"type": "object"
}
Fields:
-
album_type(str) -
total_tracks(int) -
available_markets(list[str] | None) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
images(list[Image]) -
name(str) -
release_date(str) -
release_date_precision(str) -
restrictions(Restriction | None) -
type_(Literal['album']) -
uri(str) -
artists(list[SimplifiedArtist])
album_type
pydantic-field
artists
pydantic-field
available_markets = None
pydantic-field
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
images
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
release_date
pydantic-field
release_date_precision
pydantic-field
restrictions = None
pydantic-field
total_tracks
pydantic-field
type_
pydantic-field
uri
pydantic-field
SimplifiedArtist
pydantic-model
Bases: SpotifyModel
Basic artist info embedded in other objects.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
}
},
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
}
Fields:
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
type_
pydantic-field
uri
pydantic-field
SimplifiedTrack
pydantic-model
Bases: SpotifyModel
Basic track info embedded in other objects.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"LinkedFrom": {
"additionalProperties": true,
"description": "Original track info when track relinking has replaced the requested track.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "LinkedFrom",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"SimplifiedArtist": {
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
}
},
"additionalProperties": true,
"description": "Basic track info embedded in other objects.",
"properties": {
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"disc_number": {
"title": "Disc Number",
"type": "integer"
},
"duration_ms": {
"title": "Duration Ms",
"type": "integer"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"is_playable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Playable"
},
"linked_from": {
"anyOf": [
{
"$ref": "#/$defs/LinkedFrom"
},
{
"type": "null"
}
],
"default": null
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"preview_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Preview Url"
},
"track_number": {
"title": "Track Number",
"type": "integer"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"is_local": {
"title": "Is Local",
"type": "boolean"
}
},
"required": [
"artists",
"disc_number",
"duration_ms",
"explicit",
"external_urls",
"href",
"id",
"name",
"preview_url",
"track_number",
"type",
"uri",
"is_local"
],
"title": "SimplifiedTrack",
"type": "object"
}
Config:
extra:allow
Fields:
-
artists(list[SimplifiedArtist]) -
available_markets(list[str] | None) -
disc_number(int) -
duration_ms(int) -
explicit(bool) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
is_playable(bool | None) -
linked_from(LinkedFrom | None) -
restrictions(Restriction | None) -
name(str) -
preview_url(str | None) -
track_number(int) -
type_(Literal['track']) -
uri(str) -
is_local(bool)
artists
pydantic-field
available_markets = None
pydantic-field
disc_number
pydantic-field
duration_ms
pydantic-field
explicit
pydantic-field
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
is_local
pydantic-field
is_playable = None
pydantic-field
linked_from = None
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
preview_url
pydantic-field
restrictions = None
pydantic-field
track_number
pydantic-field
type_
pydantic-field
uri
pydantic-field
SpotifyModel
pydantic-model
Bases: BaseModel
Base model for all Spotify API objects. Allows extra fields for forward compatibility.
Show JSON schema:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
Track
pydantic-model
Bases: SimplifiedTrack
Complete track with album, popularity, and external IDs.
Show JSON schema:
{
"$defs": {
"ExternalIds": {
"additionalProperties": true,
"description": "External identifiers: ISRC for tracks, EAN or UPC for albums.",
"properties": {
"isrc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Isrc"
},
"ean": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ean"
},
"upc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Upc"
}
},
"title": "ExternalIds",
"type": "object"
},
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
},
"Image": {
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
},
"LinkedFrom": {
"additionalProperties": true,
"description": "Original track info when track relinking has replaced the requested track.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "LinkedFrom",
"type": "object"
},
"Restriction": {
"additionalProperties": true,
"description": "Content restriction. Reason is 'market', 'product', or 'explicit'.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
}
},
"required": [
"reason"
],
"title": "Restriction",
"type": "object"
},
"SimplifiedAlbum": {
"additionalProperties": true,
"description": "Basic album info embedded in other objects.",
"properties": {
"album_type": {
"title": "Album Type",
"type": "string"
},
"total_tracks": {
"title": "Total Tracks",
"type": "integer"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"images": {
"items": {
"$ref": "#/$defs/Image"
},
"title": "Images",
"type": "array"
},
"name": {
"title": "Name",
"type": "string"
},
"release_date": {
"title": "Release Date",
"type": "string"
},
"release_date_precision": {
"title": "Release Date Precision",
"type": "string"
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"type": {
"const": "album",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
}
},
"required": [
"album_type",
"total_tracks",
"external_urls",
"href",
"id",
"images",
"name",
"release_date",
"release_date_precision",
"type",
"uri",
"artists"
],
"title": "SimplifiedAlbum",
"type": "object"
},
"SimplifiedArtist": {
"additionalProperties": true,
"description": "Basic artist info embedded in other objects.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"const": "artist",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"name",
"type",
"uri"
],
"title": "SimplifiedArtist",
"type": "object"
}
},
"additionalProperties": true,
"description": "Complete track with album, popularity, and external IDs.",
"properties": {
"artists": {
"items": {
"$ref": "#/$defs/SimplifiedArtist"
},
"title": "Artists",
"type": "array"
},
"available_markets": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Available Markets"
},
"disc_number": {
"title": "Disc Number",
"type": "integer"
},
"duration_ms": {
"title": "Duration Ms",
"type": "integer"
},
"explicit": {
"title": "Explicit",
"type": "boolean"
},
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"is_playable": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Is Playable"
},
"linked_from": {
"anyOf": [
{
"$ref": "#/$defs/LinkedFrom"
},
{
"type": "null"
}
],
"default": null
},
"restrictions": {
"anyOf": [
{
"$ref": "#/$defs/Restriction"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"preview_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Preview Url"
},
"track_number": {
"title": "Track Number",
"type": "integer"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
},
"is_local": {
"title": "Is Local",
"type": "boolean"
},
"album": {
"$ref": "#/$defs/SimplifiedAlbum"
},
"external_ids": {
"$ref": "#/$defs/ExternalIds"
},
"popularity": {
"title": "Popularity",
"type": "integer"
}
},
"required": [
"artists",
"disc_number",
"duration_ms",
"explicit",
"external_urls",
"href",
"id",
"name",
"preview_url",
"track_number",
"type",
"uri",
"is_local",
"album",
"external_ids",
"popularity"
],
"title": "Track",
"type": "object"
}
Fields:
-
artists(list[SimplifiedArtist]) -
available_markets(list[str] | None) -
disc_number(int) -
duration_ms(int) -
explicit(bool) -
external_urls(ExternalUrls) -
href(str) -
id(str) -
is_playable(bool | None) -
linked_from(LinkedFrom | None) -
restrictions(Restriction | None) -
name(str) -
preview_url(str | None) -
track_number(int) -
type_(Literal['track']) -
uri(str) -
is_local(bool) -
album(SimplifiedAlbum) -
external_ids(ExternalIds) -
popularity(int)
album
pydantic-field
artists
pydantic-field
available_markets = None
pydantic-field
disc_number
pydantic-field
duration_ms
pydantic-field
explicit
pydantic-field
external_ids
pydantic-field
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
is_local
pydantic-field
is_playable = None
pydantic-field
linked_from = None
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
name
pydantic-field
popularity
pydantic-field
preview_url
pydantic-field
restrictions = None
pydantic-field
track_number
pydantic-field
type_
pydantic-field
uri
pydantic-field
Common models
Common models shared across resources.
T = TypeVar('T')
module-attribute
Copyright
pydantic-model
Bases: SpotifyModel
Copyright statement. Type is 'C' (copyright) or 'P' (performance).
Show JSON schema:
{
"additionalProperties": true,
"description": "Copyright statement. Type is 'C' (copyright) or 'P' (performance).",
"properties": {
"text": {
"title": "Text",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
}
},
"required": [
"text",
"type"
],
"title": "Copyright",
"type": "object"
}
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
text
pydantic-field
type_
pydantic-field
ExternalIds
pydantic-model
Bases: SpotifyModel
External identifiers: ISRC for tracks, EAN or UPC for albums.
Show JSON schema:
{
"additionalProperties": true,
"description": "External identifiers: ISRC for tracks, EAN or UPC for albums.",
"properties": {
"isrc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Isrc"
},
"ean": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ean"
},
"upc": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Upc"
}
},
"title": "ExternalIds",
"type": "object"
}
Fields:
ean = None
pydantic-field
isrc = None
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
upc = None
pydantic-field
ExternalUrls
pydantic-model
Bases: SpotifyModel
URLs for opening a resource in the Spotify web player.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
spotify
pydantic-field
Followers
pydantic-model
Bases: SpotifyModel
Follower information for an artist or playlist.
Show JSON schema:
{
"additionalProperties": true,
"description": "Follower information for an artist or playlist.",
"properties": {
"href": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Href"
},
"total": {
"title": "Total",
"type": "integer"
}
},
"required": [
"href",
"total"
],
"title": "Followers",
"type": "object"
}
Fields:
href
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
total
pydantic-field
Image
pydantic-model
Bases: SpotifyModel
Cover art or profile image. Dimensions may be null for user-uploaded images.
Show JSON schema:
{
"additionalProperties": true,
"description": "Cover art or profile image. Dimensions may be null for user-uploaded images.",
"properties": {
"url": {
"title": "Url",
"type": "string"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
}
},
"required": [
"url",
"height",
"width"
],
"title": "Image",
"type": "object"
}
Fields:
height
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
url
pydantic-field
width
pydantic-field
LinkedFrom
pydantic-model
Bases: SpotifyModel
Original track info when track relinking has replaced the requested track.
Show JSON schema:
{
"$defs": {
"ExternalUrls": {
"additionalProperties": true,
"description": "URLs for opening a resource in the Spotify web player.",
"properties": {
"spotify": {
"title": "Spotify",
"type": "string"
}
},
"required": [
"spotify"
],
"title": "ExternalUrls",
"type": "object"
}
},
"additionalProperties": true,
"description": "Original track info when track relinking has replaced the requested track.",
"properties": {
"external_urls": {
"$ref": "#/$defs/ExternalUrls"
},
"href": {
"title": "Href",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"type": {
"const": "track",
"title": "Type",
"type": "string"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"external_urls",
"href",
"id",
"type",
"uri"
],
"title": "LinkedFrom",
"type": "object"
}
Fields:
-
external_urls(ExternalUrls) -
href(str) -
id(str) -
type_(Literal['track']) -
uri(str)
external_urls
pydantic-field
href
pydantic-field
id
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
type_
pydantic-field
uri
pydantic-field
Page
pydantic-model
Bases: SpotifyModel, Generic[T]
Paginated response containing items and navigation links.
Show JSON schema:
{
"additionalProperties": true,
"description": "Paginated response containing items and navigation links.",
"properties": {
"href": {
"title": "Href",
"type": "string"
},
"limit": {
"title": "Limit",
"type": "integer"
},
"next": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Next"
},
"offset": {
"title": "Offset",
"type": "integer"
},
"previous": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Previous"
},
"total": {
"title": "Total",
"type": "integer"
},
"items": {
"items": {},
"title": "Items",
"type": "array"
}
},
"required": [
"href",
"limit",
"next",
"offset",
"previous",
"total",
"items"
],
"title": "Page",
"type": "object"
}
Fields:
-
href(str) -
limit(int) -
next(str | None) -
offset(int) -
previous(str | None) -
total(int) -
items(list[T])
href
pydantic-field
items
pydantic-field
limit
pydantic-field
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
next
pydantic-field
offset
pydantic-field
previous
pydantic-field
total
pydantic-field
Restriction
pydantic-model
Bases: SpotifyModel
Content restriction. Reason is 'market', 'product', or 'explicit'.
Show JSON schema:
Fields:
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
reason
pydantic-field
SpotifyModel
pydantic-model
Bases: BaseModel
Base model for all Spotify API objects. Allows extra fields for forward compatibility.