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

how to add new entries from different charts in a new playlist

how to add new entries from different charts in a new playlist

Viral charts, on country level, are updated daily. I am tired of checking new entries every day per country. I want to create a playlist which adds new entries in various charts, so I can listen the new entries in one playlist rather than checking chart by chart. I want to write a script for this.
Reply
8 Replies

Hi @Emrah78,

 

I understand your goal is to create a script that automatically adds new entries from various country-specific viral charts into one playlist, so you don’t have to check each chart manually every day. Here's how you can set up a script to automate this process:

 

  • Initial Setup:
  • • Write a script that retrieves track IDs from all the charts for the countries you’re interested in.
  • • Store all the unique track IDs in a file or database for tracking purposes.
  • Daily Updates:
  • • Schedule the script to run daily, fetching the updated viral charts for each country.
  • • Gather all (unique) track IDs from the updated charts and compile them into a list.
  • Identify and Add New Entries:
  • • Use a difference function to compare the newly fetched track IDs with those already stored in your file or database. This will help you identify the new entries that have appeared since the last update. For example, you can look at this Stack Overflow answer.
  • • Add these new tracks to your playlist and update your file or database with these new IDs so they are included in future comparisons.

This way, you’ll have an automatically updated playlist that includes all the new entries from the charts you follow without having to manually check each one.

 

I hope this helps you automate your playlist creation! Let me know if you have any questions or need further assistance.

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.

You can use the Python library Spotipy to get the playlist tracks and adding them to a playlist. You'll need the code with user authorization.

 

You can get all the playlist IDs with sp.category_playlists(category_id="0JQ5DAudkNjCgYMM0TZXDw", limit=50, offset=x)

If you save those IDs into a file or database, you'll need to run that only once.

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.

Thank you so much for the advice. I am not a programmer or whatever, I am using AI, I try different prompts till I get the result I want. So far I was able to create a playlist with a code. It did copy the entire chart not the new entries. There I got stuck. If you have more advice, please feel free to share.

I can write it for you. Edit: or you can post what you already have, and I will have a look at it.

There are 75 viral charts, so I am not sure if it won't trigger a rate limit.

Do you collect the new entries of all countries, or are you only interested in specific ones?

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.

Thank you for your help, so far i have managed it. It creates new playlists of every country but I want just one playlist with new entries in countries chosen.

If I fail to create the last one, I can use your help.

Hi @Emrah78,

 

It's been a week, so I just wanted to check how things are going with your development journey.

 

Sorry for not offering further assistance after your last message.

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.

Thanks for the follow up. Well, it can be perfected of course. It creates a new playlist with new entries for every country I follow. Ideal is to add the new entries in one playlist. Somehow, it duplicates some new playlists sometimes. New entries from the script does not match the new entries in official Spotify playlists. The script is not automated because I do not run it from a server so I run it once a day manually. But so far even with this it saved me a lot of time, I am happy of course. Cannot wait how it will be when I make the improvements.

Hi @Emrah78 

 

When you save the target playlist I'd, you can keep adding tracks to it, without needing creating new ones.

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.

Suggested posts