Last updated: 5 Aug 25 11:42:06 (UTC)
P# Spotify consistent genre API
https://developer.spotify.com/console/get-users-currently-playing-track/ https://developer.spotify.com/documentation/web-api/reference/player/get-the-users-currently-playing-track
additional_types: track when playing podcast:
{
"timestamp": 1607443546029,
"context": null,
"item": null,
"currently_playing_type": "episode", # important, always check first
"is_playing": true
}{
"timestamp": 1607443546029,
"context": null,
"item": null,
"currently_playing_type": "episode", # important, always check first
"is_playing": true
}normally:
{
"timestamp": 1607443584893, # see duration of track
"context": { # where are we playing from, could be used to pre-fetch data and work for a while when user is offline without changing the track, feature of v2
# https://developer.spotify.com/console/get-several-albums is nice
"href": "https://api.spotify.com/v1/playlists/5aqePBT6ZFUYiQdqxSFmaC",
"type": "playlist",
"uri": "spotify:user:piccstok2x5d54jkt3mf1sdwy:playlist:5aqePBT6ZFUYiQdqxSFmaC"
},
"progress_ms": 32138, # see duration of track
"item": {
"album": {
"album_type": "album",
"artists": [
{
"href": "https://api.spotify.com/v1/artists/4UuRl4uM2Nf7sbNFBKpZ6b",
"id": "4UuRl4uM2Nf7sbNFBKpZ6b", # use this for secondary lookup (what if multiple artists? show artist name + genres for each? too lenghty!)
"name": "Night Gestalt",
"type": "artist",
"uri": "spotify:artist:4UuRl4uM2Nf7sbNFBKpZ6b"
}
],
"href": "https://api.spotify.com/v1/albums/5or0DF9PexTYJs34O4KnnD", # https://developer.spotify.com/console/get-album
"id": "5or0DF9PexTYJs34O4KnnD", # album id for primary lookup
"name": "New Glasir",
"type": "album",
"uri": "spotify:album:5or0DF9PexTYJs34O4KnnD"
},
"duration_ms": 308504, # compare this with progress to timeout (when next request?) the shown genres, if no information arrives
"id": "04IF73dnOwn1ABMVfTkhPf",
"is_local": false, # if track is local, we don't know about it
"type": "track",
"uri": "spotify:track:04IF73dnOwn1ABMVfTkhPf"
},
"currently_playing_type": "track", # check this that we are on the right track
"is_playing": true # use this to hide when not playing for 5-10s
}{
"timestamp": 1607443584893, # see duration of track
"context": { # where are we playing from, could be used to pre-fetch data and work for a while when user is offline without changing the track, feature of v2
# https://developer.spotify.com/console/get-several-albums is nice
"href": "https://api.spotify.com/v1/playlists/5aqePBT6ZFUYiQdqxSFmaC",
"type": "playlist",
"uri": "spotify:user:piccstok2x5d54jkt3mf1sdwy:playlist:5aqePBT6ZFUYiQdqxSFmaC"
},
"progress_ms": 32138, # see duration of track
"item": {
"album": {
"album_type": "album",
"artists": [
{
"href": "https://api.spotify.com/v1/artists/4UuRl4uM2Nf7sbNFBKpZ6b",
"id": "4UuRl4uM2Nf7sbNFBKpZ6b", # use this for secondary lookup (what if multiple artists? show artist name + genres for each? too lenghty!)
"name": "Night Gestalt",
"type": "artist",
"uri": "spotify:artist:4UuRl4uM2Nf7sbNFBKpZ6b"
}
],
"href": "https://api.spotify.com/v1/albums/5or0DF9PexTYJs34O4KnnD", # https://developer.spotify.com/console/get-album
"id": "5or0DF9PexTYJs34O4KnnD", # album id for primary lookup
"name": "New Glasir",
"type": "album",
"uri": "spotify:album:5or0DF9PexTYJs34O4KnnD"
},
"duration_ms": 308504, # compare this with progress to timeout (when next request?) the shown genres, if no information arrives
"id": "04IF73dnOwn1ABMVfTkhPf",
"is_local": false, # if track is local, we don't know about it
"type": "track",
"uri": "spotify:track:04IF73dnOwn1ABMVfTkhPf"
},
"currently_playing_type": "track", # check this that we are on the right track
"is_playing": true # use this to hide when not playing for 5-10s
}{
"genres": [], # let's hope there's something here
}{
"genres": [], # let's hope there's something here
}mass-query (ahead):
tb implemented in v2
tb implemented in v2if not, check artists (might need to recursively for each listed artist):
{
"genres": [
"dance pop",
"latin",
"miami hip hop",
"pop",
"pop dance",
"pop rap"
],
"name": "Pitbull",
k}{
"genres": [
"dance pop",
"latin",
"miami hip hop",
"pop",
"pop dance",
"pop rap"
],
"name": "Pitbull",
k}mass-query (ahead):
tb implemented in v2
tb implemented in v2