← 返回 Skills 市场
gumadeiras

Last.fm

作者 Gustavo Madeira Santana · GitHub ↗ · v1.0.2
cross-platform ⚠ suspicious
2526
总下载
2
收藏
6
当前安装
3
版本数
在 OpenClaw 中安装
/install lastfm
功能描述
Access Last.fm listening history, music stats, and discovery. Query recent tracks, top artists/albums/tracks, loved tracks, similar artists, and global charts.
使用说明 (SKILL.md)

Last.fm API Skill

Access Last.fm listening history, music stats, and discovery.

Configuration

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 username

Base URL: http://ws.audioscrobbler.com/2.0/
Docs: https://lastfm-docs.github.io/api-docs/

Example Output

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)

Quick Reference

All requests use GET with these base params:

?api_key=$LASTFM_API_KEY&format=json&user=$LASTFM_USER

User Endpoints

Recent Tracks (what's playing / recently played)

curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json&limit=10"
  • First track with @attr.nowplaying=true is currently playing
  • Returns: artist, track name, album, timestamp, images

User Info (profile stats)

curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json"
  • Returns: playcount, artist_count, track_count, album_count, registered date

Top Artists

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 | 12month

Top Albums

curl -s "http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json&period=7day&limit=10"

Top Tracks

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"

Loved Tracks

curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getlovedtracks&user=$LASTFM_USER&api_key=$LASTFM_API_KEY&format=json&limit=10"

Weekly Charts

# 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"

Artist/Track/Album Info

Artist Info

curl -s "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Tame+Impala&api_key=$LASTFM_API_KEY&format=json&username=$LASTFM_USER"
  • Adding username includes user's playcount for that artist

Similar Artists

curl -s "http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist=Tame+Impala&api_key=$LASTFM_API_KEY&format=json&limit=10"

Artist Top Tracks

curl -s "http://ws.audioscrobbler.com/2.0/?method=artist.gettoptracks&artist=Tame+Impala&api_key=$LASTFM_API_KEY&format=json&limit=10"

Track Info

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"

Similar Tracks

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"

Album Info

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"

Search

Search Artists

curl -s "http://ws.audioscrobbler.com/2.0/?method=artist.search&artist=tame&api_key=$LASTFM_API_KEY&format=json&limit=5"

Search Tracks

curl -s "http://ws.audioscrobbler.com/2.0/?method=track.search&track=elephant&api_key=$LASTFM_API_KEY&format=json&limit=5"

Search Albums

curl -s "http://ws.audioscrobbler.com/2.0/?method=album.search&album=currents&api_key=$LASTFM_API_KEY&format=json&limit=5"

Charts (Global)

# 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"

Tags

# 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"

Useful jq Filters

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'

Notes

  • No auth needed for read-only endpoints (just API key)
  • Rate limit: be reasonable, no hard limit documented
  • URL-encode artist/track/album names (spaces → + or %20)
  • Images come in sizes: small, medium, large, extralarge
安全使用建议
This skill appears to be a simple Last.fm read-only client, but the package metadata does not list the environment variables the SKILL.md requires. Before installing: (1) confirm the skill's source or homepage (none provided) and prefer skills from known authors; (2) treat LASTFM_API_KEY as a secret — store it in a secure secrets store or the agent's credential manager rather than a world-readable ~/.clawdbot/.env file; (3) verify the skill's registry entry is updated to declare LASTFM_API_KEY as the primary credential and LASTFM_USER as required; (4) note the SKILL.md uses http:// for the base URL — prefer https:// when making API calls; and (5) if you need higher assurance, ask the publisher for a link to source code or a checksum of the SKILL.md so you can inspect changes. The present issues look like sloppy metadata/documentation rather than overtly malicious behavior, but the metadata/instruction mismatch is material and should be resolved before trusting the skill with your API key.
功能分析
Type: OpenClaw Skill Name: lastfm Version: 1.0.2 The skill is benign. It provides instructions and `curl` commands to interact with the legitimate Last.fm API (`http://ws.audioscrobbler.com/2.0/`). It requires `LASTFM_API_KEY` and `LASTFM_USER` environment variables, which is standard for API access. There is no evidence of prompt injection attempts against the agent, malicious execution, data exfiltration to unauthorized endpoints, or any other high-risk behaviors in `SKILL.md`.
能力评估
Purpose & Capability
The SKILL.md implements a straightforward Last.fm read-only client (calls to user.getrecenttracks, gettopartists, chart endpoints, etc.), which aligns with the skill name/description. However, the registry metadata lists no required env vars or primary credential while the SKILL.md clearly requires LASTFM_API_KEY and LASTFM_USER — an inconsistency between description and declared requirements.
Instruction Scope
The instructions tell the agent to read two environment variables and optionally a ~/.clawdbot/.env file (for API key and username). That is expected for an API client, but SKILL.md also contains a contradictory line ('No auth needed for read-only end') despite listing LASTFM_API_KEY as required. The SKILL.md otherwise only issues GET requests to Last.fm endpoints (via curl) and JSON-processing tips — it does not request unrelated files or credentials.
Install Mechanism
This is an instruction-only skill with no install spec and no code files; nothing is written to disk by an installer. That is the lowest-risk install mechanism.
Credentials
The only secrets the SKILL.md asks for are LASTFM_API_KEY and LASTFM_USER — appropriate and proportionate for a Last.fm client. The problem is the registry metadata does not declare these environment variables (or a primaryEnv), so the platform-level declaration and the runtime instructions disagree.
Persistence & Privilege
The skill does not request always:true, does not include an install that modifies other skills or system-wide settings, and is user-invocable only. There are no elevated persistence or privilege requests in the package.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install lastfm
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /lastfm 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
Added description/summary in frontmatter
v1.0.1
Fix: Clarified env var configuration - shell profile or .env
v1.0.0
Initial release: Last.fm API skill for listening history, stats, and music discovery
元数据
Slug lastfm
版本 1.0.2
许可证
累计安装 6
当前安装数 6
历史版本数 3
常见问题

Last.fm 是什么?

Access Last.fm listening history, music stats, and discovery. Query recent tracks, top artists/albums/tracks, loved tracks, similar artists, and global charts. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2526 次。

如何安装 Last.fm?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install lastfm」即可一键安装,无需额外配置。

Last.fm 是免费的吗?

是的,Last.fm 完全免费(开源免费),可自由下载、安装和使用。

Last.fm 支持哪些平台?

Last.fm 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Last.fm?

由 Gustavo Madeira Santana(@gumadeiras)开发并维护,当前版本 v1.0.2。

💬 留言讨论