Skip to content

get_playlist fails on the new "item" wrapper (Feb 2026 API change) #774

@maxmaxme

Description

@maxmaxme

Since Spotify's Feb 2026 Web API migration, playlist responses wrap each entry in item instead of track (tracks.trackitems.item), and track is now marked deprecated.

PlaylistTrack still requires track, so get_playlist and get_playlist_items fail on the new payload:

MissingField: Field "track" of type Item is missing in PlaylistTrack instance
→ InvalidFieldValue: Field "items" of type list[PlaylistTrack] in PlaylistTracks ...
→ InvalidFieldValue: Field "items" of type PlaylistTracks in Playlist ...

Reproduced on spotifyaio==2.0.2: feeding a real playlist-items response (entries with item and no track) to Playlist.from_json / PlaylistTracks raises the above; adding track = item makes it parse.

This is currently breaking the Home Assistant Spotify integration (home-assistant/core#165877).

track is still sent during the deprecation window, so both shapes need to work. I think the cleanest fix is normalizing itemtrack in PlaylistTrack.__pre_deserialize__, mirroring what Playlist.__pre_deserialize__ already does for tracksitems. Happy to open a PR.

Related: #767 handles a missing items list (metadata-only playlists) but not the track/item rename.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions