LastFm
音乐
- 认证方式
- API Key
- HTTPS
- Yes
- CORS
- Unknown
- 分类
- 音乐
- 文档 / URL
- https://www.last.fm/api
简介
Last.fm API 提供音乐元数据——艺人、专辑、曲目和用户听歌记录。公开读取用 API 密钥;用户操作需要会话令牌。
注(2026-08 实测):无效密钥返回 HTTP 403 带
{"message":"Invalid API key...","error":10}——不是 401。请检查 JSON 里的error代码。
快速开始
艺人搜索(替换 YOUR_KEY):
curl "https://ws.audioscrobbler.com/2.0/?method=artist.search&artist=queen&api_key=YOUR_KEY&format=json"
{
"results": {
"artistmatches": {
"artist": [
{ "name": "Queen", "url": "https://www.last.fm/music/Queen", "image": [{ "#text": "https://..." }] }
]
}
}
}
热门曲目:
curl "https://ws.audioscrobbler.com/2.0/?method=chart.gettoptracks&api_key=YOUR_KEY&format=json"
认证方式
- 在 last.fm/api 注册 → 创建 API 账号 → API 密钥。
- 通过
api_key参数携带(JSON 用format=json)。 - 无效密钥 → 403 带
error: 10(已实测)。
速率限制与注意事项
- 免费:每密钥约 5 次请求/秒(看文档);读取无需付费。
- 方法:
artist.*、album.*、track.*、user.*、chart.*。 - 用户听歌记录需要认证流程得到的会话密钥。
常见问题
Last.fm API 免费吗? 是的——免费密钥带限流。
为什么 403 且 error 10?
无效 API 密钥返回 403 + error: 10(已实测)。
如何获取用户听歌记录?
认证流程给会话密钥,用于 user.* 方法。
音乐 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| 7digital Api of Music store 7digital | OAuth | Yes | Unknown | ↗ |
| AI Mastering Automated Music Mastering | API Key | Yes | Yes | ↗ |
| Audiomack Api of the streaming music hub Audiomack | OAuth | Yes | Unknown | ↗ |
| Bandcamp API of Music store Bandcamp | OAuth | Yes | Unknown | ↗ |
| Bandsintown Music Events | No auth | Yes | Unknown | ↗ |