Reddit 数据查询工具,通过 MaxHub API 接入 Reddit 社区平台,覆盖 Subreddit 版块信息、Home / Popular / Games / News / Explore / Topic 多类 Feed、帖子详情与批量、评论与子回复、用户资料 / 帖子 / 评论 / 奖杯、综合搜索与社区亮点等全部能力。专注服务于海外社区舆情监控、产品反馈采集、Reddit KOL 追踪与趋势话题挖掘业务,帮助用户快速捕捉用户原声、识别上升期 subreddit、量化产品口碑。
> ### 📋 数据传输与隐私声明(请认真阅读)
>
> 1. 第三方传输:您提供的所有 ID、关键词、链接、cookie 等参数都会通过 HTTPS 发送到 https://www.aconfig.cn(MaxHub 数据服务)进行处理。
> 2. UGC 隐私:拉回的评论 / 弹幕 / 动态 / 私信 / 联系人等内容可能包含个人信息或敏感 UGC,请勿写入未授权的数据库或公开发布。
> 3. 凭证保护:建议使用独立测试账号、定期轮换 API Key;禁止传入主力生产账号的 cookie 或 session 凭证。
> 4. 合规责任:使用方需自行确保符合所在地区的数据保护法律(《个人信息保护法》/ GDPR / 平台 ToS 等),平台账号的合规性由使用方承担。
请前往 MaxHub 控制台 注册账号并获取 API Key。
方案 1:OpenClaw 配置
将 MAXHUB_API_KEY 添加到 ~/.openclaw/openclaw.json 中:
{ "env": { "MAXHUB_API_KEY": "ak_xxxx..." } }
方案 2:终端环境变量
export MAXHUB_API_KEY="ak_xxxx..."
本 Skill 不需要额外脚本依赖,所有调用通过 curl 完成 HTTP 请求即可,无第三方库依赖。
| 环境变量 | 说明 | 是否必填 | 获取方式 |
|---|---|---|---|
| --- | --- | --- | --- |
MAXHUB_API_KEY | MaxHub 数据 API Key | 是 | MaxHub 控制台 |
> 此小节定义 agent 在每次接到用户请求时的标准决策流程。严格按此顺序执行可大幅提升命中率与减少误调用。
| 步骤 | 何时读 | 加载文件 | 估算 token |
|---|---|---|---|
| ------ | ------- | --------- | ----------- |
| ① 永远先读 | 接到任何请求时 | SKILL.md §0.1(不支持清单)+ §4(本节) | ~1K |
| ② 选择 recipe | 用户语义清晰时 | references/recipes/_index.md(仅索引) | ~1.5K |
| ③ 加载 recipe 详情 | 匹配到具体 recipe 时 | references/recipes/ 的对应段落 | ~500/段 |
| ④ 加载端点详情 | 自定义链路或参数不明时 | references/ 单文件 | ~3K |
| ⑤ 路径白名单校验 | 调用前 | grep '(禁止整体读) | ~50 行 |
| ⑥ 跨端点字段路由 | 链式调用时 | references/param-mappings.md § 字段流字典 | ~1K |
references/recipes/_index.md,扫 trigger_keywords 列references/atoms/_index.md,按 chain_role 列定位起点(starter)和终点(terminal)⭐⭐⭐ 首选 标记的端点;不到必要不用 ⭐ 条件 端点param-mappings.md § 字段流字典 决定,禁止自行猜 json_path| 端点 risk | 必做自检 | 步骤数 |
|---|---|---|
| ---------- | --------- | ------- |
risk: low | ① 路径在 endpoints_whitelist.yaml | 1 步 |
risk: medium | ① 路径 ② method ③ 必填参数 ④ 写入确认 | 4 步 |
risk: high | 4 步 + 显式向用户确认参数与意图 | 5 步 |
risk: critical(restricted) | 6 步高风险确认流程(详见 §高风险能力清单) | 6 步 |
> 旧 SKILL 强制所有调用都做 4 步——现按 risk 等级简化。low 端点(占绝大多数)只校验路径即可。
| 现象 | 行动 | 重试 |
|---|---|---|
| ------ | ------ | ------ |
| 404 / 410 | §3.1(A) 5 步防臆造自检 → 通过才 STOP;禁止自改路径段重试 | 0 |
| 400 / 422 | §3.1(B) 6 步防参数臆造自检 → 通过才修参重试 | ≤1 |
| 401 / 402 / 403 | STOP,告知用户去 https://www.aconfig.cn 处理 | 0 |
| 429 | 读 Retry-After 退避;无该头时指数退避+jitter | ≤2 |
| 5xx | 等 3 秒重试 → 仍失败走端点级"降级/替换" | 1 |
HTTP 200 + code != 0 | 读 message_zh 报告用户;不重试(业务错误重试无用) | 0 |
https://www.aconfig.cn 三方接口| 规则 | 说明 |
|---|---|
| ------ | ------ |
| 🔒 只读 | 本技能仅用于数据查询和分析,不执行写入 / 账户操作(点赞、评论、发帖一律不可) |
| 🚫 禁止臆造路径 | 仅使用 references/endpoints_whitelist.yaml 中的端点,不得自行拼接、加版本号、加路径段 |
| 📋 数据流向第三方 | 所有请求发送至 https://www.aconfig.cn,请使用独立测试账号并定期轮换 API Key |
| 🔑 凭证保护 | 不暴露 API Key、Cookie、Token 至日志或对话 |
| 🔀 ID 区分 | subreddit_id(t5_xxx)与 subreddit_name(如 r/AskReddit)参数不同名,严禁混用 |
Step 1 — 检查 API Key
[ -n "${MAXHUB_API_KEY:-}" ] && echo "ok" || echo "missing"
若返回 missing,停止并提示用户配置 MAXHUB_API_KEY。
Step 2 — 匹配意图 → 选择 reference
按用户目标从下表选择对应 reference 文件,每个文件自包含其领域的全部端点定义:
| 用户目标 | 加载文件 | 覆盖范围 |
|---|---|---|
| --------- | --------- | --------- |
| 查 Feed / 帖子详情 / 评论 / 回复 / 精简数据 | references/content.md | Home/Popular/Games/News/Explore/Topic Feed、帖子详情、评论、回复、Reddit Answers(13 端点) |
| 查 Subreddit / 信息 / 设置 / Feed / 频道 / 静音 | references/subreddit.md | 版块样式、Channels、信息、设置、Feed、静音检查(6 端点) |
| 查用户 / 帖子 / 评论 / 奖杯 / 活跃社区 | references/user.md | 用户资料、活跃 Subreddit、用户帖子、用户评论、奖杯(5 端点) |
| 搜索 / 自动补全 / 社区亮点 / 热门搜索 | references/search.md | 搜索自动补全、动态搜索、社区亮点、热门搜索(4 端点) |
| 跨端点参数查询 / 字段流追溯 | references/param-mappings.md | 全局红线 + 端点路由 + 字段流字典 + 错误处理总览 |
| 路径白名单硬校验 | references/endpoints_whitelist.yaml | 28 端点的硬白名单 + Pre-call 4 步自检协议 |
Step 3 — 构建最小调用计划
fetch_user_profile 单点试探,再决定是否拉评论 / 帖子Step 4 — 执行并验证
endpoints_whitelist.yaml 完成 4 步 Pre-call 自检(路径 → method → 必填 → 写入确认)message_zh 报告用户,不重试| 用户场景 | 链路 | 字段流 |
|---|---|---|
| --------- | ------ | ------- |
| 搜索 → 帖子详情 | fetch_dynamic_search → fetch_post_details | query → post_id |
| 查帖子 + 评论 + 回复 | fetch_post_details → fetch_post_comments → fetch_comment_replies | post_id + cursor 接力 |
| 查 Subreddit + Feed | fetch_subreddit_info → fetch_subreddit_feed → fetch_post_details | subreddit_name → post_id |
| 查 Subreddit + 设置 | fetch_subreddit_info → fetch_subreddit_settings | subreddit_id(t5_xxx)接力 |
| 查用户 → 帖子 + 评论 | fetch_user_profile → fetch_user_posts + fetch_user_comments + fetch_user_active_subreddits | username 复用 |
| Explore → Topic Feed | fetch_explore_feed → fetch_topic_feed | topic_id 接力 |
| 批量帖子精简数据 | fetch_post_details_batch → fetch_generated_posts | post_ids 复用,输出 LLM 友好结构 |
> ⚠️ ID 陷阱:Reddit 同时存在 subreddit_id(前缀 t5_,用于 settings / muted / community_highlights)与 subreddit_name(如 AskReddit,用于 Feed / info / channels),两类 ID 不可互换。
收到 404 时(A):
subreddit_id vs subreddit_name)→ 有清单外参数 STOP收到 400 / 422 时(B):
post_id 不带 t3_ 前缀;subreddit_id 必带 t5_ 前缀)fetch_comment_replies 需 post_id + cursor 双必填)limit 用到 MaxHub 的 page_size)message_zh 排查| 场景 | 推荐用法 |
|---|---|
| --- | --- |
| 给 LLM 做摘要 | 用 fetch_generated_posts / fetch_generated_comments,自动剥离冗余字段 |
| 全量审计 / 数据归档 | 用 fetch_post_details_batch / fetch_post_details_batch_large,保留全字段 |
| 单帖深读 | 用 fetch_post_details,含 include_comment_id 锚定具体评论 |
| 触发条件 | 推荐操作 |
|---|---|
| --------- | --------- |
| 合法路径持续 404 / 410 | skillhub upgrade maxhub-reddit(国内)或 clawhub upgrade maxhub-reddit(国际) |
| 用户问"版本是多少" | 当前版本 v3.7.2,访问 https://skillhub.cn/skills/maxhub-reddit |
| 多端点连续 410 | skillhub upgrade maxhub-reddit --force |
| 401 / 402 / 403 | 不是版本问题,去 https://www.aconfig.cn 处理 |
| 场景 | 命令 | ||
|---|---|---|---|
| --- | --- | ||
| 查 API Key | `[ -n "${MAXHUB_API_KEY:-}" ] && echo "ok" \ | \ | echo "missing"` |
| 查帖子详情 | curl -H "$maxhub_auth_header" "https://www.aconfig.cn/api/v1/reddit/app/fetch_post_details?post_id=xxx" | ||
| 查帖子评论 | curl -H "$maxhub_auth_header" "https://www.aconfig.cn/api/v1/reddit/app/fetch_post_comments?post_id=xxx" | ||
| 查 Subreddit Feed | curl -H "$maxhub_auth_header" "https://www.aconfig.cn/api/v1/reddit/app/fetch_subreddit_feed?subreddit_name=AskReddit" | ||
| 查用户资料 | curl -H "$maxhub_auth_header" "https://www.aconfig.cn/api/v1/reddit/app/fetch_user_profile?username=xxx" | ||
| 检查 SKILL 更新 | skillhub info maxhub-reddit 或 clawhub info maxhub-reddit |
用户输入:「帮我看 某个 subreddit 的热帖」
Agent 执行步骤:
references/recipes/_index.md → 找到 trigger 命中 → 选最长匹配的 recipereferences/recipes/.md 中对应段落,拿到 Inputs / Atomic Steps / Outputgrep 一下 endpoints_whitelist.yaml 确认存在$.data.bvid)按 recipe 的 extract 列绑定为变量,传给下游端点反例(agent 不要这么做):
endpoints_whitelist.yaml(大文件,浪费上下文)extract 列,自己猜 json_pathfetch_dynamic_search 关键词搜索 → 取 post_id → fetch_post_details 取详情 + fetch_post_comments 深挖评论;并行 fetch_subreddit_feed 监控自有品牌专属版块fetch_subreddit_feed 翻页取热门帖 → fetch_post_details_batch 批量补详情 → fetch_generated_comments 输出精简评论喂给 LLM 做主题聚类fetch_subreddit_feed 抽取高赞帖作者 → fetch_user_profile + fetch_user_active_subreddits 看活跃度 → fetch_user_posts + fetch_user_comments + fetch_user_trophies 评估历史贡献fetch_trending_searches 取全站热搜词 → fetch_explore_feed 取多元话题 → fetch_topic_feed 按 topic_id 深挖 → 对热帖 fetch_post_details 取上下文maxhub-reddit/
├── SKILL.md # Skill 定义与使用文档(本文件)
├── README.md # 英文项目说明
├── README_CN.md # 中文项目说明
├── _meta.json # 版本元信息(version: 3.7.2)
└── references/
├── endpoints_whitelist.yaml # 28 端点路径硬白名单 + Pre-call 4 步自检协议
├── param-mappings.md # 中枢索引(全局红线 + 字段流字典 + 错误处理)
├── content.md # 内容域:Feed/帖子/评论/回复/精简数据(13 端点)
├── subreddit.md # 版块域:信息/样式/设置/Feed/Channels/静音(6 端点)
├── user.md # 用户域:资料/活跃社区/帖子/评论/奖杯(5 端点)
└── search.md # 搜索域:自动补全/动态搜索/社区亮点/热门搜索(4 端点)
| 组件 | 技术 | 说明 |
|---|---|---|
| ------ | ------ | ------ |
| 调用方式 | curl + Bearer Token | HTTP GET 请求,参数通过 query string 传递 |
| 数据接口 | MaxHub API | https://www.aconfig.cn/api/v1/reddit/app/*,通过 MAXHUB_API_KEY 鉴权 |
| 路径校验 | YAML 硬白名单 | endpoints_whitelist.yaml 提供 28 端点的逐字符校验 + 4 步 Pre-call 协议 |
| 错误处理 | 决策表 + 自检清单 | HTTP 状态码权威定义 + 防臆造自检(A/B 双轨)+ 端点替换矩阵 |
| 输出格式 | JSON Standard MaxHub Response | {code, message, message_zh, data, cache_url} |
| 更新通道 | SkillHub / ClawHub / GitHub | 国内 ⭐⭐⭐ SkillHub(腾讯云 CDN)/ 国际 ⭐⭐⭐ ClawHub / 降级 GitHub |
| 领域 | 端点数 | Reference 文件 |
|---|---|---|
| ------ | -------- | --------------- |
| 内容(Feed / Posts / Comments / Generated) | 13 | content.md |
| 版块(Subreddit) | 6 | subreddit.md |
| 用户(User) | 5 | user.md |
| 搜索(Search) | 4 | search.md |
| 合计 | 28 | — |
subreddit_id(t5_xxx)与 subreddit_name(AskReddit)严格区分,每个端点明确标注必填项类型共 10 个版本