Appearance
搜索视频号
按关键词搜索视频号用户、视频或综合结果,支持筛选和翻页。
接口地址: POST /newSearchFinder
请求参数
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| wId | 是 | string | 登录实例标识 |
| content | 是 | string | 搜索关键词 |
| type | 是 | int | 搜索类型:0 全部,1 用户,10 视频 |
| filter | 是 | int | 筛选类型:0 不限,1 最新,2 朋友赞过 |
| page | 是 | int | 页码;首次传 1,后续自行累加 |
| offset | 是 | int | 偏移量;首次传 0,后续传响应中的 offset |
| cookie | 否 | string | 搜索上下文;首次传空,后续传响应中的 cookie |
| searchId | 否 | string | 搜索 ID;首次传空,后续传响应中的 searchId |
请求示例
http
POST {BASE_URL}/newSearchFinder
Authorization: Bearer <你的调用凭证>
Content-Type: application/json
{
"wId": "{{wId}}",
"content": "中国",
"type": 0,
"filter": 0,
"page": 1,
"offset": 0,
"cookie": "",
"searchId": ""
}bash
curl -X POST '{BASE_URL}/newSearchFinder' \
-H 'Authorization: Bearer <你的调用凭证>' \
-H 'Content-Type: application/json' \
--data-raw '{
"wId": "{{wId}}",
"content": "中国",
"type": 0,
"filter": 0,
"page": 1,
"offset": 0,
"cookie": "",
"searchId": ""
}'python
import requests
url = "{BASE_URL}/newSearchFinder"
headers = {"Authorization": "Bearer <你的调用凭证>", "Content-Type": "application/json"}
body = """{
"wId": "{{wId}}",
"content": "中国",
"type": 0,
"filter": 0,
"page": 1,
"offset": 0,
"cookie": "",
"searchId": ""
}"""
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}/newSearchFinder";
String body = "{\n" +
" \"wId\": \"{{wId}}\",\n" +
" \"content\": \"中国\",\n" +
" \"type\": 0,\n" +
" \"filter\": 0,\n" +
" \"page\": 1,\n" +
" \"offset\": 0,\n" +
" \"cookie\": \"\",\n" +
" \"searchId\": \"\"\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}/newSearchFinder';
$body = <<<'JSON'
{
"wId": "{{wId}}",
"content": "中国",
"type": 0,
"filter": 0,
"page": 1,
"offset": 0,
"cookie": "",
"searchId": ""
}
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": {
"cookie": "{\"box_offset\":0,\"businessType\":14,\"page_cnt\":1,\"query\":\"中国\"}",
"searchId": "416754344366039934",
"offset": 8,
"authInfos": [],
"videoInfos": [
{
"items": [
{
"dateTime": "3天前",
"docId": "14212057401545988355",
"duration": "08:09",
"image": "http://wxapp.tc.qq.com/251/20304/stodownload?...",
"imageData": {
"height": 1088,
"width": 1920,
"url": "http://wxapp.tc.qq.com/251/20304/stodownload?..."
},
"likeNum": "10万+",
"pubTime": 1694209265,
"source": {
"iconUrl": "https://wx.qlogo.cn/finderhead/ver_1/example/132",
"mark": [
"https://dldir1v6.qq.com/weixin/checkresupdate/auth_icon_level3_2e2f94615c1e4651a25a7e0446f63135.png"
],
"title": "示例账号"
},
"jumpInfo": {
"feedId": "14212057401545988355",
"jumpType": 9,
"extInfo": "{\"behavior\":[\"report_feed_read\"]}"
},
"title": "这里是<em class=\"highlight\">中国</em>",
"videoUrl": "https://findermp.video.qq.com/251/20302/stodownload?..."
}
],
"boxId": "0x80000000000-1-14212057401545988355",
"type": 86,
"subType": 1,
"totalCount": 270
}
]
}
}错误响应
json
{
"code": "1001",
"message": "失败",
"data": null
}响应参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | string | 1000 成功;其他值都是失败,通常是 1001 |
| message | string | 反馈信息 |
| data | object | 搜索结果 |
| data.cookie | string | 下一次搜索翻页使用的上下文 |
| data.searchId | string | 搜索 ID,翻页时原样传回 |
| data.offset | number | 下一次搜索翻页使用的偏移量 |
| data.authInfos | array | 认证信息列表 |
| data.videoInfos | array | 搜索结果分组 |
| data.videoInfos[].items | array | 分组下的结果列表 |
| data.videoInfos[].items[].docId | string | 结果 ID |
| data.videoInfos[].items[].title | string | 标题,可能包含高亮 HTML |
| data.videoInfos[].items[].dateTime | string | 展示时间 |
| data.videoInfos[].items[].duration | string | 视频时长 |
| data.videoInfos[].items[].image | string | 封面图 |
| data.videoInfos[].items[].imageData | object | 封面图尺寸信息 |
| data.videoInfos[].items[].likeNum | string | 点赞展示值 |
| data.videoInfos[].items[].pubTime | number | 发布时间 |
| data.videoInfos[].items[].source | object | 来源账号信息 |
| data.videoInfos[].items[].jumpInfo | object | 跳转信息 |
| data.videoInfos[].items[].videoUrl | string | 视频地址 |
| data.videoInfos[].boxId | string | 分组 ID |
| data.videoInfos[].type | number | 分组类型 |
| data.videoInfos[].subType | number | 分组子类型 |
| data.videoInfos[].totalCount | number | 总数 |