Appearance
调用此接口,传入音乐 id 和 limit 参数,可获得该专辑的所有评论 ( 不需要
/comment/album
GET
POST
comment_album
id
limit
offset
before
time
GET /comment/album?id=32311
import { commentAlbum } from 'hana-music-api'; const result = await commentAlbum({ id: '32311', }); console.log(result.body);
body.code、body.comments、body.comments[].commentId 收紧;body.hotComments 是可以没有的路径:越界分页时整个缺失,出现时 hotComments[].commentId 收紧。评论记录共用 CommentRecord,user、beReplied、likedCount、time、decoration、ipLocation、pendantData 等其余声明字段都宽松;beReplied[] 是评论里套着的回复记录,编号也宽松。total、more、moreHot、cnum、isMusician、userId 宽松。无评论专辑(录制 comment_album.empty.json,专辑 405204773)返回 comments: []、hotComments: []、total: 0;越界分页(录制 comment_album.out-of-range.json,offset=100000)返回 comments: [] 且没有 hotComments。topComments(只见过空数组)和 commentBanner(只见过 null)没有声明,原样保留。非空录制(comment_album.default.json)从原 20 条 comments/9 条 hotComments 中保留覆盖各字段的非连续 5/4 条。登录对照先用 login_status 确认 account.anonimousUser: false 后抽查:非 null 路径与类型相同,登录响应只会在宽松字段上多出现值为 null 的路径(如 comments[].user.vipRights、beReplied[].content/richContent、beReplied[].ipLocation.userId),登录录制未保留。
body.code
body.comments
body.comments[].commentId
body.hotComments
hotComments[].commentId
CommentRecord
user
beReplied
likedCount
decoration
ipLocation
pendantData
beReplied[]
total
more
moreHot
cnum
isMusician
userId
comment_album.empty.json
comments: []
hotComments: []
total: 0
comment_album.out-of-range.json
offset=100000
hotComments
topComments
commentBanner
null
comment_album.default.json
comments
login_status
account.anonimousUser: false
comments[].user.vipRights
beReplied[].content
richContent
beReplied[].ipLocation.userId
说明 : 调用此接口,传入音乐 id 和 limit 参数,可获得该专辑的所有评论 ( 不需要 登录 )
必选参数 : id: 专辑 id
可选参数 : limit: 取出评论数量,默认为 20
offset: 偏移数量,用于分页,如:(评论页数 - 1)*20, 其中 20 为 limit 的值
before: 分页参数,取上一页最后一项的 time 获取下一页数据(获取超过 5000 条评论的时候需要用到)
接口地址 : /comment/album
调用例子 : /comment/album?id=32311
/comment/album?id=32311
专辑评论
接口信息
/comment/albumGET/POSTcomment_album请求参数
idlimitoffsetbeforetime获取下一页数据(获取超过 5000 条评论的时候需要用到)HTTP 示例
编程式调用
返回内容
body.code、body.comments、body.comments[].commentId收紧;body.hotComments是可以没有的路径:越界分页时整个缺失,出现时hotComments[].commentId收紧。评论记录共用CommentRecord,user、beReplied、likedCount、time、decoration、ipLocation、pendantData等其余声明字段都宽松;beReplied[]是评论里套着的回复记录,编号也宽松。total、more、moreHot、cnum、isMusician、userId宽松。无评论专辑(录制comment_album.empty.json,专辑 405204773)返回comments: []、hotComments: []、total: 0;越界分页(录制comment_album.out-of-range.json,offset=100000)返回comments: []且没有hotComments。topComments(只见过空数组)和commentBanner(只见过null)没有声明,原样保留。非空录制(comment_album.default.json)从原 20 条comments/9 条hotComments中保留覆盖各字段的非连续 5/4 条。登录对照先用login_status确认account.anonimousUser: false后抽查:非null路径与类型相同,登录响应只会在宽松字段上多出现值为null的路径(如comments[].user.vipRights、beReplied[].content/richContent、beReplied[].ipLocation.userId),登录录制未保留。补充说明
说明 : 调用此接口,传入音乐 id 和 limit 参数,可获得该专辑的所有评论 ( 不需要 登录 )
必选参数 :
id: 专辑 id可选参数 :
limit: 取出评论数量,默认为 20offset: 偏移数量,用于分页,如:(评论页数 - 1)*20, 其中 20 为 limit 的值before: 分页参数,取上一页最后一项的time获取下一页数据(获取超过 5000 条评论的时候需要用到)接口地址 :
/comment/album调用例子 :
/comment/album?id=32311