[GH-ISSUE #336] Get users id #193

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

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

Hi everyone, my question:
is possible get a user id in any way? I would search a user from his name and print his recently artist played

Thanks

Originally created by @AlessandroMinervini on GitHub (Oct 25, 2018). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/336 Hi everyone, my question: is possible get a user id in any way? I would search a user from his name and print his recently artist played Thanks
kerem closed this issue 2026-02-27 23:21:19 +03:00
Author
Owner

@Pizza-slice commented on GitHub (Nov 14, 2018):

ya using the me function
token = util.prompt_for_user_token(username, scop, SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET, SPOTIPY_REDIRECT_URI) if token:

    sp = spotipy.client.Spotify(auth=token)
    results = sp.me()

the return will be a dictionary(the python to equivalent to JSON)
in the dictionary there is more info just then user id (email , Birth-Day,profile photo etc... ) i think it depend on your scop you ask with your token

<!-- gh-comment-id:438837454 --> @Pizza-slice commented on GitHub (Nov 14, 2018): ya using the `me` function `token = util.prompt_for_user_token(username, scop, SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET, SPOTIPY_REDIRECT_URI) if token:` sp = spotipy.client.Spotify(auth=token) results = sp.me() the return will be a dictionary(the python to equivalent to JSON) in the dictionary there is more info just then user id (email , Birth-Day,profile photo etc... ) i think it depend on your scop you ask with your token
Author
Owner

@AlessandroMinervini commented on GitHub (Nov 15, 2018):

Ok thank you for my current user,
but if i want the id of my friend?

Thank you

<!-- gh-comment-id:438961919 --> @AlessandroMinervini commented on GitHub (Nov 15, 2018): Ok thank you for my current user, but if i want the id of my friend? Thank you
Author
Owner

@mckinly commented on GitHub (Nov 29, 2019):

@AlessandroMinervini If you know the username of your friend you can pass that as a string into this method. github.com/plamere/spotipy@4c2c1d763a/spotipy/client.py (L346)

Also see the Web Api docs for more information Get user's profile

<!-- gh-comment-id:559663180 --> @mckinly commented on GitHub (Nov 29, 2019): @AlessandroMinervini If you know the username of your friend you can pass that as a string into this method. https://github.com/plamere/spotipy/blob/4c2c1d763a3653aa225c4af848409ec31286a6bf/spotipy/client.py#L346 Also see the Web Api docs for more information [Get user's profile](https://developer.spotify.com/documentation/web-api/reference/users-profile/get-users-profile/)
Author
Owner

@stephanebruckert commented on GitHub (Jan 12, 2020):

It's unclear what you are really asking but if you are looking to search a user by display name in order to get the ID, it doesn't seem possible. Probably this is for security/privacy reasons. As @mckinly suggested, you need the user ID to find a user.

<!-- gh-comment-id:573407520 --> @stephanebruckert commented on GitHub (Jan 12, 2020): It's unclear what you are really asking but if you are looking to search a user by display name in order to get the ID, it doesn't seem possible. Probably this is for security/privacy reasons. As @mckinly suggested, you need the user ID to find a user.
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#193
No description provided.