Install
openclaw skills install lastfm-openclawAccess Last.fm user profile, now playing, top tracks/artists/albums by period, loved tracks, and optionally love/unlove tracks.
openclaw skills install lastfm-openclawRetrieves Last.fm user listening data including now playing, top tracks/artists/albums by time period, and loved tracks. Optionally supports write operations (love/unlove tracks, scrobble) when LASTFM_SESSION_KEY is configured.
LASTFM_API_KEY: Your Last.fm API key (get one at https://www.last.fm/api/account/create)LASTFM_USERNAME: Your Last.fm usernameLASTFM_SESSION_KEY: Required for write operations (love/unlove, scrobble)LASTFM_API_SECRET: Required to sign write operations (love/unlove, scrobble)jq, curl) are availablews.audioscrobbler.com/2.0/| Command | Description | Example |
|---|---|---|
now-playing, np | Current or most recent track | /lastfm np |
top-tracks [period] | Top tracks by period | /lastfm top-tracks 7day |
top-artists [period] | Top artists by period | /lastfm top-artists 1month |
top-albums [period] | Top albums by period | /lastfm top-albums overall |
loved | Loved tracks | /lastfm loved |
recent [limit] | Recent tracks (default 10) | /lastfm recent 20 |
profile | User profile info | /lastfm profile |
7day - Last 7 days1month - Last 30 days3month - Last 90 days6month - Last 180 days12month - Last yearoverall - All time (default if not specified)| Command | Description | Example |
|---|---|---|
love <artist> <track> | Love a track | /lastfm love "Radiohead" "Creep" |
unlove <artist> <track> | Unlove a track | /lastfm unlove "Radiohead" "Creep" |
Base URL: https://ws.audioscrobbler.com/2.0/
Required parameters for all requests:
api_key: Value from LASTFM_API_KEYformat: jsonmethod: API method nameUser-specific requests also require:
user: Value from LASTFM_USERNAME| Method | Additional Parameters |
|---|---|
user.getInfo | user |
user.getRecentTracks | user, limit (optional) |
user.getTopTracks | user, period (optional) |
user.getTopArtists | user, period (optional) |
user.getTopAlbums | user, period (optional) |
user.getLovedTracks | user |
track.love | artist, track, sk (session key) |
track.unlove | artist, track, sk (session key) |
Extract from recenttracks.track[0]:
@attr.nowplaying === "true": currently playingartist.#text - Artist namename - Track namealbum.#text - Album nameExtract array from:
toptracks.track[] for top trackstopartists.artist[] for top artiststopalbums.album[] for top albumsEach item includes:
name - Item nameplaycount - Play countartist.name - Artist (for tracks/albums)@attr.rank - Position in chartExtract from user:
name - Usernamerealname - Real name (if set)playcount - Total scrobblescountry - Countryregistered - Account creation dateurl - Profile URLLASTFM_SESSION_KEY not setws.audioscrobbler.com - no external endpointsrecent limit is numeric and within 1–200| Error Code | Meaning | Action |
|---|---|---|
| 10 | Invalid API key | Tell user to check LASTFM_API_KEY |
| 6 | Invalid parameters | Check required params are present |
| 29 | Rate limit exceeded | Wait and retry, inform user |
| 26 | Suspended API key | Direct user to Last.fm support |
| 4 | Authentication failed | Check session key for write ops |
🎵 Now Playing:
"Track Name" by Artist Name
from Album Name
Or if not currently playing:
🎵 Last Played:
"Track Name" by Artist Name
Listened: [timestamp]
🎵 Top Tracks (7 days):
1. "Track One" by Artist One (42 plays)
2. "Track Two" by Artist Two (38 plays)
3. "Track Three" by Artist Three (31 plays)
...
🎵 Last.fm Profile: username
📊 15,432 total scrobbles
🌍 United Kingdom
📅 Member since: Nov 2002
🔗 last.fm/user/username
~/.openclaw/openclaw.json:{
skills: {
entries: {
lastfm: {
enabled: true,
env: {
LASTFM_API_KEY: "your_api_key_here",
LASTFM_USERNAME: "your_username"
}
}
}
}
}
{baseDir}/references/auth-guide.md