[GH-ISSUE #214] Issue getting current users top artists/tracks #111

Closed
opened 2026-02-27 23:20:53 +03:00 by kerem · 0 comments
Owner

Originally created by @Andreilys on GitHub (Sep 25, 2017).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/214

I'm trying to get my top tracks/artists, but have ran into a 403 error.

import sys
import spotipy
import spotipy.util as util

scope = ''
username = ''
token = util.prompt_for_user_token(username,scope,client_id='',client_secret='',redirect_uri='/')


if token:
    sp = spotipy.Spotify(auth=token)
    print(sp.current_user_top_artists())

I'm able to acces sp.current_user(), however when I try to run the above code, i get the following error:

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.spotify.com/v1/me/top/artists?offset=0&limit=20&time_range=medium_term

Any suggestions?

Originally created by @Andreilys on GitHub (Sep 25, 2017). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/214 I'm trying to get my top tracks/artists, but have ran into a 403 error. ``` import sys import spotipy import spotipy.util as util scope = '' username = '' token = util.prompt_for_user_token(username,scope,client_id='',client_secret='',redirect_uri='/') if token: sp = spotipy.Spotify(auth=token) print(sp.current_user_top_artists()) ``` I'm able to acces sp.current_user(), however when I try to run the above code, i get the following error: requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.spotify.com/v1/me/top/artists?offset=0&limit=20&time_range=medium_term Any suggestions?
kerem closed this issue 2026-02-27 23:20:53 +03:00
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#111
No description provided.