Skip to content

获取朋友圈

分页获取当前微信实例可见的朋友圈列表。

接口地址: POST /getCircle

前置条件

  • 微信实例已登录,并已获得可用的 wId
  • 首次请求 firstPageMd5 传空字符串,maxId0
  • 请求下一页时,firstPageMd5 使用上一次响应返回值,maxId 使用上一页最后一条朋友圈 ID 或业务侧保存的翻页游标。

请求参数

参数名必选类型说明
wIdstring登录实例标识
firstPageMd5string首次传空字符串,第二页及以后传上一次响应返回的 firstPageMd5
maxIdlong首次传 0,后续按翻页游标传入

请求示例

json
{
 "wId": "b7ad08a6-77c2-4ad6-894a-29993b84c0e4",
 "firstPageMd5": "",
 "maxId": 0
}

响应参数

参数名类型说明
codestring1000 成功,1001 失败
messagestring反馈信息
data.snsarray朋友圈列表
data.firstPageMd5string翻页标识,下一页请求时继续传入
data.sns[].idstring朋友圈 ID
data.sns[].userNamestring发布者微信 ID
data.sns[].nickNamestring发布者昵称
data.sns[].createTimelong发布时间戳
data.sns[].objectDescobject朋友圈内容
data.sns[].objectDesc.xmlstring朋友圈 XML 原始数据
data.sns[].objectDesc.lenintXML 长度
data.sns[].likeCountint点赞数量
data.sns[].snsLikesarray点赞列表
data.sns[].commentCountint评论数量
data.sns[].snsCommentsarray评论列表

成功响应

json
{
 "message": "成功",
 "code": "1000",
 "data": {
 "sns": [
 {
 "id": "13351211557386072142",
 "userName": "wxid_6tn88z16x6ou12",
 "nickName": "远见",
 "createTime": 1591588444,
 "likeFlag": 0,
 "likeCount": 0,
 "snsLikes": [],
 "commentCount": 0,
 "snsComments": []
 }
 ],
 "firstPageMd5": "087ed4f0b41e46e3"
 }
}

错误响应

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

使用建议

  • 建议按页同步并保存 firstPageMd5 和最后一条朋友圈 ID,避免重复拉取。
  • 列表页只适合做概览;需要完整 XML、评论和点赞详情时,继续调用「获取某条朋友圈详细内容」。
  • 朋友圈数据受微信侧可见权限影响,列表为空不一定代表接口异常。