返回顶部
l

lastfmLast.fm数据查询

Access Last.fm listening history, music stats, and discovery. Query recent tracks, top artists/albums/tracks, loved tracks, similar artists, and global charts.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.2
安全检测
已通过
2,485
下载量
免费
免费
2
收藏
概述
安装方式
版本历史

lastfm

Last.fm API 技能

访问 Last.fm 收听历史、音乐统计和发现。

配置

所需环境变量(添加到您的 shell 配置文件或可选地添加到 ~/.clawdbot/.env):

  • - LASTFMAPIKEY — 您的 Last.fm API 密钥(在此获取
  • LASTFMUSER — 您的 Last.fm 用户名

基础 URL:http://ws.audioscrobbler.com/2.0/
文档:https://lastfm-docs.github.io/api-docs/

示例输出

以下是 17 年以上的收听记录示例:

总收听次数:519,778
独特艺术家:13,763
独特曲目:68,435
独特专辑:33,637

热门艺术家(全部时间):
• System of a Down(52,775 次播放)
• Eminem(15,400 次播放)
• Dashboard Confessional(10,166 次播放)
• Edguy(10,161 次播放)
• Metallica(9,927 次播放)

热门曲目(全部时间):
• System of a Down - Aerials(1,405 次播放)
• System of a Down - Toxicity(1,215 次播放)
• System of a Down - Sugar(1,149 次播放)
• System of a Down - Chop Suey(1,116 次播放)
• System of a Down - Prison Song(1,102 次播放)

快速参考

所有请求均使用 GET 方法,并包含以下基础参数:

?apikey=$LASTFMAPIKEY&format=json&user=$LASTFMUSER

用户端点

最近曲目(正在播放/最近播放)

bash curl -s http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$LASTFMUSER&apikey=$LASTFMAPIKEY&format=json&limit=10
  • - 第一个带有 @attr.nowplaying=true 的曲目为当前正在播放
  • 返回:艺术家、曲目名称、专辑、时间戳、图片

用户信息(个人资料统计)

bash curl -s http://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=$LASTFMUSER&apikey=$LASTFMAPIKEY&format=json
  • - 返回:播放次数、艺术家数量、曲目数量、专辑数量、注册日期

热门艺术家

bash curl -s http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=$LASTFMUSER&apikey=$LASTFMAPIKEY&format=json&period=7day&limit=10
  • - period:overall | 7day | 1month | 3month | 6month | 12month

热门专辑

bash curl -s http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=$LASTFMUSER&apikey=$LASTFMAPIKEY&format=json&period=7day&limit=10

热门曲目

bash curl -s http://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=$LASTFMUSER&apikey=$LASTFMAPIKEY&format=json&period=7day&limit=10

喜爱的曲目

bash curl -s http://ws.audioscrobbler.com/2.0/?method=user.getlovedtracks&user=$LASTFMUSER&apikey=$LASTFMAPIKEY&format=json&limit=10

每周排行榜

bash

每周艺术家排行榜

curl -s http://ws.audioscrobbler.com/2.0/?method=user.getweeklyartistchart&user=$LASTFMUSER&apikey=$LASTFMAPIKEY&format=json

每周曲目排行榜

curl -s http://ws.audioscrobbler.com/2.0/?method=user.getweeklytrackchart&user=$LASTFMUSER&apikey=$LASTFMAPIKEY&format=json

每周专辑排行榜

curl -s http://ws.audioscrobbler.com/2.0/?method=user.getweeklyalbumchart&user=$LASTFMUSER&apikey=$LASTFMAPIKEY&format=json

艺术家/曲目/专辑信息

艺术家信息

bash curl -s http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Tame+Impala&apikey=$LASTFMAPIKEY&format=json&username=$LASTFMUSER
  • - 添加 username 参数可包含该艺术家的用户播放次数

相似艺术家

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

艺术家热门曲目

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

曲目信息

bash curl -s http://ws.audioscrobbler.com/2.0/?method=track.getinfo&artist=Tame+Impala&track=The+Less+I+Know+The+Better&apikey=$LASTFMAPIKEY&format=json&username=$LASTFMUSER

相似曲目

bash curl -s http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=Tame+Impala&track=Elephant&apikey=$LASTFMAPI_KEY&format=json&limit=10

专辑信息

bash curl -s http://ws.audioscrobbler.com/2.0/?method=album.getinfo&artist=Tame+Impala&album=Currents&apikey=$LASTFMAPIKEY&format=json&username=$LASTFMUSER

搜索

搜索艺术家

bash curl -s http://ws.audioscrobbler.com/2.0/?method=artist.search&artist=tame&apikey=$LASTFMAPI_KEY&format=json&limit=5

搜索曲目

bash curl -s http://ws.audioscrobbler.com/2.0/?method=track.search&track=elephant&apikey=$LASTFMAPI_KEY&format=json&limit=5

搜索专辑

bash curl -s http://ws.audioscrobbler.com/2.0/?method=album.search&album=currents&apikey=$LASTFMAPI_KEY&format=json&limit=5

排行榜(全局)

bash

全局热门艺术家


curl -s http://ws.audioscrobbler.com/2.0/?method=chart.gettopartists&apikey=$LASTFMAPI_KEY&format=json&limit=10

全局热门曲目

curl -s http://ws.audioscrobbler.com/2.0/?method=chart.gettoptracks&apikey=$LASTFMAPI_KEY&format=json&limit=10

标签

bash

标签/流派的热门专辑


curl -s http://ws.audioscrobbler.com/2.0/?method=tag.gettopalbums&tag=psychedelic&apikey=$LASTFMAPI_KEY&format=json&limit=10

标签的热门艺术家

curl -s http://ws.audioscrobbler.com/2.0/?method=tag.gettopartists&tag=brazilian&apikey=$LASTFMAPI_KEY&format=json&limit=10

实用的 jq 过滤器

有关 JSON 处理,请参阅 ClawdHub 上的 jq 技能

bash

最近曲目:艺术家 - 曲目


jq .recenttracks.track[] | \(.artist[#text]) - \(.name)

热门艺术家:名称(播放次数)

jq .topartists.artist[] | \(.name) (\(.playcount))

检查当前是否正在播放

jq .recenttracks.track[0] | if .[@attr].nowplaying == true then 正在播放:\(.artist[#text]) - \(.name) else 最近播放:\(.artist[#text]) - \(.name) end

注意事项

  • - 只读端点无需身份

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 lastfm-1776362359 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 lastfm-1776362359 技能

通过命令行安装

skillhub install lastfm-1776362359

下载

⬇ 下载 lastfm v1.0.2(免费)

文件大小: 2.3 KB | 发布时间: 2026-4-17 14:20

v1.0.2 最新 2026-4-17 14:20
Added description/summary in frontmatter

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部