Spotify CLI

blogarc.millionpieces.nl · 2026-07-23 · by Long Nguyen ·generic
This week, Spotify prompted me to install Spotify Studio, a new AI-powered tool from Spotify. As I’ve been experimenting with the Spotify API over the past few weeks, I couldn’t resist trying it out. I may write more about those experiments in a future post. Spotify Studio is a useful tool for analysing your Spotify … Lees verder "Spotify CLI"

Spotify CLI

Screenshot of Spotify Studio with the question "Can you show me the last 50 tracks I listened to?" It shows the "thinking" and then the result with info about Robert Johnson,Opus III and Underworld

This week, Spotify prompted me to install Spotify Studio, a new AI-powered tool from Spotify. As I’ve been experimenting with the Spotify API over the past few weeks, I couldn’t resist trying it out. I may write more about those experiments in a future post.

Spotify Studio is a useful tool for analysing your Spotify library, playlists, and listening history. It can even generate simple web pages to present the results. I’ll share more about it in another post.

While exploring the tool, I noticed it was running the following command to retrieve my listening history:

"$SPOTIFY_CLI_PATH" history recent --limit 50 --format json

Did this mean there is a (undocumented) Spotify CLI tool bundled with the Spotify desktop app?

I opened a terminal, and indeed, there is a command-line tool included with the Spotify desktop app. On macOS, it can be found at this location:

/Applications/Spotify.app/Contents/MacOS/spotify_cli

It supports a lot of options. Besides controlling the desktop player from the command line, you can search your Spotify library, inspect your listening history, view your current playback status and much more.

I asked Claude to generate a simple visualisation from the JSON output of my listening history. This was the result.

Spotify listening history dashboard showing activity from 2 July to 23 July. The user played 750 unique tracks by 349 artists over 81.2 hours. A line chart shows daily listening time with several peaks throughout the month. The most-played artist is Robert Johnson (39 plays), followed by Blood Sucking Maniacs, Terry Allen, Wet Leg, and Sef. The top tracks list consists entirely of Robert Johnson recordings.

Continuation of the Spotify listening history dashboard. Top genres include country, indie, indie rock, americana, rock, electronic, country blues, singer-songwriter, folk, and blues. Most music played was released in the 2020s, with smaller amounts from earlier decades. A weekly heatmap shows listening concentrated on weekday mornings and afternoons. A recent listening list displays several Robert Johnson songs played within the last hour.

I find it fascinating that more desktop applications are shipping CLI tools that pair nicely with AI coding assistants. In many cases, it’s a much quicker way to automate or explore an application than setting up an API integration from scratch.

Is your mind already thinking about things you could make using this tool?

blogarc.millionpieces.nl · 5 images · 53 links

Comments (0)

No comments yet