Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Reddit Post Comments

API 文档
https://api.sandbase.ai/v1/api/reddit/post-comments

List the comments on a Reddit post by URL (author, body, score, timestamp, parent comment). Replies carry the parentId of the comment they answer.

价格
起价 $0.0006美元 / 次调用
方法
POST
响应
JSON
参数
1 个必填 · 1 个可选

Playground

输入
Full Reddit post URL on reddit.com. A gallery link (https://www.reddit.com/gallery/<id>) is read as the post it belongs to, and a relative permalink (/r/<subreddit>/comments/<id>/...) as the same path on https://www.reddit.com.
Cursor from a previous response for more comments.
输出就绪

您的输出将显示在这里

完成输入,然后点击运行。

API README

Reddit Post Comments API

Returns the comments on a Reddit post, with author, body, score, creation time and the parent comment for each reply. It needs the full URL of the post as url.

Use cases

  • Collect the replies to a popular AMA to study which questions got the most upvotes.
  • Rebuild a comment thread as a tree by matching each parentId to a comment id.
  • Pull the top-scored comments on a post to summarize what readers think.
  • Link each comment back to its page on Reddit using its url to review or moderate it.

Request

curl -X POST "https://api.sandbase.ai/v1/api/reddit/post-comments" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.reddit.com/r/IAmA/comments/z1c9z/i_am_barack_obama_president_of_the_united_states/"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
urlstringYesFull Reddit post URL on reddit.com. A gallery link (https://www.reddit.com/gallery/<id>) is read as the post it belongs to, and a relative permalink (/r/<subreddit>/comments/<id>/...) as the same path on https://www.redd
cursorstringNoCursor from a previous response for more comments.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "comments": [
      {
        "author": "Biinaryy",
        "body": "Here is a collection of all the questions and answers:\n\nQuestion: [Link](http://…",
        "createdUtc": 1346276659,
        "id": "c60o0iw",
        "parentId": "",
        "score": 5399,
        "url": "https://www.reddit.com/r/IAmA/comments/z1c9z/i_am_barack_obama_president_of_the_…"
      }
    ],
    "media": null,
    "nextCursor": "cur_E_QuTid3jKG5pjQCweyA_g"
  },
  "found": true
}

Response fields

FieldMeaning
data.comments[].authorReddit username of the person who wrote the comment.
data.comments[].bodyText of the comment. It uses Reddit markdown, so links and emphasis appear as markdown.
data.comments[].idID of the comment, for example c60o0iw. Replies point to it in parentId.
data.comments[].parentIdThe id of the comment this one answers. It is an empty string for a top-level comment.
data.comments[].scoreScore of the comment, as a number.
data.comments[].createdUtcCreation time of the comment as a Unix timestamp in seconds (UTC).
data.comments[].urlDirect link to the comment on reddit.com.
data.nextCursorCursor for the next page of comments. Send it as cursor in the next request.
data.mediaMedia attached to the post. It is null in this response.
foundtrue when the post was found. A lookup that finds nothing returns false.

Notes

Need to find a thread first? Search posts within one subreddit. Then follow the Python request walkthrough to read a selected thread without assuming complete comment coverage.

  • Copy the post URL from Reddit. A gallery link or a relative permalink such as /r/<subreddit>/comments/<id>/... also works.
  • To get more comments, repeat the request with the same url and the nextCursor value as cursor.
  • Comments are listed in a flat array. Use parentId to see which comment each reply answers.

Pricing

Billed at the actual cost of each call, about $0.0006 for the request above. Failed calls are not charged.

探索更多

相关 APIs

全部 APIs
API价格响应
Reddit每次调用从 $0.0006 起JSON
Reddit$0.001 每次调用JSON
Reddit$0.001 每次调用JSON
Reddit$0.001 每次调用JSON
Reddit$0.001 每次调用JSON
Reddit$0.001 每次调用JSON

指南:Best Reddit API in 2026: Pricing Compared

问题

常见问题

如何使用 Reddit Post Comments API?

向 https://api.sandbase.ai/v1/api/reddit/post-comments 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

Reddit Post Comments API 的价格是多少?

起价每次调用 $0.0006,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

Reddit Post Comments API 接受哪些参数?

必填:url (string)。 可选:cursor (string)。 Parameters 表和本页的 Playground 列出了每个字段。

Reddit Post Comments API 返回什么?

在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。

我需要 Reddit 开发者账户或 API key 吗?

不需要。Reddit Post Comments 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Reddit API 访问权限。

我应该向这个 Comments API 传入 post ID 还是 URL?

此端点将 Reddit 帖子 URL 作为 url 传入,另可带一个可选的 cursor。教程中请使用完整的公开帖子 URL。应用内 Post Comments 变体有不同的请求契约;不要把它的 post_id 或 after 参数复制到这里。

我如何保留回复关系并读取更多评论?

参考文档描述的是一个扁平的 data.comments 数组。将 parentId 与父评论的 id 对应;parentId 为空字符串表示顶层评论。引用的父评论可能不在你获取到的页面中,因此要保留这种缺失关系,而不是把回复当作顶层评论。如果返回了完整的 data.nextCursor,请将其作为 cursor 与相同的帖子 URL 一起发送。一次响应不能保证线程完整。

这个端点会做情感分析或搜索每一条 Reddit 评论吗?

不会。它只读取你提供的帖子 URL 的评论。情感解读是单独的分析步骤,而且抽样线程并不能代表整个社区。分数和用户名只是上下文,不是事实核验。请仅使用公开数据,并遵守适用的平台和使用规则。