Appearance
获取评论列表
分页获取一个视频号作品的评论列表;rootCommentId 传某条评论的 ID 时,返回的是这条评论下的回复。
接口地址: POST /finderCommentDetails
说明与注意
id、nonceId、sessionBuffer来自视频号主页、搜索或详情类接口的返回。- 评论 ID 是很大的整数,还可能是负数,按普通 number 存会丢精度。
请求参数
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| wId | 是 | string | 登录实例标识 |
| id | 是 | number | 视频号作品 ID |
| pageCode | 是 | string | 分页参数;首次传空,翻页时传响应中的 pageCode |
| sessionBuffer | 是 | string | 作品上下文会话数据 |
| refCommentId | 是 | number | 默认为 0 |
| rootCommentId | 是 | number | 获取回复详情时传上级评论 ID;普通评论列表传 0 |
| nonceId | 是 | string | 视频号作品 nonceId |
请求示例
http
POST {BASE_URL}/finderCommentDetails
Authorization: Bearer <你的调用凭证>
Content-Type: application/json
{
"wId": "{{wId}}",
"id": 14200825020179157073,
"pageCode": "",
"sessionBuffer": "eyJzZXNzaW9uX2lkIjoic2lkXzEzNDUxMDA3MDNf...",
"refCommentId": 0,
"rootCommentId": 0,
"nonceId": "14967079156574588894_0_0_2_2_0"
}bash
curl -X POST '{BASE_URL}/finderCommentDetails' \
-H 'Authorization: Bearer <你的调用凭证>' \
-H 'Content-Type: application/json' \
--data-raw '{
"wId": "{{wId}}",
"id": 14200825020179157073,
"pageCode": "",
"sessionBuffer": "eyJzZXNzaW9uX2lkIjoic2lkXzEzNDUxMDA3MDNf...",
"refCommentId": 0,
"rootCommentId": 0,
"nonceId": "14967079156574588894_0_0_2_2_0"
}'python
import requests
url = "{BASE_URL}/finderCommentDetails"
headers = {"Authorization": "Bearer <你的调用凭证>", "Content-Type": "application/json"}
body = """{
"wId": "{{wId}}",
"id": 14200825020179157073,
"pageCode": "",
"sessionBuffer": "eyJzZXNzaW9uX2lkIjoic2lkXzEzNDUxMDA3MDNf...",
"refCommentId": 0,
"rootCommentId": 0,
"nonceId": "14967079156574588894_0_0_2_2_0"
}"""
resp = requests.post(url, headers=headers, data=body.encode("utf-8"))
print(resp.text)java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String url = "{BASE_URL}/finderCommentDetails";
String body = "{\n" +
" \"wId\": \"{{wId}}\",\n" +
" \"id\": 14200825020179157073,\n" +
" \"pageCode\": \"\",\n" +
" \"sessionBuffer\": \"eyJzZXNzaW9uX2lkIjoic2lkXzEzNDUxMDA3MDNf...\",\n" +
" \"refCommentId\": 0,\n" +
" \"rootCommentId\": 0,\n" +
" \"nonceId\": \"14967079156574588894_0_0_2_2_0\"\n" +
"}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create(url))
.header("Authorization", "Bearer <你的调用凭证>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());php
<?php
$url = '{BASE_URL}/finderCommentDetails';
$body = <<<'JSON'
{
"wId": "{{wId}}",
"id": 14200825020179157073,
"pageCode": "",
"sessionBuffer": "eyJzZXNzaW9uX2lkIjoic2lkXzEzNDUxMDA3MDNf...",
"refCommentId": 0,
"rootCommentId": 0,
"nonceId": "14967079156574588894_0_0_2_2_0"
}
JSON;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <你的调用凭证>',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;成功响应
json
{
"code": "1000",
"message": "处理成功",
"data": {
"videoDetails": null,
"commentList": [
{
"userName": "v5_020b0a166104010000000000ae18109352a67c000000b1afa7d8728e3dd43ef4317a780e33c2718b019b67053251a030e444e04fd520e943bd3c5be4d603186002dd12e6ec5ed990dc378a101a5ee7ffe6ac04261c74d14196876054300d15f037bf39@stranger",
"nickName": "示例用户",
"content": "示例评论内容",
"commentId": -4245909463265376127,
"replyCommentId": null,
"headUrl": "https://wx.qlogo.cn/mmhead/ver_1/example/132",
"createTime": 1692871404,
"likeCount": 46142,
"ipRegion": "江苏",
"replyContent": null,
"replyUserName": null,
"finderAuthorVo": {
"userName": "v5_020b0a166104010000000000ae18109352a67c000000b1afa7d8728e3dd43ef4317a780e33c2718b019b67053251a030e444e04fd520e943bd3c5be4d603186002dd12e6ec5ed990dc378a101a5ee7ffe6ac04261c74d14196876054300d15f037bf39@stranger",
"nickName": "示例用户",
"headUrl": "https://wx.qlogo.cn/mmhead/ver_1/example/132"
}
}
],
"pageCode": "CrABCLCwsM79pO+NxQEYgZHkrOz634nFARixkvD6yerficUBG...",
"commentCount": 5534,
"likeCount": 100002,
"forwardCount": 100002,
"favCount": 100002
}
}错误响应
json
{
"code": "1001",
"message": "失败",
"data": null
}响应参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | string | 1000 成功;其他值都是失败,通常是 1001 |
| message | string | 反馈信息 |
| data | object | 评论列表结果 |
| data.videoDetails | object / null | 作品详情,可能为 null |
| data.commentList | array | 评论列表 |
| data.commentList[].userName | string | 评论用户编码 |
| data.commentList[].nickName | string | 评论用户昵称 |
| data.commentList[].content | string | 评论内容 |
| data.commentList[].commentId | number | 评论 ID |
| data.commentList[].replyCommentId | number / null | 回复的评论 ID |
| data.commentList[].headUrl | string | 评论用户头像 |
| data.commentList[].createTime | number | 评论时间,Unix 秒级时间戳 |
| data.commentList[].likeCount | number | 评论点赞数 |
| data.commentList[].ipRegion | string | IP 属地 |
| data.commentList[].replyContent | string / null | 被回复内容 |
| data.commentList[].replyUserName | string / null | 被回复用户 |
| data.commentList[].finderAuthorVo | object | 评论用户信息 |
| data.pageCode | string | 下一页分页参数 |
| data.commentCount | number | 评论数 |
| data.likeCount | number | 点赞数 |
| data.forwardCount | number | 转发数 |
| data.favCount | number | 收藏数 |