Skip to content

搜索视频号 ​

按关键词搜索视频号用户、视频或综合结果,支持筛选和翻页。

接口地址: 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
}

响应参数 ​

参数名类型说明
codestring1000 成功;其他值都是失败,通常是 1001
messagestring反馈信息
dataobject搜索结果
data.cookiestring下一次搜索翻页使用的上下文
data.searchIdstring搜索 ID,翻页时原样传回
data.offsetnumber下一次搜索翻页使用的偏移量
data.authInfosarray认证信息列表
data.videoInfosarray搜索结果分组
data.videoInfos[].itemsarray分组下的结果列表
data.videoInfos[].items[].docIdstring结果 ID
data.videoInfos[].items[].titlestring标题,可能包含高亮 HTML
data.videoInfos[].items[].dateTimestring展示时间
data.videoInfos[].items[].durationstring视频时长
data.videoInfos[].items[].imagestring封面图
data.videoInfos[].items[].imageDataobject封面图尺寸信息
data.videoInfos[].items[].likeNumstring点赞展示值
data.videoInfos[].items[].pubTimenumber发布时间
data.videoInfos[].items[].sourceobject来源账号信息
data.videoInfos[].items[].jumpInfoobject跳转信息
data.videoInfos[].items[].videoUrlstring视频地址
data.videoInfos[].boxIdstring分组 ID
data.videoInfos[].typenumber分组类型
data.videoInfos[].subTypenumber分组子类型
data.videoInfos[].totalCountnumber总数