# 怎样筛出最近一周发表的视频号评论，包括旧作品下的评论？

[规范网址](https://social2api.com/guides/wechat-channels-comment-date-filter-after-export/)

视频号请求时间筛选作品发布日期。读取覆盖目标作品的作品范围后，用 commentPublishedAt 对已取回的评论再筛最近一周。

## Agent 提示词

~~~~text
请在 Social2api 使用微信视频号作品与评论，执行以下任务。
目标：按评论时间在取回结果中二次筛选。
输入与对照示例：12 月 10 日有人在 11 月的产品教学下留言。作品查询覆盖 11 月到 12 月，再用表格仅保留 12 月 7—13 日评论。
公开查询可先用免密钥合成示例；实时取数需要权限和部署支持。
按以下步骤完成：确定可能被讨论的原作品发布日期范围，分批读取作品及评论。 导出后以 commentPublishedAt 为准筛评论周，单列缺失时间。 记下每条作品评论上限，报表标题注明是取回样本中的本周评论。
交付能核对的结果和必要字段：params.since、params.until、params.commentsPerVideo、videoId、commentPublishedAt、commentText。注明来源或限制，并以本页为操作参考。
https://social2api.com/guides/wechat-channels-comment-date-filter-after-export/
~~~~

[试取带评论时间的样本](https://social2api.com/#workspace/channels)

[查看对应 API](https://social2api.com/docs/api/wechat-channels-videos/)

## 本页用到的 Social2api 接口

| 接口与参数文档 | 用途 |
| --- | --- |
| [微信视频号作品与评论](https://social2api.com/docs/api/wechat-channels-videos/) · POST /api/run · task=channels | 解析微信视频号账号，取回其公开视频以及每个视频的部分评论。 |

## 在 Social2api 使用微信视频号作品与评论

1. 确定可能被讨论的原作品发布日期范围，分批读取作品及评论。
2. 导出后以 commentPublishedAt 为准筛评论周，单列缺失时间。
3. 记下每条作品评论上限，报表标题注明是取回样本中的本周评论。

## 复制请求并试跑

先用宽作品窗口取回样例，再在表格按 commentPublishedAt 保留 12 月 7 至 13 日的评论。

这条请求使用合成样例，免登录、免 API Key，上游请求数为 0。要查真实数据，将 mode 改为 live，换成实际输入，并在 Authorization 中提供有相应任务权限的 Bearer API Key。可用 maxRequests 限制实时上游请求数。

~~~~bash
curl --fail-with-body -sS 'https://social2api.com/api/run' \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'JSON'
{
  "task": "channels",
  "mode": "demo",
  "params": {
    "account": "产品教学示例账号",
    "limit": 3,
    "commentsPerVideo": 2,
    "since": "2025-11-01",
    "until": "2025-12-13"
  }
}
JSON
~~~~

## 用旧作品和新评论校验周报筛选

工作台的 since、until 筛作品发布日期。下载的结果要用 commentPublishedAt 另做评论周筛选。以下是独立合成记录，11 月作品的 12 月评论入表，日期未知另存。实际覆盖受作品扫描深度、单作品评论上限及取数预算影响。

~~~~python
import csv

rows = [
    {'videoId': '1001', 'publishedAt': '2025-11-20', 'commentPublishedAt': '2025-12-10', 'commentText': '如何使用？'},
    {'videoId': '1002', 'publishedAt': '2025-11-28', 'commentPublishedAt': '2025-12-06', 'commentText': '上周留言'},
    {'videoId': '1003', 'publishedAt': '2025-12-11', 'commentPublishedAt': None, 'commentText': '时间未提供'},
]
known = [row for row in rows if row['commentPublishedAt']]
selected = [row for row in known if '2025-12-07' <= row['commentPublishedAt'] <= '2025-12-13']
unknown = [row for row in rows if not row['commentPublishedAt']]
assert [row['videoId'] for row in selected] == ['1001']
assert [row['videoId'] for row in unknown] == ['1003']
for filename, records in [('comments-week.csv', selected), ('comments-date-unknown.csv', unknown)]:
    with open(filename, 'w', encoding='utf-8-sig', newline='') as output:
        writer = csv.DictWriter(output, fieldnames=list(rows[0]))
        writer.writeheader()
        writer.writerows(records)
~~~~

## 操作示例与核对

12 月 10 日有人在 11 月的产品教学下留言。作品查询覆盖 11 月到 12 月，再用表格仅保留 12 月 7—13 日评论。

## 需要核对的字段

params.since、params.until、params.commentsPerVideo、videoId、commentPublishedAt、commentText。

## 接口文档

- [微信视频号作品与评论](https://social2api.com/docs/api/wechat-channels-videos/)

## 相关用户讨论

- [用户讨论 · 微信视频号 · 同一视频号作品下，为什么自己发的新评论在其他账号看不到，旧评论却还能看见？](https://www.reddit.com/r/China_irl/comments/1py3oq5/)
- [相邻平台类比 · Reddit · Best way to export all posts (and comments) from a subreddit for a specific month?](https://www.reddit.com/r/redditdev/comments/1rdmhj7/best_way_to_export_all_posts_and_comments_from_a/)

## 相关指南和问答

- [如何批量获取微信视频号历史作品和评论并导出 CSV](https://social2api.com/guides/wechat-channels-export-videos-comments/)

[试取带评论时间的样本](https://social2api.com/#workspace/channels)
