简介
Last.fm官方API接口,可查询艺人、专辑、曲目元数据及用户听歌记录、排行榜等音乐数据,需自备API Key
原始描述
Provides detailed music data and user info from Last.fm, including artists, albums, tracks, charts, tags, and user listening stats via Last.fm API.
中文使用说明 来自收录源
OpenClaw-Last.fm 技能评估
核心用法
本技能为Last.fm音乐数据平台的标准化API封装,提供RESTful接口访问Last.fm海量音乐数据库。核心功能覆盖五大维度:
- 艺人/专辑/曲目元数据查询:获取详细资料、封面、标签、播放量统计等
- 用户音乐档案:读取公开用户的听歌历史、最爱艺人/曲目、曲库统计
- 全球排行榜:查看热门艺人、曲目、标签的实时趋势
- 搜索发现:支持模糊搜索艺人、专辑、曲目名称
- 标签探索:按音乐风格标签发现相关内容
所有请求通过统一入口https://ws.audioscrobbler.com/2.0/发送,支持JSON/XML格式返回,采用标准GET/POST方法。
显著优点
- 数据源权威:Last.fm运营超20年,拥有全球最大的用户贡献音乐数据库之一,元数据质量高
- 覆盖面广:涵盖主流及小众音乐,支持多语言艺人名搜索
- 用户数据丰富:可获取详细的个人听歌行为分析(需用户公开权限)
- 免费基础额度:个人非商业使用免费,适合爱好者开发
- 响应稳定:官方CDN分发,API可用性良好
潜在缺点与局限性
- API Key强制要求:必须注册获取Key,增加了使用门槛
- 速率限制严格:免费Key限制为每秒5次请求,高频场景需缓存策略
- 数据完整度参差:小众/新发行内容可能存在信息缺失
- 无音频流服务:仅提供元数据,不支持音乐播放
- 用户隐私限制:大量用户数据设为隐私不可见
- 商业使用受限:免费Key禁止商业应用,需购买商业授权
适合人群
- 音乐数据分析师、数据可视化开发者
- 个人音乐推荐系统搭建者
- 音乐爱好者制作听歌报告、年度总结
- 学术研究者进行音乐流行趋势分析
- 需要音乐元数据补全的媒体库管理工具开发者
常规风险
- API Key泄露风险:Key硬编码或日志泄露可能导致配额被滥用
- 数据时效性:用户听歌记录非实时,通常有几分钟延迟
- 依赖单点故障:Last.fm服务变更或关闭将直接影响功能
- 版权合规:抓取数据需遵守Last.fm Terms of Use,禁止大规模爬取
- 隐私合规:处理用户数据时需符合GDPR等法规要求
技能正文
# OpenClaw-Last.fm
A openclaw Skill with Last.fm API
## Requirements
- Last.fm API Key ([Get in website](https://www.last.fm/api))
## How to request API
- Root URL: `https://ws.audioscrobbler.com/2.0/` (GET/POST)
### Required parameters
- `api_key`: API Key
- `method`: Method name
- `format`: XML (default) or JSON
---
## Methods
Below are commonly used Last.fm methods grouped by resource type.
All requests use the same base URL and append query parameters.
---
### Artist
#### `artist.getInfo`
Get detailed information about a specific artist (bio, images, stats, tags, similar artists, etc.).
**Example request (JSON):**
```http
GET https://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Radiohead&api_key=YOUR_API_KEY&format=json
artist.getTopTracks
Get the top tracks for an artist, ordered by playcount.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=artist.gettoptracks&artist=Radiohead&api_key=YOUR_API_KEY&format=json
artist.getTopAlbums
Get the top albums for an artist, ordered by playcount.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=artist.gettopalbums&artist=Radiohead&api_key=YOUR_API_KEY&format=json
artist.search
Search for artists by name and get a list of matching artists.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=artist.search&artist=Radiohead&api_key=YOUR_API_KEY&format=json
Album
album.getInfo
Get album metadata (tracks, tags, playcount, cover art, etc.) for a given artist and album.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=album.getinfo&artist=Radiohead&album=OK+Computer&api_key=YOUR_API_KEY&format=json
album.getTopTags
Get the most popular tags applied to a specific album.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=album.gettoptags&artist=Radiohead&album=OK+Computer&api_key=YOUR_API_KEY&format=json
album.search
Search for albums by name and get possible matches.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=album.search&album=OK+Computer&api_key=YOUR_API_KEY&format=json
Track
track.getInfo
Get detailed metadata for a track, including album, duration, listeners, playcount, and wiki (if available).
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=track.getinfo&artist=Radiohead&track=Karma+Police&api_key=YOUR_API_KEY&format=json
track.getTopTags
Get the most popular tags for a given track.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=track.gettoptags&artist=Radiohead&track=Karma+Police&api_key=YOUR_API_KEY&format=json
track.search
Search for tracks by name (and optionally by artist) and get a list of matches.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=track.search&track=Karma+Police&api_key=YOUR_API_KEY&format=json
User
user.getInfo
Get profile information about a user (playcount, country, age (if public), images, etc.).
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=someusername&api_key=YOUR_API_KEY&format=json
user.getRecentTracks
Get the list of recently scrobbled tracks by a user, including timestamps and “now playing” status.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=someusername&limit=20&api_key=YOUR_API_KEY&format=json
user.getTopArtists
Get a user’s top artists over a specific period (overall, 7day, 1month, 3month, 6month, 12month).
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=someusername&period=1month&limit=20&api_key=YOUR_API_KEY&format=json
user.getTopTracks
Get a user’s top tracks over a selected period.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=someusername&period=3month&limit=20&api_key=YOUR_API_KEY&format=json
Library
library.getArtists
Get a paginated list of all artists in a user’s library with play counts and tag counts.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=library.getartists&user=someusername&limit=10&page=1&api_key=YOUR_API_KEY&format=json
library.getAlbums
Get albums from a user’s library, optionally filtered by artist.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=library.getalbums&user=someusername&limit=10&page=1&api_key=YOUR_API_KEY&format=json
library.getTracks
Get tracks from a user’s library with their play counts.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=library.gettracks&user=someusername&limit=10&page=1&api_key=YOUR_API_KEY&format=json
Chart
chart.getTopArtists
Get the global top artists chart on Last.fm.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=chart.gettopartists&api_key=YOUR_API_KEY&format=json
chart.getTopTracks
Get the global top tracks chart.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=chart.gettoptracks&api_key=YOUR_API_KEY&format=json
chart.getTopTags
Get the global top tags chart.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=chart.gettoptags&api_key=YOUR_API_KEY&format=json
Tag
tag.getInfo
Get metadata for a tag (description, reach, total uses, etc.).
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=tag.getinfo&tag=k-pop&api_key=YOUR_API_KEY&format=json
tag.getTopArtists
Get top artists associated with a specific tag.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=tag.gettopartists&tag=k-pop&api_key=YOUR_API_KEY&format=json
tag.getTopTracks
Get top tracks associated with a tag.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=tag.gettoptracks&tag=k-pop&api_key=YOUR_API_KEY&format=json
tag.getTopAlbums
Get top albums associated with a tag.
Example request:
GET https://ws.audioscrobbler.com/2.0/?method=tag.gettopalbums&tag=k-pop&api_key=YOUR_API_KEY&format=json
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。
其他来源收录
同一技能在不同目录的原始页面: