🎧 Spotify Playlist Curator with Postman’s Tool Generation API

I recently used Postman’s Tool Generation API to transform several Spotify APIs from the Postman API Network into agent tools. The result is an app that curates playlists directly on my Spotify account simply from a description of what I want to listen to.

I’m a huge music lover, but I often wish I could just describe what I was feeling and have an intelligent system build the perfect playlist for me. Something like:

  • “Songs about money”

  • “Songs by Beyoncé between 2002 and 2015”

  • “Grammy-winning rap tracks”

  • “Guitar instrumentals under 3 minutes”

  • “Songs by female artists born in June”

Using Streamlit for the front-end interface, I built a simple app that lets me describe a playlist idea in natural language. An OpenAI gpt-4 model then generates a list of suitable songs, and my Postman-generated tools handle everything else from creating a playlist on Spotify to adding the tracks automatically.

I used Postman’s Tool Generation API to generate ready-to-use Python tool definitions for the following Spotify operations:

  1. add_song_to_spotify_playlist.py – Adds selected songs to a playlist

  2. create_spotify_playlist.py – Creates a new playlist on Spotify

  3. get_spotify_user_profile.py – Retrieves the current user’s Spotify profile

  4. open_ai_generate_songs.py – Uses AI to suggest songs based on a mood or theme

  5. search_spotify_song.py – Searches Spotify for songs by title and artist

Each of these tools was generated directly from the Postman API network and integrated seamlessly into my app. The best part? I didn’t have to write boilerplate API integration code; the Tool Generation API handled that for me.

The full code is available on GitHub if you’d like to try it yourself.
I’d love to hear your thoughts, ideas, or feedback on how you would extend or improve it.

5 Likes

Nice one bro Spotify with Postman API :heart_eyes:

1 Like

Thank youu. :100: It’s been awesome exploring Spotify’s API on Postman.