OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  last-fm:访问 Last.fm 听歌记录与统计信息

last-fm:访问 Last.fm 听歌记录与统计信息

 
  migration ·  2026-02-26 12:48:05 · 2 次点击  · 0 条评论  
# OpenClaw-Last.fm
一个基于 Last.fm API 的 OpenClaw 技能

## 前置要求
- Last.fm API 密钥([前往官网获取](https://www.last.fm/api))

## 如何请求 API
- 根 URL:`https://ws.audioscrobbler.com/2.0/` (支持 GET/POST 方法)

### 必需参数
- `api_key`: API 密钥
- `method`: 方法名称
- `format`: 返回格式,默认为 XML,也可指定为 JSON

---

## 方法列表

以下按资源类型分类列出了 Last.fm 的常用方法。  
所有请求均使用相同的根 URL,并附加查询参数。

---

### 艺术家 (Artist)

#### `artist.getInfo`
获取指定艺术家的详细信息(简介、图片、统计数据、标签、相似艺术家等)。

**示例请求 (JSON 格式):**
```http
GET https://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Radiohead&api_key=你的API密钥&format=json

artist.getTopTracks

获取艺术家的热门曲目,按播放次数排序。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=artist.gettoptracks&artist=Radiohead&api_key=你的API密钥&format=json

artist.getTopAlbums

获取艺术家的热门专辑,按播放次数排序。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=artist.gettopalbums&artist=Radiohead&api_key=你的API密钥&format=json

artist.search

根据名称搜索艺术家,返回匹配的艺术家列表。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=artist.search&artist=Radiohead&api_key=你的API密钥&format=json

专辑 (Album)

album.getInfo

获取指定艺术家和专辑的元数据(曲目列表、标签、播放次数、封面等)。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=album.getinfo&artist=Radiohead&album=OK+Computer&api_key=你的API密钥&format=json

album.getTopTags

获取应用于指定专辑的热门标签。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=album.gettoptags&artist=Radiohead&album=OK+Computer&api_key=你的API密钥&format=json

album.search

根据名称搜索专辑,返回可能的匹配结果。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=album.search&album=OK+Computer&api_key=你的API密钥&format=json

曲目 (Track)

track.getInfo

获取曲目的详细元数据,包括所属专辑、时长、听众数、播放次数和维基简介(如有)。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=track.getinfo&artist=Radiohead&track=Karma+Police&api_key=你的API密钥&format=json

track.getTopTags

获取指定曲目的热门标签。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=track.gettoptags&artist=Radiohead&track=Karma+Police&api_key=你的API密钥&format=json

track.search

根据名称(可选艺术家)搜索曲目,返回匹配列表。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=track.search&track=Karma+Police&api_key=你的API密钥&format=json

用户 (User)

user.getInfo

获取用户的个人资料信息(播放次数、国家、年龄(若公开)、头像等)。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=用户名&api_key=你的API密钥&format=json

user.getRecentTracks

获取用户最近播放的曲目列表,包含时间戳和“正在播放”状态。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=用户名&limit=20&api_key=你的API密钥&format=json

user.getTopArtists

获取用户在特定时间段内的热门艺术家(可选时间段:overall, 7day, 1month, 3month, 6month, 12month)。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=用户名&period=1month&limit=20&api_key=你的API密钥&format=json

user.getTopTracks

获取用户在选定时间段内的热门曲目。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=用户名&period=3month&limit=20&api_key=你的API密钥&format=json

音乐库 (Library)

library.getArtists

获取用户音乐库中所有艺术家的分页列表,包含播放次数和标签数量。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=library.getartists&user=用户名&limit=10&page=1&api_key=你的API密钥&format=json

library.getAlbums

获取用户音乐库中的专辑,可按艺术家筛选。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=library.getalbums&user=用户名&limit=10&page=1&api_key=你的API密钥&format=json

library.getTracks

获取用户音乐库中的曲目及其播放次数。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=library.gettracks&user=用户名&limit=10&page=1&api_key=你的API密钥&format=json

排行榜 (Chart)

chart.getTopArtists

获取 Last.fm 的全球热门艺术家排行榜。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=chart.gettopartists&api_key=你的API密钥&format=json

chart.getTopTracks

获取全球热门曲目排行榜。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=chart.gettoptracks&api_key=你的API密钥&format=json

chart.getTopTags

获取全球热门标签排行榜。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=chart.gettoptags&api_key=你的API密钥&format=json

标签 (Tag)

tag.getInfo

获取标签的元数据(描述、覆盖范围、总使用次数等)。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=tag.getinfo&tag=k-pop&api_key=你的API密钥&format=json

tag.getTopArtists

获取与特定标签关联的热门艺术家。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=tag.gettopartists&tag=k-pop&api_key=你的API密钥&format=json

tag.getTopTracks

获取与标签关联的热门曲目。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=tag.gettoptracks&tag=k-pop&api_key=你的API密钥&format=json

tag.getTopAlbums

获取与标签关联的热门专辑。

示例请求:

GET https://ws.audioscrobbler.com/2.0/?method=tag.gettopalbums&tag=k-pop&api_key=你的API密钥&format=json

2 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor