Loading...
Loading...
Interact with the Last.fm music data API: lookup user listening history, get artist/album/track metadata, discover similar music via collaborative filtering, explore global and per-country charts, search by artist/album/track, manage tags, and scrobble listening events. Use when the user asks about music data, listening statistics, music recommendations, similar artists, charts, or wants to scrobble or love tracks. Do not use this skill for unrelated requests; route to the nearest named specialist.
npx skill4agent add magnus919/agent-skills lastfmexport LASTFM_API_KEY="your_api_key_here"
# For write operations only:
export LASTFM_API_SECRET="your_api_secret"
export LASTFM_SESSION_KEY="your_session_key"LASTFM_USERNAME<username>lastfm-cli user info <username> # Profile + stats
lastfm-cli user recent-tracks <username> --limit 10 # Recent listening
lastfm-cli user top-artists <username> --period 7day # Weekly top artists
lastfm-cli user top-tracks <username> --period overall # All-time faves
lastfm-cli user loved-tracks <username> # Loved tracks
lastfm-cli user friends <username> # Social graph
lastfm-cli user weekly-charts <username> # Available chart periodslastfm-cli artist similar <artist> --limit 10 # Taste graph neighbors
lastfm-cli artist info <artist> # Bio, stats, tags
lastfm-cli artist top-tracks <artist> # Their most popular
lastfm-cli track similar <artist> "<track>" # Track-level similarity
lastfm-cli album info <artist> "<album>" # Tracklist, metadata
lastfm-cli tag top-artists <tag> # Genre browsinglastfm-cli chart top-artists --limit 20 # Global
lastfm-cli geo top-artists "Japan" --limit 20 # Per-country
lastfm-cli geo top-tracks "Germany" --limit 20
lastfm-cli tag top-tracks "electronic" --limit 15 # By genre taglastfm-cli artist search "Radiohead" # Find by name
lastfm-cli album search "OK Computer" # Find albums
lastfm-cli track search "Karma Police" # Find trackslastfm-cli track scrobble "Artist" "Song" --album "Album"
lastfm-cli track now-playing "Artist" "Song"
lastfm-cli track love "Artist" "Song"# 1. Get a token
lastfm-cli auth get-token
# 2. User visits: https://www.last.fm/api/auth/?api_key=KEY&token=TOKEN
# 3. Exchange for session key
lastfm-cli auth get-session <token>
# → Set export LASTFM_SESSION_KEY=<key>references/auth-flow.mdlastfm-cli user top-artists <username> --period 1month --limit 5 --json
lastfm-cli user top-tracks <username> --period 1month --limit 10 --json
lastfm-cli user loved-tracks <username> --jsonlastfm-cli artist similar "<artist>" --limit 5 --jsonlastfm-cli track similar "<artist>" "<track>" --limit 5 --json# Pipe to jq for structured queries
lastfm-cli artist similar "Radiohead" --limit 5 --json | jq '.similarartists.artist[] | {name, match}'
# Get a user's all-time top artists with playcounts
lastfm-cli user top-artists <username> --period overall --limit 3 --json | jq '.topartists.artist[] | {name, playcount}'
# Find most popular tracks by a genre
lastfm-cli tag top-tracks "electronic" --limit 10 --json | jq '.tracks.track[] | {name, artist: .artist.name, listeners}'lastfm-cli/1.0 (hermes-agent)format=json--autocorrectartist.getSimilar--from--to2026-05-27overall7day1month3month6month12month| Script | Purpose | Invocation |
|---|---|---|
| The CLI tool this skill drives: read-only queries (user info/recent-tracks/top-artists/top-tracks/loved-tracks/friends/weekly-charts), discovery ( | |
| Shell test suite covering the CLI's argument handling and output formatting without network calls. Run it after modifying | |
LASTFM_API_KEYLASTFM_API_SECRETreferences/auth-flow.mdLASTFM_SESSION_KEYpython3 scripts/lastfm-cli ...lastfm-cliLASTFM_USERNAMEjq--jsonoverall7day1month3month6month12month--from--to--autocorrect