From Setlists to Playlists

Author

Vít Gabrhel

Published

December 30, 2025

Introduction or The Show Must Go On

Picture this. You enjoy going to live music events. Sometimes, you want to listen to the songs you heard at that great concert to tap into the experience of that moment. Other times, you want to “prepare” yourself for a long-expected gig.

In both scenarios, you could create a playlist. However, doing so manually is tedious. You have to search for the setlist of your interest, and then conduct a set of operations in the music app of your choice.

This is where this project comes in. It emerged from a question: how can we automate the translation of concert setlists into playlists?

It is a Streamlit application that allows you to create a playlist from a setlist. To be more specific, it uses the Setlist.fm API to get the setlist and the Spotify API to create the playlist.

The app can be found on Streamlit Community Cloud. Please note that it is in development mode, and only 25 users can use it at a time. I discuss this in more detail in the Usage and Caveats section.

You can also find the code on GitHub. Feel free to fork it, run it locally, or deploy where sensible to you. Contributions are welcome.

This article aims to guide you, dear reader, through the technical details and the implementation of the application.

Landing page of the application

The Principle or Everything in Its Right Place

The application operates on a straightforward principle: it connects publicly available (and sourced) concert setlists with a platform with a music catalog containing the songs.

To be more specific, Setlist.fm maintains a comprehensive database of live performances, while Spotify’s API allows programmatic playlist creation.

At its core, the application follows a three-step flow:

  1. Artist Search: Query Setlist.fm for an artist and retrieve their most recent tour setlist (filtered to the last 12 months).
  • This is done by fetching setlists sorted by date (newest first) and then checking if the eventDate is within the last 12 months and if the setlist contains songs. If both conditions are met, the setlist is returned.
  1. Setlist Parsing: Extract song information, including covers, encores, and special notations.
  2. Playlist Creation: Search Spotify for matching tracks and assemble them into a playlist.

Spotify Authentication

The Implementation or Map of the Problematique

Built with Python and Streamlit, the application leverages two main APIs:

  • Setlist.fm API: Provides access to concert setlist data, including venue information, event dates, and song sequences.
  • Spotify Web API: Handles OAuth authentication and playlist management.

The architecture is modular: separate modules handle Spotify authentication (src/spotify.py), Setlist.fm interactions (src/setlistfm.py), and data formatting utilities (src/utils.py).

One of the more interesting challenges was handling the mismatch between setlist data and Spotify’s catalog. A setlist might list “Stairway to Heaven” as performed by Led Zeppelin, but if the user searches for a cover version, the application needs to match intelligently.

The current implementation uses a tiered search strategy: first attempting exact matches with artist names, then falling back to fuzzy matching, and finally searching by song title alone.

To elaborate on the sorting, when parsing the setlist, it extracts the original_artist field—if a song is marked as a cover, it uses the original artist from Setlist.fm’s cover field; otherwise, it uses the performing artist’s name. The search_track_on_spotify() function then uses a three-tier fallback strategy: first attempting an exact match with Spotify’s query syntax using the song name and artist, then a simple text search combining both, and finally searching by song name alone. At each tier, the function takes the first result from Spotify’s API (limit=1), which returns tracks ordered by relevance (typically popularity and match quality).

Spotify OAuth

Getting Started or Welcome to the Machine

The application requires API credentials from both services. The currently deployed app has the Setlist.fm API token embedded. However, should you run it by yourself, you will need to obtain your own credentials:

For local development, credentials are stored in .streamlit/secrets.toml. For deployment on Streamlit Cloud, they’re configured through the platform’s secrets management interface.

Connected. Search for an artist.

Limitations or Push the Sky Away

Development Mode Restrictions: Spotify apps in development mode can only be used by up to 25 explicitly registered users. This is a significant limitation for public-facing applications. To make the app accessible to everyone, since May 2025, you must submit it for Spotify’s app review process. The review process requires a fully functional application, privacy policy, and terms of service. - To be honest, the conditions are (at least declaratively) rather strict. For example, it expects at least 250k monthly active users. Find more information in the documentation.

Rate Limiting: Both APIs implement rate limiting. Setlist.fm’s API is relatively generous (16 requests/second or 50k requests/day), but Spotify’s rate limits can become a bottleneck if many users are creating playlists simultaneously. The application includes basic rate limit handling, but high-traffic scenarios would require more sophisticated queuing mechanisms (e.g., using a batch processing mechanism for larger setlists).

Matching Accuracy: To build on the description of the song matching in the previous section, the song matching is far from perfect. Cover songs, live versions, and songs with multiple artists can result in mismatches or missing tracks. The application reports which songs couldn’t be found, but this requires manual intervention. Sometimes the setlist says “Purple Haze”, but Spotify has numerous versions to choose from.

Data Availability: The application only works for artists who have recent setlists in Setlist.fm’s database. Less popular artists or very recent tours might not be available. The database is crowd-sourced, after all—someone has to document that show first.

Single Setlist Focus: Currently only retrieves the most recent setlist, not historical ones. Time travel not yet implemented.

Create the playlist.

Technical Considerations or Careful With That Axe, Eugene

The application uses OAuth 2.0 for Spotify authentication, storing tokens securely in user-specific cache files. Each user session is assigned a unique identifier to prevent token collisions in multi-user scenarios. The app does not store user passwords, Spotify account credentials, or personal information beyond what’s necessary for functionality, and all data is cleared when users disconnect.

For deployment, the application is designed to work on Streamlit Cloud, which handles the infrastructure concerns. The redirect URI is automatically detected based on the deployment environment, though it can be explicitly configured if needed.

Running…

Future Directions or Far From Any Road

Several improvements could enhance the application:

  • Historical Setlists: Allow users to select from multiple recent setlists rather than just the latest. Because sometimes you want that specific show from Prague in 2019.
  • Playlist Customization: Enable users to modify setlists before creating playlists (remove songs, reorder, etc.). Maybe you want to skip the Wonderwall cover in your playlist if the music catalog does not contain it when you do not feel like adding the original version.
  • Batch Processing: Support creating multiple playlists from a tour series. Document an entire tour in one go.
  • Better Matching: Implement more sophisticated song matching.
  • Export Options: Support exporting setlists to other formats (CSV, JSON) or other streaming services.
  • Venue Information: Include venue details and show dates in playlist descriptions. Add that contextual memory.

Voila!

Famous Last Words

The application also highlights the practical challenges of working with external APIs—rate limits, authentication complexity, and data format mismatches.

I’ve used this application dozens of times now, creating playlists from shows I attended (both before them taking place and after them), but also from shows I wish I had. Like the Radiohead concert in Copenhagen from the recent (and limited) tour.

Sorry for repeating myself, but the code is available on GitHub, and contributions are welcome. Whether you’re interested in improving the matching algorithm, adding new features, or deploying your own instance, the repository provides a starting point for further development.

If you’ve made it this far, thank you for reading. I hope you find the app useful.


   

Return to Blog.