Agent skill · magnus919

lastfm

Interact with the Last.fm music data API: lookup user listening history,

What it needs

About 4k tokens when loaded.

What this skill does

Last.fm Setup Get an API key at https://www.last.fm/api/account/create (free, requires a Last.fm account). Essential Commands User queries — "what am I listening to" Configurable via LASTFMUSERNAME env var. Defaults to <username> if unset. Music Discovery — "what's similar to X" Charts — "what's popular" Search — "find that thing" Write operations (require session auth) Auth flow (one-time setup) Reference Files references/auth-flow.md — Full walkthrough for setting up write operation auth (scrobble, love, now-playing). Read this before attempting write operations. Music Discovery Pipeline — "find me new stuff I'll like" The core flow for turning liked tracks into recommendations: 1. Get user's top artists/tracks from Last.fm: 2. For each artist, find similar artists via Last.fm's collaborative filtering: 3. For each track, find similar tracks for more granular recommendations: 4. Cross-reference against what they've already scrobbled (recent-tracks) to filter out already-heard material. 5. Check against the user's own collection (via Radarr/Sonarr/jellyfin-cli or Spotify library) to see what's already in the library vs genuinely new discovery. Using with --json for Machine Processing Known Gotchas API key required for EVERY request. The key is free — get one at the Last.fm API account page. Rate limit is ~5 req/sec sustained. The API docs say "be reasonable" — if you're making several calls per second continuously, your account may be suspended. Add small delays in loops. User-Agent header matters. The CLI sends lastfm-cli/1.0 (hermes-agent). Last.fm's docs explicitly ask for an identifiable User-Agent. XML is the default response format. The CLI requests format=json. Without it, responses come back as XML. Artist names can be misspelled. Use --autocorrect flag on artist commands to let Last.fm correct misspellings. Write operations need auth setup. scrobble, love, and now-playing require a full auth flow (token → session key). Read-only endpoints don't. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills magnus919/lastfm

View the source on GitHub

Browse the @skills marketplace