Announcements

Help Wizard

Step 1

NEXT STEP

recently played pagination problem

recently played pagination problem

Plan

Premium

Country

USA

Device

iMac 

Operating System

macOS Sonoma 14.5

 

My Question or Issue

I call the following command in a loop.  it should stop when response['next'] is NULL:

 

response = sp.current_user_recently_played(limit=50, after=int(cutoff_time.timestamp() * 1000)

 

unfortunately response['next'] is never NULL.  I just sends the same URL that shows the same three songs over and over again.  

 

any ideas?

 

thanks,

-Skipper

 

Reply
4 Replies

Hi Skipper,

 

The Get Recently Played Tracks feature can only retrieve up to 50 of the most recent tracks, even with paging.

 

I hope this clarifies your question. Let me know if you have any others.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Hey there - I think those are two separate issues. Even if I pull the max number available, shouldn’t next be set to NULL?

Thx!

Hey,

I agree that it should not provide next when there are no more tracks to get. The Devs should look into it.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

It is still a problem if I set the limit to 1. Just goes into an infinite loop.

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random