lastfmAccess Last.fm listening history, music stats, and discovery. Query recent tracks, top artists/albums/tracks, loved tracks, similar artists, and global charts.
Install via ClawdBot CLI:
clawdbot install gumadeiras/lastfmAccess Last.fm listening history, music stats, and discovery.
Required env vars (add to your shell profile or optionally ~/.clawdbot/.env):
LASTFM_API_KEY β your Last.fm API key (get one here)LASTFM_USER β your Last.fm usernameBase URL: http://ws.audioscrobbler.com/2.0/
Docs: https://lastfm-docs.github.io/api-docs/
Here's what 17+ years of scrobbling looks like:
Total scrobbles: 519,778
Unique artists: 13,763
Unique tracks: 68,435
Unique albums: 33,637
Top Artists (all time):
β’ System of a Down (52,775 plays)
β’ Eminem (15,400 plays)
β’ Dashboard Confessional (10,166 plays)
β’ Edguy (10,161 plays)
β’ Metallica (9,927 plays)
Top Tracks (all time):
β’ System of a Down - Aerials (1,405 plays)
β’ System of a Down - Toxicity (1,215 plays)
β’ System of a Down - Sugar (1,149 plays)
β’ System of a Down - Chop Suey (1,116 plays)
β’ System of a Down - Prison Song (1,102 plays)
All requests use GET with these base params:
?api_key=$LASTFM_API_KEY&format=json&user=$LASTFM_USER
curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json&limit=10"
@attr.nowplaying=true is currently playingcurl -s "http://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json"
curl -s "http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json&period=7day&limit=10"
period: overall | 7day | 1month | 3month | 6month | 12monthcurl -s "http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json&period=7day&limit=10"
curl -s "http://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json&period=7day&limit=10"
curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getlovedtracks&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json&limit=10"
# Weekly artist chart
curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getweeklyartistchart&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json"
# Weekly track chart
curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getweeklytrackchart&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json"
# Weekly album chart
curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getweeklyalbumchart&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json"
curl -s "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Tame+Impala&api_key=$LASTFM_API_KEY&format=json&username=$LASTFM_USER"
username includes user's playcount for that artistcurl -s "http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist=Tame+Impala&api_key=$LASTFM_API_KEY&format=json&limit=10"
curl -s "http://ws.audioscrobbler.com/2.0/?method=artist.gettoptracks&artist=Tame+Impala&api_key=$LASTFM_API_KEY&format=json&limit=10"
curl -s "http://ws.audioscrobbler.com/2.0/?method=track.getinfo&artist=Tame+Impala&track=The+Less+I+Know+The+Better&api_key=$LASTFM_API_KEY&format=json&username=$LASTFM_USER"
curl -s "http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=Tame+Impala&track=Elephant&api_key=$LASTFM_API_KEY&format=json&limit=10"
curl -s "http://ws.audioscrobbler.com/2.0/?method=album.getinfo&artist=Tame+Impala&album=Currents&api_key=$LASTFM_API_KEY&format=json&username=$LASTFM_USER"
curl -s "http://ws.audioscrobbler.com/2.0/?method=artist.search&artist=tame&api_key=$LASTFM_API_KEY&format=json&limit=5"
curl -s "http://ws.audioscrobbler.com/2.0/?method=track.search&track=elephant&api_key=$LASTFM_API_KEY&format=json&limit=5"
curl -s "http://ws.audioscrobbler.com/2.0/?method=album.search&album=currents&api_key=$LASTFM_API_KEY&format=json&limit=5"
# Top artists globally
curl -s "http://ws.audioscrobbler.com/2.0/?method=chart.gettopartists&api_key=$LASTFM_API_KEY&format=json&limit=10"
# Top tracks globally
curl -s "http://ws.audioscrobbler.com/2.0/?method=chart.gettoptracks&api_key=$LASTFM_API_KEY&format=json&limit=10"
# Top albums for a tag/genre
curl -s "http://ws.audioscrobbler.com/2.0/?method=tag.gettopalbums&tag=psychedelic&api_key=$LASTFM_API_KEY&format=json&limit=10"
# Top artists for a tag
curl -s "http://ws.audioscrobbler.com/2.0/?method=tag.gettopartists&tag=brazilian&api_key=$LASTFM_API_KEY&format=json&limit=10"
For JSON processing, see the jq skill on ClawdHub.
# Recent tracks: artist - track
jq '.recenttracks.track[] | "\(.artist["#text"]) - \(.name)"'
# Top artists: name (playcount)
jq '.topartists.artist[] | "\(.name) (\(.playcount))"'
# Check if currently playing
jq '.recenttracks.track[0] | if .["@attr"].nowplaying == "true" then "Now playing: \(.artist["#text"]) - \(.name)" else "Last played: \(.artist["#text"]) - \(.name)" end'
+ or %20)Generated Mar 1, 2026
Music enthusiasts can create a personal dashboard to visualize their listening habits over time, track favorite artists, and discover new music based on their history. This can be integrated into personal blogs or social media profiles to share music tastes with friends.
Streaming platforms or music apps can use this skill to enhance recommendation engines by analyzing user listening history from Last.fm. It helps suggest similar artists, tracks, and albums, improving user engagement and retention.
Record labels and artist managers can monitor fan engagement by tracking play counts, top tracks, and similar artists for their signed artists. This data aids in marketing strategies, tour planning, and identifying emerging trends.
Developers can build social apps where users connect and share their recent tracks, top artists, and loved tracks from Last.fm. This fosters community interaction and music discovery through peer recommendations.
Researchers and data analysts can utilize this skill to study global music charts, tag-based trends, and user listening patterns over time. This supports projects in cultural studies, sociology, or market analysis.
Offer a free basic dashboard for personal use with limited data, and charge for advanced analytics, historical trends, and export features. Revenue comes from subscription tiers targeting serious music fans and professionals.
Provide consulting and development services to integrate Last.fm data into existing music apps, websites, or IoT devices. Charge per project or ongoing support fees for customized solutions.
Build a free app or website that uses Last.fm data to recommend music and display targeted ads based on user listening habits. Revenue is generated through ad placements and affiliate links to streaming services.
π¬ Integration Tip
Ensure environment variables for API key and username are securely set, and use jq filters for efficient JSON parsing in automated workflows.
Terminal Spotify playback/search via spogo (preferred) or spotify_player.
Search GIF providers with CLI/TUI, download results, and extract stills/sheets.
Download videos from YouTube, Bilibili, Twitter, and thousands of other sites using yt-dlp. Use when the user provides a video URL and wants to download it, extract audio (MP3), download subtitles, or select video quality. Triggers on phrases like "δΈθ½½θ§ι’", "download video", "yt-dlp", "YouTube", "Bη«", "ζι³", "ζει³ι’", "extract audio".
Search and add movies to Radarr. Supports collections, search-on-add option.
Control Spotify playback on macOS. Play/pause, skip tracks, control volume, play artists/albums/playlists. Use when a user asks to play music, control Spotify, change songs, or adjust Spotify volume.
Search and add TV shows to Sonarr. Supports monitor options, search-on-add.