Navidrome 接口文档
备注
Navidrome 目前还没有官方的接口文档,以下均为抓包所得。
认证
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 查询),可选 |
响应内容:
[
{
"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
playlist 创建歌单
POST: [host]/api/playlist
body(application/json
):
参数名 | 备注 |
---|---|
name | 歌单名 |
comment | 评论 |
public | 其他人是否可见 |
响应内容:
{
"id": "775cca70-cd09-4029-9858-583098bef519"
}
playlist/[id] 删除歌单
DELETE: [host]/api/playlist/[id]
响应内容:
{}
song/[id] 获取歌曲信息
GET: [host]/api/song/[id]
playlist 获取歌单列表
GET: [host]/api/playlist
query:
参数名 | 备注 |
---|---|
_start | 起始行数,0开始 |
_end | 结束行数,_end 和 _start 都等于 0 时可以查询全部 |
_order | 排序,可选值 ASC , DESC |
_sort | 排序方式,可选值 random , name , 可用, 分割多个排序方式,如 max_year asc,date asc |
响应内容:
[
{
"id": "355c94bd-4bef-485a-8945-d6d9d02191cd",
"name": "1999年老歌by慕星人",
"comment": "",
"duration": 8280.36,
"size": 951975104,
"songCount": 31,
"ownerName": "userA",
"ownerId": "34c42e25-70f8-42d3-83ff-6442b9a341a4",
"public": false,
"path": "",
"sync": false,
"createdAt": "2024-04-09T15:28:28.917434949+08:00",
"updatedAt": "2024-04-17T22:32:12.507824702+08:00",
"rules": null,
"evaluatedAt": null
},
{
"id": "bd200cad-839e-4818-85af-7e438fb6aef0",
"name": "15515",
"comment": "",
"duration": 170.67,
"size": 19324940,
"songCount": 1,
"ownerName": "userB",
"ownerId": "631ec3f3-0d00-4648-b404-ce4e95c305f2",
"public": false,
"path": "",
"sync": false,
"createdAt": "2024-03-17T18:55:34.432021369+08:00",
"updatedAt": "2024-03-17T18:55:47.208985366+08:00",
"rules": null,
"evaluatedAt": null
},
]
响应头:
x-total-count
: 总行数
setRating 评分
参见 Subsonic 的 setRating 接口。
getScanStatus 获取扫描状态
参见 Subsonic 的 getScanStatus 接口。
提示
这个接口获取到的歌曲数量可能与实际不符,建议从歌曲列表接口的响应头中获取歌曲总数。
scrobble 滚动播放记录
参见 Subsonic 的 scrobble 接口。
search2 搜索歌曲/专辑/歌手
参见 Subsonic 的 search2 接口。