Skip to content

获取关注列表 ​

分页获取当前视频号的关注列表。

接口地址: POST /finder/getFollowList

说明与注意 ​

  • myUserName、myRoleType 从获取个人主页的返回里取。
  • 请求参数叫 lastBuff,响应里叫 lastBuffer,翻页时把 lastBuffer 的值传给 lastBuff。

请求参数 ​

参数名必选类型说明
wId是string登录实例标识
lastBuff否string分页参数;首次传空,翻页时传响应中的 lastBuffer
myUserName是string自己的视频号用户编码
myRoleType是int自己的视频号角色类型

请求示例 ​

http
POST {BASE_URL}/finder/getFollowList
Authorization: Bearer <你的调用凭证>
Content-Type: application/json

{
  "wId": "{{wId}}",
  "lastBuff": "",
  "myUserName": "v2_060000231003b20faec8cae18cb07ea33b077ba915250774edbea38082ea6b24af229@finder",
  "myRoleType": 3
}
bash
curl -X POST '{BASE_URL}/finder/getFollowList' \
  -H 'Authorization: Bearer <你的调用凭证>' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "wId": "{{wId}}",
  "lastBuff": "",
  "myUserName": "v2_060000231003b20faec8cae18cb07ea33b077ba915250774edbea38082ea6b24af229@finder",
  "myRoleType": 3
}'
python
import requests

url = "{BASE_URL}/finder/getFollowList"
headers = {"Authorization": "Bearer <你的调用凭证>", "Content-Type": "application/json"}
body = """{
  "wId": "{{wId}}",
  "lastBuff": "",
  "myUserName": "v2_060000231003b20faec8cae18cb07ea33b077ba915250774edbea38082ea6b24af229@finder",
  "myRoleType": 3
}"""

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}/finder/getFollowList";
String body = "{\n" +
    "  \"wId\": \"{{wId}}\",\n" +
    "  \"lastBuff\": \"\",\n" +
    "  \"myUserName\": \"v2_060000231003b20faec8cae18cb07ea33b077ba915250774edbea38082ea6b24af229@finder\",\n" +
    "  \"myRoleType\": 3\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}/finder/getFollowList';
$body = <<<'JSON'
{
  "wId": "{{wId}}",
  "lastBuff": "",
  "myUserName": "v2_060000231003b20faec8cae18cb07ea33b077ba915250774edbea38082ea6b24af229@finder",
  "myRoleType": 3
}
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": {
    "contactList": [
      {
        "signature": "。。。",
        "headUrl": "https://wx.qlogo.cn/finderhead/ver_1/example/0",
        "authInfo": {},
        "extInfo": {
          "country": "CN",
          "province": "",
          "city": "",
          "sex": 2
        },
        "followTime": 1718847606,
        "nickname": "朝vvvv",
        "followFlag": 1,
        "liveStatus": 2,
        "username": "v2_060000231003b20faec8c6e18f10c7d6c903ec776955d3d97c6b329d6aa58693bcdb7ad1@finder",
        "status": 0
      }
    ],
    "lastBuffer": "CL+fAxu8+qqBg==",
    "followCount": 1,
    "continueFlag": 1
  }
}

错误响应 ​

json
{
  "code": "1001",
  "message": "失败",
  "data": null
}

响应参数 ​

参数名类型说明
codestring1000 成功;其他值都是失败,通常是 1001
messagestring反馈信息
dataobject关注列表结果
data.contactListarray关注用户列表
data.contactList[].usernamestring视频号用户编码
data.contactList[].nicknamestring昵称
data.contactList[].headUrlstring头像地址
data.contactList[].signaturestring简介
data.contactList[].authInfoobject认证信息
data.contactList[].extInfoobject地区、性别等扩展信息
data.contactList[].followTimenumber关注时间,Unix 秒级时间戳
data.contactList[].followFlagint关注状态
data.contactList[].liveStatusint直播状态
data.lastBufferstring下一页分页参数
data.followCountnumber关注数量
data.continueFlagint是否还有下一页:1 有,0 无