[GH-ISSUE #1229] playlist_items appears to target wrong endpoint #715

Open
opened 2026-02-28 00:01:07 +03:00 by kerem · 3 comments
Owner

Originally created by @gshorten on GitHub (Feb 23, 2026).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1229

I am trying to use playlist_items but am getting 403 error:
HTTP Error for GET to https://api.spotify.com/v1/playlists/5VubtQBdfMONZ4lL7ZEb3Y/tracks with Params: {'limit': 100, 'offset': 0, 'fields': None, 'market': None, 'additional_types': 'track'} returned 403 due to Forbidden

I've got proper scopes because all the other spotipy functions that use the same scope (and others) such as getting a list of playlists, getting top tracks, starting and stopping play, etc. work as expected. Just playlist_items fails.

snippet:
wbcurrent = '5VubtQBdfMONZ4lL7ZEb3Y'
wbtracks = sp.playlist_items(playlist_id=wbcurrent,additional_types=("track",))

(I've also tried "tracks")

I'm not really competent to comment on this but a quick look seems like the spotipy code appears to use a depreciated endpoint?
see f"playlists/{plid}/tracks" below. Should this be "items" instead of "tracks"?

def playlist_items(
self,
playlist_id,
fields=None,
limit=100,
offset=0,
market=None,
additional_types=("track", "episode")
):
""" Get full details of the tracks and episodes of a playlist.

        Parameters:
            - playlist_id - the playlist ID, URI or URL
            - fields - which fields to return
            - limit - the maximum number of tracks to return
            - offset - the index of the first track to return
            - market - an ISO 3166-1 alpha-2 country code.
            - additional_types - list of item types to return.
                                 valid types are: track and episode
    """
    plid = self._get_id("playlist", playlist_id)
    return self._get(
        f"playlists/{plid}/tracks",
        limit=limit,
        offset=offset,
        fields=fields,
        market=market,
        additional_types=",".join(additional_types)
    )

Thanks, if it is something else that I am doing wrong please point me in the right direction.

Originally created by @gshorten on GitHub (Feb 23, 2026). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1229 I am trying to use playlist_items but am getting 403 error: HTTP Error for GET to https://api.spotify.com/v1/playlists/5VubtQBdfMONZ4lL7ZEb3Y/tracks with Params: {'limit': 100, 'offset': 0, 'fields': None, 'market': None, 'additional_types': 'track'} returned 403 due to Forbidden I've got proper scopes because all the other spotipy functions that use the same scope (and others) such as getting a list of playlists, getting top tracks, starting and stopping play, etc. work as expected. Just playlist_items fails. snippet: wbcurrent = '5VubtQBdfMONZ4lL7ZEb3Y' wbtracks = sp.playlist_items(playlist_id=wbcurrent,additional_types=("track",)) (I've also tried "tracks") I'm not really competent to comment on this but a quick look seems like the spotipy code appears to use a depreciated endpoint? see f"playlists/{plid}/tracks" below. Should this be "items" instead of "tracks"? def playlist_items( self, playlist_id, fields=None, limit=100, offset=0, market=None, additional_types=("track", "episode") ): """ Get full details of the tracks and episodes of a playlist. Parameters: - playlist_id - the playlist ID, URI or URL - fields - which fields to return - limit - the maximum number of tracks to return - offset - the index of the first track to return - market - an ISO 3166-1 alpha-2 country code. - additional_types - list of item types to return. valid types are: track and episode """ plid = self._get_id("playlist", playlist_id) return self._get( f"playlists/{plid}/tracks", limit=limit, offset=offset, fields=fields, market=market, additional_types=",".join(additional_types) ) Thanks, if it is something else that I am doing wrong please point me in the right direction.
Author
Owner

@gshorten commented on GitHub (Feb 24, 2026):

Update, Claude suggested either changing the endpoint in my local spotipy source or call the spotify endpoint directly. Both worked. I can now list playlist tracks.

<!-- gh-comment-id:3952029799 --> @gshorten commented on GitHub (Feb 24, 2026): Update, Claude suggested either changing the endpoint in my local spotipy source or call the spotify endpoint directly. Both worked. I can now list playlist tracks.
Author
Owner

@tonarec commented on GitHub (Feb 24, 2026):

This is a known issue, all enpoints using /tracks are deprecated by Spotify and should use /items instead, see the API reference
It's related to this issue #1227, and will be fixed in this PR #1228

<!-- gh-comment-id:3954970153 --> @tonarec commented on GitHub (Feb 24, 2026): This is a known issue, all enpoints using `/tracks` are deprecated by Spotify and should use `/items` instead, see [the API reference](https://developer.spotify.com/documentation/web-api/reference/get-playlists-tracks) It's related to this issue #1227, and will be fixed in this PR #1228
Author
Owner

@gshorten commented on GitHub (Feb 25, 2026):

Thanks! That was fast! Also having problems with deleting tracks from a
playlist. Maybe same class of problem, changed endpoints?

On Tue, Feb 24, 2026 at 3:01 PM Cédric Tonarelli @.***>
wrote:

tonarec left a comment (spotipy-dev/spotipy#1229)
https://github.com/spotipy-dev/spotipy/issues/1229#issuecomment-3954970153

This is a known issue, all enpoints using /tracks are deprecated by
Spotify and should use /items instead, see the API reference
https://developer.spotify.com/documentation/web-api/reference/get-playlists-tracks
It's related to this issue #1227
https://github.com/spotipy-dev/spotipy/issues/1227, and will be fixed
in this PR #1228 https://github.com/spotipy-dev/spotipy/pull/1228


Reply to this email directly, view it on GitHub
https://github.com/spotipy-dev/spotipy/issues/1229#issuecomment-3954970153,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGLUN43SUS2MAXSDKNPAABT4NTCZZAVCNFSM6AAAAACV5ISYMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSNJUHE3TAMJVGM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Geoff Shorten
403.471.6134 (c)

403.251.6015 (h)
2008 38th Avenue SW
Calgary, Alberta
T2T 2K4

<!-- gh-comment-id:3956589190 --> @gshorten commented on GitHub (Feb 25, 2026): Thanks! That was fast! Also having problems with deleting tracks from a playlist. Maybe same class of problem, changed endpoints? On Tue, Feb 24, 2026 at 3:01 PM Cédric Tonarelli ***@***.***> wrote: > *tonarec* left a comment (spotipy-dev/spotipy#1229) > <https://github.com/spotipy-dev/spotipy/issues/1229#issuecomment-3954970153> > > This is a known issue, all enpoints using /tracks are deprecated by > Spotify and should use /items instead, see the API reference > <https://developer.spotify.com/documentation/web-api/reference/get-playlists-tracks> > It's related to this issue #1227 > <https://github.com/spotipy-dev/spotipy/issues/1227>, and will be fixed > in this PR #1228 <https://github.com/spotipy-dev/spotipy/pull/1228> > > — > Reply to this email directly, view it on GitHub > <https://github.com/spotipy-dev/spotipy/issues/1229#issuecomment-3954970153>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AGLUN43SUS2MAXSDKNPAABT4NTCZZAVCNFSM6AAAAACV5ISYMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSNJUHE3TAMJVGM> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- *Geoff Shorten* *403.471.6134 (c)* *403.251.6015 (h)* 2008 38th Avenue SW Calgary, Alberta T2T 2K4
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#715
No description provided.