[GH-ISSUE #325] After the enter redirected URL, no effects from code #186

Closed
opened 2026-02-27 23:21:16 +03:00 by kerem · 2 comments
Owner

Originally created by @AlessandroMinervini on GitHub (Oct 5, 2018).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/325

Hi!
I followed the instructions of https://spotipy.readthedocs.io/en/latest/# and i think the authentication was successful.
After the enter of redirected URL i want to try to search an artist and print the results but i have no effects in output, and don't show any error

the code:

import spotipy
import spotipy.util as util

#Set token, username
token = util.prompt_for_user_token('xxxxxx', client_id='xxxxxx', client_secret='xxxxxx', redirect_uri='https://www.google.it')

sp = spotipy.Spotify(auth=token)

results = sp.search(q='Arctic Monkeys', limit=20)
for i, t in enumerate(results['tracks']['items']):
    print(' ', i, t['name'])
Originally created by @AlessandroMinervini on GitHub (Oct 5, 2018). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/325 Hi! I followed the instructions of https://spotipy.readthedocs.io/en/latest/# and i think the authentication was successful. After the enter of redirected URL i want to try to search an artist and print the results but i have no effects in output, and don't show any error the code: ``` import spotipy import spotipy.util as util #Set token, username token = util.prompt_for_user_token('xxxxxx', client_id='xxxxxx', client_secret='xxxxxx', redirect_uri='https://www.google.it') sp = spotipy.Spotify(auth=token) results = sp.search(q='Arctic Monkeys', limit=20) for i, t in enumerate(results['tracks']['items']): print(' ', i, t['name']) ```
kerem closed this issue 2026-02-27 23:21:17 +03:00
Author
Owner

@novatorem commented on GitHub (Oct 5, 2018):

Someone correct me if I'm wrong, this may be because you don't have the scope, this is for the token:

token = util.prompt_for_user_token('username', 'scope', cient_id...)

https://developer.spotify.com/documentation/general/guides/scopes/

I think they changed it some time back as it used to be public.

<!-- gh-comment-id:427368328 --> @novatorem commented on GitHub (Oct 5, 2018): Someone correct me if I'm wrong, this may be because you don't have the scope, this is for the token: `token = util.prompt_for_user_token('username', 'scope', cient_id...)` https://developer.spotify.com/documentation/general/guides/scopes/ I think they changed it some time back as it used to be public.
Author
Owner

@AlessandroMinervini commented on GitHub (Oct 5, 2018):

Thanks!

<!-- gh-comment-id:427447625 --> @AlessandroMinervini commented on GitHub (Oct 5, 2018): Thanks!
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#186
No description provided.