Appearance
调用此接口,传入音乐 id 和 limit 参数,可获得该音乐的所有评论 ( 不需要登录 )
/comment/music
GET
POST
comment_music
id
limit
offset
before
time
GET /comment/music?id=186016&limit=1
import { commentMusic } from 'hana-music-api'; const result = await commentMusic({ id: '186016', limit: '1', }); 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_music.empty.json,云盘歌曲 1984488794)返回 comments: []、hotComments: []、total: 0;越界分页(录制 comment_music.out-of-range.json,offset=100000)返回 comments: [] 且没有 hotComments。topComments(只见过空数组)和 commentBanner(只见过 null)没有声明,原样保留。非空录制(comment_music.default.json)从原 20 条 comments/15 条 hotComments 中保留覆盖各字段的非连续 5/5 条。登录对照先用 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_music.empty.json
comments: []
hotComments: []
total: 0
comment_music.out-of-range.json
offset=100000
hotComments
topComments
commentBanner
null
comment_music.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/music
调用例子 : /comment/music?id=186016&limit=1 对应晴天评论
/comment/music?id=186016&limit=1
歌曲评论
接口信息
/comment/musicGET/POSTcomment_music请求参数
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_music.empty.json,云盘歌曲 1984488794)返回comments: []、hotComments: []、total: 0;越界分页(录制comment_music.out-of-range.json,offset=100000)返回comments: []且没有hotComments。topComments(只见过空数组)和commentBanner(只见过null)没有声明,原样保留。非空录制(comment_music.default.json)从原 20 条comments/15 条hotComments中保留覆盖各字段的非连续 5/5 条。登录对照先用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/music调用例子 :
/comment/music?id=186016&limit=1对应晴天评论