API 文档

Reddit 评论回复 API

Reddit 评论回复 API 参数、分页、真实响应与计费说明。

测试 API

查询公开数据,使用明确的参数与真实响应示例。

打开产品页并测试
POST https://api.goanyapi.com/api/v1/reddit/post/comment/replies

请求与鉴权

同步 POST JSON 接口,不生成任务、无需轮询。使用 Authorization: Bearer YOUR_API_KEY。没有 Path 或 Query 参数。

输入参数

参数 位置 类型 必填 默认值 范围与说明
Authorization Header string 是 — Bearer YOUR_API_KEY
Content-Type Header string 是 application/json application/json
url JSON body string 是 — 完整资源链接,按接口填写 Threads 帖子、Reddit 帖子、版块或用户主页链接。 maxLength: 2048
commentId JSON body string 是 — 评论 ID,支持原始值或 t1_ 前缀。先调用 POST /api/v1/reddit/post/comments,以相同鉴权和帖子 url 获取 data.result.comments[].id;获取与目标查询各自按配置计费。 maxLength: 2048
sort JSON body string 否 CONFIDENCE 结果排序;完整取值见下方枚举,区分大小写。 enum: "CONFIDENCE", "TOP", "NEW", "CONTROVERSIAL", "OLD", "QA" maxLength: 2048
cursor JSON body string 否 — 首次不传;下一页将 data.result.next_cursor 原样传入,不自行构造游标。 maxLength: 16384

使用完整资源 URL 优先;Threads 用户接口也接受用户名或 @用户名,内部标识无需自行获取,不额外收费。first、count、limit 不作为公开输入,使用服务默认条数;实际返回可能更少。

sort

值 默认
"CONFIDENCE" 是
"TOP" —
"NEW" —
"CONTROVERSIAL" —
"OLD" —
"QA" —

获取评论 ID

先调用 POST /api/v1/reddit/post/comments,使用相同的 Bearer 鉴权,并在 JSON body 中传入帖子 url。该查询有独立计费,当前价格读取其数据库配置;空结果与失败免费。从 data.result.comments[].id 获取 commentId,再将该值与同一个帖子 url 传入本接口。不自动调用前置接口。

…

POST /api/v1/reddit/post/comments
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "url": "https://www.reddit.com/r/wallstreetbets/comments/1xy3kap/"
}

前置接口真实响应结构节选(省略其他评论、评论字段、计费与余额字段):

{
  "code": "ok",
  "data": {
    "result": {
      "comments": [
        {
          "id": "t1_19sqti9kye3cw"
        }
      ]
    }
  }
}

请求示例

POST /api/v1/reddit/post/comment/replies
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "url": "https://www.reddit.com/r/wallstreetbets/comments/1xy3kap/",
  "commentId": "t1_19sqti9kye3cw",
  "sort": "CONFIDENCE"
}

输出字段

成功返回 HTTP 200,业务数据位于 data.result。null、空字符串、空数组、缺失字段原样保留,不补造数据。false 和 0 是合法业务值,不等于空结果。

字段 类型 说明
code string 成功为 ok,失败为公开错误码
message string 请求状态说明
data.result object / null 实际公开结果,可为空
data.creditsUsed integer 本次实际扣费,空结果为 0;非空价格来自数据库
data.remainingCredits number 结算后的账户积分余额
data.result.comments array 实际公开业务字段;保留 null、空值与字段缺失
data.result.comments[].author string 实际公开业务字段;保留 null、空值与字段缺失
data.result.comments[].createdAt string 实际公开业务字段;保留 null、空值与字段缺失
data.result.comments[].depth number 实际公开业务字段;保留 null、空值与字段缺失
data.result.comments[].id string 实际公开业务字段;保留 null、空值与字段缺失
data.result.comments[].parentId string 实际公开业务字段;保留 null、空值与字段缺失
data.result.comments[].score number 实际公开业务字段;保留 null、空值与字段缺失
data.result.comments[].text string 实际公开业务字段;保留 null、空值与字段缺失
data.result.comments[].url string 实际公开业务字段;保留 null、空值与字段缺失
data.result.count number 当前页记录数,不是全部记录总数
data.result.has_more boolean 是否仍有后续结果;没有有效游标时不可自行构造分页
data.result.next_cursor null 下一页不透明游标;仅在非空、不同且允许继续时原样传回

分页与结果边界

首次不传 cursor。下一页保持相同筛选条件,将 data.result.next_cursor 原样传入 cursor。每页独立请求,只有非空成功结果计费。has_more 为 false、游标为空或与本页相同时停止;不猜造游标。

只返回指定评论的直接回复;更深层回复需以其评论 ID 再次查询。

真实响应示例

采集时间: 2026-11-18T09:32:00Z

保存自真实成功请求,完整保留公开结果列表。结构省略 data.creditsUsed 与 data.remainingCredits,实际响应包含按当前配置计算的费用与余额。保存示例不会请求或扣费;媒体地址可能过期。

{
  "code": "ok",
  "message": "ok",
  "data": {
    "result": {
      "comments": [
        {
          "id": "t1_19sqtviu58i2s",
          "parentId": "t1_19sqti9kye3cw",
          "author": "Craneteam",
          "score": 753,
          "depth": 1,
          "createdAt": "2026-11-16T23:19:56.477000+0000",
          "url": "https://www.reddit.com/r/wallstreetbets/comments/1xy3kap/comment/19sqtviu58i2s/",
          "text": "First vacation in years..."
        },
        {
          "id": "t1_19sqtpt3h29oi",
          "parentId": "t1_19sqti9kye3cw",
          "author": "chuy2256",
          "score": 316,
          "depth": 1,
          "createdAt": "2026-11-16T23:16:22.924000+0000",
          "url": "https://www.reddit.com/r/wallstreetbets/comments/1xy3kap/comment/19sqtpt3h29oi/",
          "text": "…And he was holding NVDA $300 Strike Price Calls for November 13"
        },
        {
          "id": "t1_19squvi8n2kci",
          "parentId": "t1_19sqti9kye3cw",
          "author": "pyronius",
          "score": 128,
          "depth": 1,
          "createdAt": "2026-11-16T23:42:21.068000+0000",
          "url": "https://www.reddit.com/r/wallstreetbets/comments/1xy3kap/comment/19squvi8n2kci/",
          "text": "And then were told that these were all unconnected one-off events"
        }
      ],
      "count": 3,
      "next_cursor": null,
      "has_more": false
    }
  }
}

计费

…

仅非空成功结果按数据库当前配置扣费;空结果和失败不扣费,内部标识处理不单独收费。每页独立结算;false、0 等合法结果不按空结果处理。

状态码

HTTP 含义
200 成功,包含免费空结果
400 JSON、参数或资源 URL 无效
401 未鉴权或凭证无效
402 积分不足
429 请求过于频繁,遵循 Retry-After
502 数据请求失败
503 接口或价格未配置