Skip to content

xhs_query_my_notes

查询本地缓存的已发布笔记,支持多条件筛选。

参数

参数类型必填说明
accountstring账号名或 ID
typestring笔记类型:normal/video
levelnumber笔记等级
stickyboolean是否置顶
permissionCodenumber权限代码:0=公开
titleContainsstring标题包含文字
minLikesnumber最少点赞数
minCollectednumber最少收藏数
minCommentsnumber最少评论数
minViewsnumber最少浏览数
publishTimeStartstring发布时间起始
publishTimeEndstring发布时间截止
orderBystring排序字段
orderDirstring排序方向:asc/desc
limitnumber返回数量(默认 100)
offsetnumber分页偏移(默认 0)
includeStatsboolean是否包含统计信息

orderBy 排序字段

说明
publish_time发布时间(默认)
likes点赞数
collected_count收藏数
comments_count评论数
view_count浏览数
updated_at更新时间

返回值

json
{
  "account": "账号名",
  "success": true,
  "count": 10,
  "total": 50,
  "lastFetchTime": "2024-01-01T00:00:00Z",
  "notes": [...],
  "stats": {
    "totalNotes": 50,
    "totalViews": 50000,
    "totalLikes": 5000
  }
}

示例

查询高赞笔记

xhs_query_my_notes({
  minLikes: 100,
  orderBy: "likes",
  orderDir: "desc"
})

按时间范围查询

xhs_query_my_notes({
  publishTimeStart: "2024-01-01",
  publishTimeEnd: "2024-01-31"
})

搜索标题

xhs_query_my_notes({
  titleContains: "咖啡"
})

注意事项

  • 需要先调用 xhs_get_my_notes 获取并缓存数据
  • 查询在本地数据库执行,速度快

Released under the MIT License.