Weekly
Reorder a playlist by popularity every week
The best-known tracks move to the top of the playlist each Sunday.
- Runs
- Weekly
- Apps
- Spotify
- AI
- Not needed
- Access
- playlist-modify-private/public
Send this to your assistant
Create a ClickRuntime automation: every Sunday at noon, reorder my 'Party' playlist so the most popular tracks come first.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A long playlist for a party, a store or a gym is only as good as its first ten songs, and the order is usually an accident of when each track was added. The crowd-pleasers are buried in the middle, and obscure songs open the night. Spotify can sort a playlist by title, artist or date added, but not by how popular a song is, so manually reordering a list of 150 tracks is slow and hardly anyone does it.
Every week, ClickRuntime reads the playlist's tracks along with Spotify's popularity score for each, sorts them from the most popular to the least, and replaces the playlist's order with the result. Songs you add during the week are placed according to their score the next time it runs.
DJs, venues, wedding planners and anyone who curates a playlist that people actually play will get the most value.
What you get out of it
Opening tracks hold attention
The first songs set the mood. Putting the most recognizable ones up front means guests or customers hear familiar music immediately, and they settle in instead of reaching for the skip button.
Hit songs are not buried
In a playlist built over months, the best-known tracks end up at random places. Sorting by popularity brings them forward, so they are played often instead of reached rarely. Listeners notice the difference within the first few songs.
Maintenance becomes weekly and automatic
New tracks find their place without effort. A playlist with 150 songs that grows each week stays organized, and a curator can concentrate on choosing music instead of ordering it. Nobody needs to remember to sort the list before an event.
Shuffle and order can both be used
A listener who plays in order hears the popular tracks first, while shuffle still draws on the whole list. The ordering is useful in both modes. That makes the sorting useful whichever way you listen.
Data replaces guesswork
Spotify's popularity score reflects recent play counts, so the order reflects what people actually listen to. That beats a host's guess at what a crowd likes. A host can enter a room with confidence that the music will be familiar to most people.
How it works
What happens, step by step
Every Sunday, ClickRuntime reads every track in the Spotify playlist you chose, along with how popular each one is on Spotify.
It sorts the tracks from most to least popular.
It saves the new order back to the playlist, so the best-known songs play first.
You get a note with the number of tracks reordered and which song is now at the top.
Before it runs live
- Connect Spotify
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Spotify steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http
API = "https://api.spotify.com/v1"
PLAYLIST_ID = "your-party-playlist-id"
@on_trigger
def run(event):
h = {"Authorization": f"Bearer {credentials.connection('spotify', 'personal')}"}
tracks, url = [], f"{API}/playlists/{PLAYLIST_ID}/tracks?fields=items(track(uri,popularity,name)),next&limit=100"
while url:
page = http.get(url, headers=h).json()
tracks += [i["track"] for i in page["items"] if i.get("track")]
url = page["next"]
tracks.sort(key=lambda t: t["popularity"], reverse=True)
uris = [t["uri"] for t in tracks]
http.put(f"{API}/playlists/{PLAYLIST_ID}/tracks", headers=h, json={"uris": uris[:100]})
for i in range(100, len(uris), 100):
http.post(f"{API}/playlists/{PLAYLIST_ID}/tracks", headers=h, json={"uris": uris[i:i + 100]})
return {"sorted": len(uris), "top": tracks[0]["name"] if tracks else None}FAQ
Common questions
What does the popularity number mean?
Will sorting remove any songs?
Can I sort from least popular to most popular?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Save Discover Weekly to a permanent playlist each Monday
Each week's Discover Weekly tracks land in an archive playlist, with no duplicates.
See how it worksEmail yourself a monthly backup of your Liked Songs
On the 1st of each month you get a CSV listing every liked song, artist and album.
See how it worksQueue, skip or pause Spotify from a link
Calling a link adds a track to your queue, skips to the next song or pauses playback.
See how it worksKeep exploring
Set up “Reorder a playlist by popularity every week” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.