[GH-ISSUE #938] Get user's playlists in their library #563

Closed
opened 2026-02-27 23:23:22 +03:00 by kerem · 12 comments
Owner

Originally created by @WestheadJ on GitHub (Feb 2, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/938

Where can I get all the playlists in a user's library, I tried to use the user_playlists method and it only gets 22 results, my library has 40+ playlists, self created and not.

Originally created by @WestheadJ on GitHub (Feb 2, 2023). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/938 <!--- Please make sure you've: - read the FAQ https://github.com/plamere/spotipy/blob/master/FAQ.md - read the documentation https://spotipy.readthedocs.io/en/latest/ - searched older issues If your question is about code, please share the code you are using ---> Where can I get all the playlists in a user's library, I tried to use the `user_playlists` method and it only gets 22 results, my library has 40+ playlists, self created and not.
kerem 2026-02-27 23:23:22 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@mase-git commented on GitHub (Feb 2, 2023):

Can you post the your snippet of code about the user_playlists invocation? I tried on an account with 40+ playlists and it works, considering the 50 limit given by Spotify API constraint. Did you even try to run user_playlists example?

<!-- gh-comment-id:1414442713 --> @mase-git commented on GitHub (Feb 2, 2023): Can you post the your snippet of code about the [user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L787) invocation? I tried on an account with 40+ playlists and it works, considering the 50 limit given by Spotify API constraint. Did you even try to run [user_playlists example](https://github.com/spotipy-dev/spotipy/blob/master/examples/user_playlists.py)?
Author
Owner

@WestheadJ commented on GitHub (Feb 3, 2023):

Yes I used the method, still shows 22 results.
Screenshot 2023-02-03 at 1 36 11 am

<!-- gh-comment-id:1414604543 --> @WestheadJ commented on GitHub (Feb 3, 2023): Yes I used the method, still shows 22 results. <img width="782" alt="Screenshot 2023-02-03 at 1 36 11 am" src="https://user-images.githubusercontent.com/57768613/216490377-0528c665-9651-4216-98af-06c6ed345f09.png">
Author
Owner

@dieser-niko commented on GitHub (Feb 3, 2023):

I think I figured out what the problem is. You have not authenticated with your account. You can't see the other playlists because they are not publicly viewable on your profile.

What kind of auth manager are you using?

<!-- gh-comment-id:1415388833 --> @dieser-niko commented on GitHub (Feb 3, 2023): I think I figured out what the problem is. You have not authenticated with your account. You can't see the other playlists because they are not publicly viewable on your profile. What kind of auth manager are you using?
Author
Owner

@WestheadJ commented on GitHub (Feb 3, 2023):

Screenshot 2023-02-03 at 9 15 22 am
<!-- gh-comment-id:1415434061 --> @WestheadJ commented on GitHub (Feb 3, 2023): <img width="1359" alt="Screenshot 2023-02-03 at 9 15 22 am" src="https://user-images.githubusercontent.com/57768613/216560180-6f353c1b-bb57-4bb6-af39-a5c779ebb8d1.png">
Author
Owner

@mase-git commented on GitHub (Feb 3, 2023):

I tried with the Spotify account (it has more than 50+ public playlists) and it works as you can see from the following outputs:

import sys
import spotipy
from spotipy.oauth2 import SpotifyOAuth

if len(sys.argv) > 1:
    username = sys.argv[1]
else:
    print("Whoops, need a username!")
    print("usage: python user_playlists.py [username]")
    sys.exit()

sp = spotipy.Spotify(auth_manager=SpotifyOAuth())

playlists = sp.user_playlists(username)

i = 0
for playlist in playlists['items']:
    print(f"{i}: {playlist['name']}")
    i += 1

Output:

0: Today's Top Hits
1: RapCaviar
2: Hot Country
3: Viva Latino
4: New Music Friday
5: Peaceful Piano
6: Are & Be
7: Rock Classics
8: mint
9: Rock This
10: New Music Friday
11: just hits
12: All Out 2000s
13: All Out 90s
14: All Out 80s
15: All Out 70s
16: All Out 60s
17: All Out 50s
18: Soft Pop Hits
19: Signed XOXO
20: Most Necessary
21: Gold School
22: Get Turnt
23: B.A.E.
24: African Heat
25: Mind Right
26: Dancehall Official
27: Westside Story
28: Power Workout
29: No Cap
30: State of Mind
31: Alternative Hip-Hop
32: Workout Twerkout
33: We Everywhere
34: Black History Salute
35: New Noise
36: The New Alt
37: Rock Solid
38: Rock This: Best of 2017
39: Rock Party
40: You & Me
41: It's ALT Good!
42: The Scene
43: Rock Hard
44: This Is Ryan Adams
45: This Is The Black Keys
46: This Is Tom Petty and the Heartbreakers
47: This Is Nirvana
48: This Is Ramones
49: This Is Green Day

It shows the first 50 playlists because of the default limit. So, the problem is not Spotipy.

Are you sure that your playlist are correctly reachable in a public way? Spotify provides a private mode for personal playlists which let them visible only for the owner account and invited friends. spotipy.client.user_playlists follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that.

If you want to show your private and public playlists you have to use spotipy.client.current_user_playlists and login with your account.

<!-- gh-comment-id:1415438183 --> @mase-git commented on GitHub (Feb 3, 2023): I tried with the Spotify account (it has more than 50+ public playlists) and it works as you can see from the following outputs: ``` import sys import spotipy from spotipy.oauth2 import SpotifyOAuth if len(sys.argv) > 1: username = sys.argv[1] else: print("Whoops, need a username!") print("usage: python user_playlists.py [username]") sys.exit() sp = spotipy.Spotify(auth_manager=SpotifyOAuth()) playlists = sp.user_playlists(username) i = 0 for playlist in playlists['items']: print(f"{i}: {playlist['name']}") i += 1 ``` Output: ``` 0: Today's Top Hits 1: RapCaviar 2: Hot Country 3: Viva Latino 4: New Music Friday 5: Peaceful Piano 6: Are & Be 7: Rock Classics 8: mint 9: Rock This 10: New Music Friday 11: just hits 12: All Out 2000s 13: All Out 90s 14: All Out 80s 15: All Out 70s 16: All Out 60s 17: All Out 50s 18: Soft Pop Hits 19: Signed XOXO 20: Most Necessary 21: Gold School 22: Get Turnt 23: B.A.E. 24: African Heat 25: Mind Right 26: Dancehall Official 27: Westside Story 28: Power Workout 29: No Cap 30: State of Mind 31: Alternative Hip-Hop 32: Workout Twerkout 33: We Everywhere 34: Black History Salute 35: New Noise 36: The New Alt 37: Rock Solid 38: Rock This: Best of 2017 39: Rock Party 40: You & Me 41: It's ALT Good! 42: The Scene 43: Rock Hard 44: This Is Ryan Adams 45: This Is The Black Keys 46: This Is Tom Petty and the Heartbreakers 47: This Is Nirvana 48: This Is Ramones 49: This Is Green Day ``` It shows the first 50 playlists because of the default limit. So, the problem is not Spotipy. Are you sure that your playlist are correctly reachable in a public way? Spotify provides a private mode for personal playlists which let them visible only for the owner account and invited friends. [spotipy.client.user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L787) follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that. If you want to show your private and public playlists you have to use [spotipy.client.current_user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L629) and login with your account.
Author
Owner

@dieser-niko commented on GitHub (Feb 3, 2023):

spotipy.client.user_playlists follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that.

Not sure about that. I only have two public playlists but with the scope playlist-read-private all my private playlists appear.
@WestheadJ can you check your scopes?

<!-- gh-comment-id:1415497349 --> @dieser-niko commented on GitHub (Feb 3, 2023): > [spotipy.client.user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L787) follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that. Not sure about that. I only have two public playlists but with the scope `playlist-read-private` all my private playlists appear. @WestheadJ can you check your scopes?
Author
Owner

@WestheadJ commented on GitHub (Feb 3, 2023):

Yes, scope was incorrect thank you, I look dumb now

<!-- gh-comment-id:1415503927 --> @WestheadJ commented on GitHub (Feb 3, 2023): Yes, scope was incorrect thank you, I look dumb now
Author
Owner

@mase-git commented on GitHub (Feb 3, 2023):

spotipy.client.user_playlists follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that.

Not sure about that. I only have two public playlists but with the scope playlist-read-private all my private playlists appear. @WestheadJ can you check your scopes?

I didn't know that, you can also visualize private playlists without specify the explicit scope for the spotipy.client.user_playlists. So, there is no difference between spotipy.client.user_playlists(your_username) and spotipy.client.current_user_playlists with your_username your own account, right?

Thank you for the info

<!-- gh-comment-id:1415572813 --> @mase-git commented on GitHub (Feb 3, 2023): > > [spotipy.client.user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L787) follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that. > > Not sure about that. I only have two public playlists but with the scope `playlist-read-private` all my private playlists appear. @WestheadJ can you check your scopes? I didn't know that, you can also visualize private playlists without specify the explicit scope for the [spotipy.client.user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L787). So, there is no difference between spotipy.client.user_playlists(your_username) and spotipy.client.current_user_playlists with _your_username_ your own account, right? Thank you for the info
Author
Owner

@WestheadJ commented on GitHub (Feb 3, 2023):

Yes, I tried both methods and only displays public playlists and I think if I can remember it also doesn't show saved playlists you liked made by Spotify i.e This Is Arctic Monkeys, you specifically need the scope declaration even if it's a personal account, makes sense due to Spotify authentication, I just didn't know it was part of the scope that needed to be added, if you see below I thought that the playlist-modify-private, would give access to read the private playlists too due to being able to modify them.
Screenshot 2023-02-03 at 10 11 42 am
If anything it's an issue with Spotify's authentication scope, as you need to put multiple scopes in instead of being able to select a scope that uses a group of scopes i.e playlist scope but ah well. Thanks @dieser-niko and thanks anyone else for contributing my question

<!-- gh-comment-id:1415610473 --> @WestheadJ commented on GitHub (Feb 3, 2023): Yes, I tried both methods and only displays public playlists and I think if I can remember it also doesn't show saved playlists you liked made by Spotify i.e This Is Arctic Monkeys, you specifically need the scope declaration even if it's a personal account, makes sense due to Spotify authentication, I just didn't know it was part of the scope that needed to be added, if you see below I thought that the playlist-modify-private, would give access to read the private playlists too due to being able to modify them. <img width="662" alt="Screenshot 2023-02-03 at 10 11 42 am" src="https://user-images.githubusercontent.com/57768613/216573428-70482839-3864-46f6-8314-14b2216ff4ee.png"> If anything it's an issue with Spotify's authentication scope, as you need to put multiple scopes in instead of being able to select a scope that uses a group of scopes i.e playlist scope but ah well. Thanks @dieser-niko and thanks anyone else for contributing my question
Author
Owner

@WestheadJ commented on GitHub (Feb 3, 2023):

I tried with the Spotify account (it has more than 50+ public playlists) and it works as you can see from the following outputs:

import sys
import spotipy
from spotipy.oauth2 import SpotifyOAuth

if len(sys.argv) > 1:
    username = sys.argv[1]
else:
    print("Whoops, need a username!")
    print("usage: python user_playlists.py [username]")
    sys.exit()

sp = spotipy.Spotify(auth_manager=SpotifyOAuth())

playlists = sp.user_playlists(username)

i = 0
for playlist in playlists['items']:
    print(f"{i}: {playlist['name']}")
    i += 1

Output:

0: Today's Top Hits
1: RapCaviar
2: Hot Country
3: Viva Latino
4: New Music Friday
5: Peaceful Piano
6: Are & Be
7: Rock Classics
8: mint
9: Rock This
10: New Music Friday
11: just hits
12: All Out 2000s
13: All Out 90s
14: All Out 80s
15: All Out 70s
16: All Out 60s
17: All Out 50s
18: Soft Pop Hits
19: Signed XOXO
20: Most Necessary
21: Gold School
22: Get Turnt
23: B.A.E.
24: African Heat
25: Mind Right
26: Dancehall Official
27: Westside Story
28: Power Workout
29: No Cap
30: State of Mind
31: Alternative Hip-Hop
32: Workout Twerkout
33: We Everywhere
34: Black History Salute
35: New Noise
36: The New Alt
37: Rock Solid
38: Rock This: Best of 2017
39: Rock Party
40: You & Me
41: It's ALT Good!
42: The Scene
43: Rock Hard
44: This Is Ryan Adams
45: This Is The Black Keys
46: This Is Tom Petty and the Heartbreakers
47: This Is Nirvana
48: This Is Ramones
49: This Is Green Day

It shows the first 50 playlists because of the default limit. So, the problem is not Spotipy.

Are you sure that your playlist are correctly reachable in a public way? Spotify provides a private mode for personal playlists which let them visible only for the owner account and invited friends. spotipy.client.user_playlists follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that.

If you want to show your private and public playlists you have to use spotipy.client.current_user_playlists and login with your account.

I there a way to get the other half of the playlists i.e if there's 50 playlists it selects and there's say 65, can you get the extra 15 or does Spotify's API not allow this

<!-- gh-comment-id:1416129260 --> @WestheadJ commented on GitHub (Feb 3, 2023): > I tried with the Spotify account (it has more than 50+ public playlists) and it works as you can see from the following outputs: > > ``` > import sys > import spotipy > from spotipy.oauth2 import SpotifyOAuth > > if len(sys.argv) > 1: > username = sys.argv[1] > else: > print("Whoops, need a username!") > print("usage: python user_playlists.py [username]") > sys.exit() > > sp = spotipy.Spotify(auth_manager=SpotifyOAuth()) > > playlists = sp.user_playlists(username) > > i = 0 > for playlist in playlists['items']: > print(f"{i}: {playlist['name']}") > i += 1 > ``` > > Output: > > ``` > 0: Today's Top Hits > 1: RapCaviar > 2: Hot Country > 3: Viva Latino > 4: New Music Friday > 5: Peaceful Piano > 6: Are & Be > 7: Rock Classics > 8: mint > 9: Rock This > 10: New Music Friday > 11: just hits > 12: All Out 2000s > 13: All Out 90s > 14: All Out 80s > 15: All Out 70s > 16: All Out 60s > 17: All Out 50s > 18: Soft Pop Hits > 19: Signed XOXO > 20: Most Necessary > 21: Gold School > 22: Get Turnt > 23: B.A.E. > 24: African Heat > 25: Mind Right > 26: Dancehall Official > 27: Westside Story > 28: Power Workout > 29: No Cap > 30: State of Mind > 31: Alternative Hip-Hop > 32: Workout Twerkout > 33: We Everywhere > 34: Black History Salute > 35: New Noise > 36: The New Alt > 37: Rock Solid > 38: Rock This: Best of 2017 > 39: Rock Party > 40: You & Me > 41: It's ALT Good! > 42: The Scene > 43: Rock Hard > 44: This Is Ryan Adams > 45: This Is The Black Keys > 46: This Is Tom Petty and the Heartbreakers > 47: This Is Nirvana > 48: This Is Ramones > 49: This Is Green Day > ``` > > It shows the first 50 playlists because of the default limit. So, the problem is not Spotipy. > > Are you sure that your playlist are correctly reachable in a public way? Spotify provides a private mode for personal playlists which let them visible only for the owner account and invited friends. [spotipy.client.user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L787) follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that. > > If you want to show your private and public playlists you have to use [spotipy.client.current_user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L629) and login with your account. I there a way to get the other half of the playlists i.e if there's 50 playlists it selects and there's say 65, can you get the extra 15 or does Spotify's API not allow this
Author
Owner

@mase-git commented on GitHub (Feb 3, 2023):

I tried with the Spotify account (it has more than 50+ public playlists) and it works as you can see from the following outputs:

import sys
import spotipy
from spotipy.oauth2 import SpotifyOAuth

if len(sys.argv) > 1:
    username = sys.argv[1]
else:
    print("Whoops, need a username!")
    print("usage: python user_playlists.py [username]")
    sys.exit()

sp = spotipy.Spotify(auth_manager=SpotifyOAuth())

playlists = sp.user_playlists(username)

i = 0
for playlist in playlists['items']:
    print(f"{i}: {playlist['name']}")
    i += 1

Output:

0: Today's Top Hits
1: RapCaviar
2: Hot Country
3: Viva Latino
4: New Music Friday
5: Peaceful Piano
6: Are & Be
7: Rock Classics
8: mint
9: Rock This
10: New Music Friday
11: just hits
12: All Out 2000s
13: All Out 90s
14: All Out 80s
15: All Out 70s
16: All Out 60s
17: All Out 50s
18: Soft Pop Hits
19: Signed XOXO
20: Most Necessary
21: Gold School
22: Get Turnt
23: B.A.E.
24: African Heat
25: Mind Right
26: Dancehall Official
27: Westside Story
28: Power Workout
29: No Cap
30: State of Mind
31: Alternative Hip-Hop
32: Workout Twerkout
33: We Everywhere
34: Black History Salute
35: New Noise
36: The New Alt
37: Rock Solid
38: Rock This: Best of 2017
39: Rock Party
40: You & Me
41: It's ALT Good!
42: The Scene
43: Rock Hard
44: This Is Ryan Adams
45: This Is The Black Keys
46: This Is Tom Petty and the Heartbreakers
47: This Is Nirvana
48: This Is Ramones
49: This Is Green Day

It shows the first 50 playlists because of the default limit. So, the problem is not Spotipy.
Are you sure that your playlist are correctly reachable in a public way? Spotify provides a private mode for personal playlists which let them visible only for the owner account and invited friends. spotipy.client.user_playlists follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that.
If you want to show your private and public playlists you have to use spotipy.client.current_user_playlists and login with your account.

I there a way to get the other half of the playlists i.e if there's 50 playlists it selects and there's say 65, can you get the extra 15 or does Spotify's API not allow this

Yes, you can use the offset parameter and shift the 50 results to n units. For instance, if you have limit to 50 and offset to 10, you will visualize the list of items between 10 and 60. This feature is normalize for any kind of items inside the Spotipy.

<!-- gh-comment-id:1416134035 --> @mase-git commented on GitHub (Feb 3, 2023): > > I tried with the Spotify account (it has more than 50+ public playlists) and it works as you can see from the following outputs: > > ``` > > import sys > > import spotipy > > from spotipy.oauth2 import SpotifyOAuth > > > > if len(sys.argv) > 1: > > username = sys.argv[1] > > else: > > print("Whoops, need a username!") > > print("usage: python user_playlists.py [username]") > > sys.exit() > > > > sp = spotipy.Spotify(auth_manager=SpotifyOAuth()) > > > > playlists = sp.user_playlists(username) > > > > i = 0 > > for playlist in playlists['items']: > > print(f"{i}: {playlist['name']}") > > i += 1 > > ``` > > > > > > > > > > > > > > > > > > > > > > > > Output: > > ``` > > 0: Today's Top Hits > > 1: RapCaviar > > 2: Hot Country > > 3: Viva Latino > > 4: New Music Friday > > 5: Peaceful Piano > > 6: Are & Be > > 7: Rock Classics > > 8: mint > > 9: Rock This > > 10: New Music Friday > > 11: just hits > > 12: All Out 2000s > > 13: All Out 90s > > 14: All Out 80s > > 15: All Out 70s > > 16: All Out 60s > > 17: All Out 50s > > 18: Soft Pop Hits > > 19: Signed XOXO > > 20: Most Necessary > > 21: Gold School > > 22: Get Turnt > > 23: B.A.E. > > 24: African Heat > > 25: Mind Right > > 26: Dancehall Official > > 27: Westside Story > > 28: Power Workout > > 29: No Cap > > 30: State of Mind > > 31: Alternative Hip-Hop > > 32: Workout Twerkout > > 33: We Everywhere > > 34: Black History Salute > > 35: New Noise > > 36: The New Alt > > 37: Rock Solid > > 38: Rock This: Best of 2017 > > 39: Rock Party > > 40: You & Me > > 41: It's ALT Good! > > 42: The Scene > > 43: Rock Hard > > 44: This Is Ryan Adams > > 45: This Is The Black Keys > > 46: This Is Tom Petty and the Heartbreakers > > 47: This Is Nirvana > > 48: This Is Ramones > > 49: This Is Green Day > > ``` > > > > > > > > > > > > > > > > > > > > > > > > It shows the first 50 playlists because of the default limit. So, the problem is not Spotipy. > > Are you sure that your playlist are correctly reachable in a public way? Spotify provides a private mode for personal playlists which let them visible only for the owner account and invited friends. [spotipy.client.user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L787) follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that. > > If you want to show your private and public playlists you have to use [spotipy.client.current_user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L629) and login with your account. > > I there a way to get the other half of the playlists i.e if there's 50 playlists it selects and there's say 65, can you get the extra 15 or does Spotify's API not allow this Yes, you can use the offset parameter and shift the 50 results to n units. For instance, if you have limit to 50 and offset to 10, you will visualize the list of items between 10 and 60. This feature is normalize for any kind of items inside the Spotipy.
Author
Owner

@WestheadJ commented on GitHub (Feb 3, 2023):

I tried with the Spotify account (it has more than 50+ public playlists) and it works as you can see from the following outputs:

import sys
import spotipy
from spotipy.oauth2 import SpotifyOAuth

if len(sys.argv) > 1:
    username = sys.argv[1]
else:
    print("Whoops, need a username!")
    print("usage: python user_playlists.py [username]")
    sys.exit()

sp = spotipy.Spotify(auth_manager=SpotifyOAuth())

playlists = sp.user_playlists(username)

i = 0
for playlist in playlists['items']:
    print(f"{i}: {playlist['name']}")
    i += 1

Output:

0: Today's Top Hits
1: RapCaviar
2: Hot Country
3: Viva Latino
4: New Music Friday
5: Peaceful Piano
6: Are & Be
7: Rock Classics
8: mint
9: Rock This
10: New Music Friday
11: just hits
12: All Out 2000s
13: All Out 90s
14: All Out 80s
15: All Out 70s
16: All Out 60s
17: All Out 50s
18: Soft Pop Hits
19: Signed XOXO
20: Most Necessary
21: Gold School
22: Get Turnt
23: B.A.E.
24: African Heat
25: Mind Right
26: Dancehall Official
27: Westside Story
28: Power Workout
29: No Cap
30: State of Mind
31: Alternative Hip-Hop
32: Workout Twerkout
33: We Everywhere
34: Black History Salute
35: New Noise
36: The New Alt
37: Rock Solid
38: Rock This: Best of 2017
39: Rock Party
40: You & Me
41: It's ALT Good!
42: The Scene
43: Rock Hard
44: This Is Ryan Adams
45: This Is The Black Keys
46: This Is Tom Petty and the Heartbreakers
47: This Is Nirvana
48: This Is Ramones
49: This Is Green Day

It shows the first 50 playlists because of the default limit. So, the problem is not Spotipy.
Are you sure that your playlist are correctly reachable in a public way? Spotify provides a private mode for personal playlists which let them visible only for the owner account and invited friends. spotipy.client.user_playlists follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that.
If you want to show your private and public playlists you have to use spotipy.client.current_user_playlists and login with your account.

I there a way to get the other half of the playlists i.e if there's 50 playlists it selects and there's say 65, can you get the extra 15 or does Spotify's API not allow this

Yes, you can use the offset parameter and shift the 50 results to n units. For instance, if you have limit to 50 and offset to 10, you will visualize the list of items between 10 and 60. This feature is normalize for any kind of items inside the Spotipy.

Just realised one of the scopes is to show collab playlists, without it the 'next' value in the response was None, when adding it, I can therefore do the next

<!-- gh-comment-id:1416382113 --> @WestheadJ commented on GitHub (Feb 3, 2023): > > > I tried with the Spotify account (it has more than 50+ public playlists) and it works as you can see from the following outputs: > > > ``` > > > import sys > > > import spotipy > > > from spotipy.oauth2 import SpotifyOAuth > > > > > > if len(sys.argv) > 1: > > > username = sys.argv[1] > > > else: > > > print("Whoops, need a username!") > > > print("usage: python user_playlists.py [username]") > > > sys.exit() > > > > > > sp = spotipy.Spotify(auth_manager=SpotifyOAuth()) > > > > > > playlists = sp.user_playlists(username) > > > > > > i = 0 > > > for playlist in playlists['items']: > > > print(f"{i}: {playlist['name']}") > > > i += 1 > > > ``` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Output: > > > ``` > > > 0: Today's Top Hits > > > 1: RapCaviar > > > 2: Hot Country > > > 3: Viva Latino > > > 4: New Music Friday > > > 5: Peaceful Piano > > > 6: Are & Be > > > 7: Rock Classics > > > 8: mint > > > 9: Rock This > > > 10: New Music Friday > > > 11: just hits > > > 12: All Out 2000s > > > 13: All Out 90s > > > 14: All Out 80s > > > 15: All Out 70s > > > 16: All Out 60s > > > 17: All Out 50s > > > 18: Soft Pop Hits > > > 19: Signed XOXO > > > 20: Most Necessary > > > 21: Gold School > > > 22: Get Turnt > > > 23: B.A.E. > > > 24: African Heat > > > 25: Mind Right > > > 26: Dancehall Official > > > 27: Westside Story > > > 28: Power Workout > > > 29: No Cap > > > 30: State of Mind > > > 31: Alternative Hip-Hop > > > 32: Workout Twerkout > > > 33: We Everywhere > > > 34: Black History Salute > > > 35: New Noise > > > 36: The New Alt > > > 37: Rock Solid > > > 38: Rock This: Best of 2017 > > > 39: Rock Party > > > 40: You & Me > > > 41: It's ALT Good! > > > 42: The Scene > > > 43: Rock Hard > > > 44: This Is Ryan Adams > > > 45: This Is The Black Keys > > > 46: This Is Tom Petty and the Heartbreakers > > > 47: This Is Nirvana > > > 48: This Is Ramones > > > 49: This Is Green Day > > > ``` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > It shows the first 50 playlists because of the default limit. So, the problem is not Spotipy. > > > Are you sure that your playlist are correctly reachable in a public way? Spotify provides a private mode for personal playlists which let them visible only for the owner account and invited friends. [spotipy.client.user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L787) follows a scope that can't shows this kind of playlists. Maybe, the problem is linked to that. > > > If you want to show your private and public playlists you have to use [spotipy.client.current_user_playlists](https://github.com/spotipy-dev/spotipy/blob/c53511bbbe87f89c2aeaa65bef584539db440f97/spotipy/client.py#L629) and login with your account. > > > > > > I there a way to get the other half of the playlists i.e if there's 50 playlists it selects and there's say 65, can you get the extra 15 or does Spotify's API not allow this > > Yes, you can use the offset parameter and shift the 50 results to n units. For instance, if you have limit to 50 and offset to 10, you will visualize the list of items between 10 and 60. This feature is normalize for any kind of items inside the Spotipy. Just realised one of the scopes is to show collab playlists, without it the 'next' value in the response was None, when adding it, I can therefore do the next
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#563
No description provided.