Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

playlist snapshot_id is slow to update

playlist snapshot_id is slow to update

Plan

Free

Country

Sweden

Device

Web API

Operating System

Ubuntu Linux

 

My Question or Issue

I'm writing a chat bot that observes a collaborative playlist and posts about updates. To keep the user experience good and interactive, the bot needs to know when the playlist is updated by another user. Since there is no hook/socket for this, I have resorted to polling playlist/{playlist_id}.

 

To avoid having to grab all the playlist pages every time the bot polls, I want to use snapshot_id. However, I have found that the update of snapshot_id lags.

 

Below are some samples of how many seconds it took for snapshot_id to update, with respect to when the returned track list changed. That is, the content changes sometimes appear 60 seconds before the snapshot_id is changed.

 

add: 40, 60, 50
remove: 10, 30, 40

 

I am expecting that if the list of tracks have changed, the snapshot_id should have been changed as well.
 
Apart from my chat bot, this will mess with tools trying to update playlists using the API, as the snapshot_id they use will not match with the playlist contents.
Reply
1 Reply

Welcome to the Spotify Community, it's great to have you here! 😊

 

Thanks for sharing this very detailed behavior — it really helps those who are also developing with the Web API!

 

The snapshot_id should indeed reflect changes in the playlist content, and it is expected to change whenever a track is added, removed, or reordered. However, as you noticed, there may be a slight delay in updating the snapshot_id after modifications, especially in collaborative or highly active playlists.

 

This delay is usually related to internal caching and synchronization mechanisms on Spotify's servers. The API may return the new playlist content before the new snapshot_id is fully propagated.

 

As a developer, here are some tips that may help you:

If snapshot consistency is critical for your bot, it may be interesting to use a verification system based on local hashes of the tracks (e.g. IDs and order) as a fallback.

 

For actions such as updating or modifying the playlist, it is always recommended to wait a few seconds after the change before reusing the snapshot_id, ensuring that it has already been updated.

 

Continue using polling with adequate spacing (every 30s to 1min, for example) to avoid rate limits.

 

I hope this helps you understand this behavior better!


If you want to exchange more ideas about architecture or optimization strategies for bots, I am available.

Keep me updated,

 

Cheers,
ribezaz

ribezazSpotify 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.

Suggested posts

Staff
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…

Staff
ModeratorStaff / Moderator/ 3 years ago  in Social & Random