Navidrome 接口文档
备注
Navidrome 目前还没有官方的接口文档,以下均为抓包所得。
0.55.0 版本对原生接口进行了重大重构,以下内容部分已经过时。
认证
login 登录
POST:[host]/auth/login
body(application/json
):
参数名 | 是否必填 | 默认值 | 备注 |
---|---|---|---|
username | Y | 用户名 | |
password | Y | 密码 |
响应内容:
{
"id": "34c4xxxx-xxxx-xxxx-xxxx-6442b9a3xxxx",
"isAdmin": true,
"lastFMApiKey": "xxx",
"name": "username",
"subsonicSalt": "xxx",
"subsonicToken": "xxxxx",
"token": "xxxx",
"username": "username"
}
在之后的请求中,需要在请求头中携带以下信息:
x-nd-authorization
: 'Bearertoken
'x-nd-client-unique-id
:id
keepalive 登录状态保活
GET: [host]/api/keepalive/keepalive
请求节点
album 获取专辑列表
GET: [host]/api/album
query:
参数名 | 备注 |
---|---|
_start | 起始行数,0开始 |
_end | 结束行数 |
_order | 排序,可选值 ASC , DESC |
_sort | 排序方式,可选值 random , createdAt , min_year , play_count , play_date , name , albumArtist , rating , 可用, 分割多个排序方式,如 min_year asc,date asc |
artist_id | 歌手id,可选 |
rating | 评分,可选 |
starred | 收藏状态(true/false ),可选 |
name | 专辑名(like 查询),可选 |
待补充:
- 如何查询在某个区间的年代,自测
min_year
和max_year
只有相等的判断,同时传也不会判断区间。 - 如何查询歌曲数量大于某个值的专辑
- 专辑名的筛选是否可以添加多个关键词筛选
响应内容:
[
{
"playCount": 14,
"playDate": "2024-04-18T07:37:46.658+08:00",
"rating": 0,
"starred": false,
"starredAt": null,
"id": "2e7e41725443fa5e8a637a4668e63e98",
"name": "放下",
"embedArtPath": "/volume1/music/胡夏/放下/胡夏-放下.flac",
"artistId": "6d095fad618e04185bd66998450041da",
"artist": "胡夏",
"albumArtistId": "6d095fad618e04185bd66998450041da",
"albumArtist": "胡夏",
"allArtistIds": "6d095fad618e04185bd66998450041da",
"maxYear": 2013,
"minYear": 2013,
"date": "2013",
"maxOriginalYear": 0,
"minOriginalYear": 0,
"releases": 1,
"compilation": false,
"songCount": 1,
"duration": 337.08,
"size": 35163552,
"genre": "",
"genres": null,
"fullText": " 放下 胡夏",
"orderAlbumName": "放下",
"orderAlbumArtistName": "胡夏",
"paths": "/volume1/music/胡夏/放下",
"externalInfoUpdatedAt": null,
"createdAt": "2024-03-02T01:04:46.424670828+08:00",
"updatedAt": "2024-03-21T20:41:28.340360006+08:00"
}
]
响应头:
x-total-count
: 总行数
album/[id] 获取专辑信息
GET: [host]/api/album/[id]
响应内容:
{
"playCount": 14,
"playDate": "2024-04-18T07:37:46.658+08:00",
"rating": 0,
"starred": false,
"starredAt": null,
"id": "2e7e41725443fa5e8a637a4668e63e98",
"name": "放下",
"embedArtPath": "/volume1/music/胡夏/放下/胡夏-放下.flac",
"artistId": "6d095fad618e04185bd66998450041da",
"artist": "胡夏",
"albumArtistId": "6d095fad618e04185bd66998450041da",
"albumArtist": "胡夏",
"allArtistIds": "6d095fad618e04185bd66998450041da",
"maxYear": 2013,
"minYear": 2013,
"date": "2013",
"maxOriginalYear": 0,
"minOriginalYear": 0,
"releases": 1,
"compilation": false,
"songCount": 1,
"duration": 337.08,
"size": 35163552,
"genre": "",
"genres": null,
"fullText": " 放下 胡夏",
"orderAlbumName": "放下",
"orderAlbumArtistName": "胡夏",
"paths": "/volume1/music/胡夏/放下",
"externalInfoUpdatedAt": null,
"createdAt": "2024-03-02T01:04:46.424670828+08:00",
"updatedAt": "2024-03-21T20:41:28.340360006+08:00"
}
artist/[id] 获取歌手信息
GET: [host]/api/artist/[id]
响应内容:
{
"playCount": 42,
"playDate": "2024-04-18T08:27:04.036+08:00",
"rating": 0,
"starred": false,
"starredAt": null,
"id": "6d095fad618e04185bd66998450041da",
"name": "胡夏",
"albumCount": 19,
"songCount": 60,
"genres": null,
"fullText": " 胡夏",
"orderArtistName": "胡夏",
"size": 1714942860,
"externalUrl": "https://www.last.fm/music/%E8%83%A1%E5%A4%8F",
"externalInfoUpdatedAt": "0001-01-01T00:00:00Z"
}
getArtistInfo 获取歌手简介及相似歌手
参见 Subsonic 的 getArtistInfo 接口。
artist 获取歌手列表
GET: [host]/api/artist
query:
参数名 | 备注 |
---|---|
_start | 起始行数,0开始 |
_end | 结束行数,_end 和 _start 都等于 0 时可以查询全部 |
_order | 排序,可选值 ASC , DESC |
_sort | 排序方式,可选值 random , play_count , play_date , name , rating , 可用, 分割多个排序方式,如 min_year asc,date asc |
rating | 评分,可选 |
starred | 收藏状态(true/false ),可选 |
name | 歌手名(like 查询),可选 |
role | 角色,可选,0.55.0 及以上版本可用,以下版本添加此参数会出错 |
响应内容:
[
{
"playCount": 42,
"playDate": "2024-04-18T08:27:04.036+08:00",
"rating": 0,
"starred": false,
"starredAt": null,
"id": "6d095fad618e04185bd66998450041da",
"name": "胡夏",
"albumCount": 19,
"songCount": 60,
"genres": null,
"fullText": " 胡夏",
"orderArtistName": "胡夏",
"size": 1714942860,
"mbzArtistId": "2ccbc670-5fe9-450a-a4ab-4d87131214b3",
"smallImageUrl": "https://i.scdn.co/image/ab67616d0000485129c9ac0b10fb4f016de87b11",
"mediumImageUrl": "https://i.scdn.co/image/ab67616d00001e0229c9ac0b10fb4f016de87b11",
"largeImageUrl": "https://i.scdn.co/image/ab67616d0000b27329c9ac0b10fb4f016de87b11",
"externalUrl": "https://www.last.fm/music/%E8%83%A1%E5%A4%8F",
"externalInfoUpdatedAt": "2024-04-18T16:10:03.997920721+08:00"
}
]
响应头:
x-total-count
: 总行数
getCoverArt 封面图片
参见 Subsonic 的 getCoverArt