Sand AISand AI MAGI-2MAGI-2 hiện đã có trên SandBase: video 1080p với âm thanh gốcDùng thử ngay

Reddit User Comments

Tài liệu API
https://api.sandbase.ai/v1/api/reddit/app/user-comments

Returns a list of comments submitted by a specified Reddit user. Supports multiple sorting options, customizable page sizes, and pagination tokens.

Giá
$0.001USD / lượt gọi
Phương thức
POST
Phản hồi
JSON
Tham số
1 bắt buộc · 4 tùy chọn

Phòng thử nghiệm

Đầu vào
Reddit username
Pagination parameter for fetching next page
Whether to clean and format the data
Number of comments per page, default 25
Sort method, options: NEW (newest), TOP (top rated), HOT (hot), CONTROVERSIAL (controversial)
Đầu raVí dụ
Phản hồioutputs · 296 B · 17 dòng
[
  {
    "data": {
      "redditorInfoByName": {
        "__typename": "Redditor",
        "comments": {
          "edges": [],
          "pageInfo": {
            "__typename": "PageInfo",
            "endCursor": null,
            "hasNextPage": false
          }
        }
      }
    }
  }
]

Ví dụ

Chọn một ví dụ để nạp đầu vào và kết quả của nó vào playground.

README API

Reddit User Comments API

Returns a page of comments written by one Reddit user, each with its text preview, score, creation time and the post it was made on. The only required input is username, and you can add sort, page_size and after to control the list.

Use cases

  • Pull the latest comments from an executive account such as spez to track public statements.
  • Find the posts and subreddits where a user comments most often.
  • Compare comment score values to spot the most upvoted or downvoted replies from a profile.
  • Page through a user's full comment history and store it for moderation or research review.

Request

curl -X POST "https://api.sandbase.ai/v1/api/reddit/app/user-comments" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "spez"}'

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

Parameters

NameTypeRequiredDescription
usernamestringYesReddit username
afterstringNoPagination parameter for fetching next page
need_formatbooleanNoWhether to clean and format the data
page_sizeintegerNoNumber of comments per page, default 25
sortstringNoSort method, options: NEW (newest), TOP (top rated), HOT (hot), CONTROVERSIAL (controversial)

Example response

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

{
  "redditorInfoByName": {
    "__typename": "Redditor",
    "comments": {
      "edges": [
        {
          "node": {
            "__typename": "Comment",
            "authorInfo": {
              "displayName": "spez"
            },
            "commentStats": null,
            "content": {
              "html": null,
              "preview": "Pretty simple. For people who are already coming to Reddit every week, we have t…"
            },
            "createdAt": "2026-10-29T22:42:06.463000+0000",
            "id": "t1_19ruo33ofgh8i",
            "postInfo": {
              "__typename": "SubredditPost",
              "id": "t3_1xiupuc",
              "subreddit": {
                "prefixedName": "r/RDDT"
              },
              "title": "Reddit Announces Q3’26 Earnings (plus AMA!)"
            },
            "score": -8
          }
        }
      ],
      "pageInfo": {
        "__typename": "PageInfo",
        "endCursor": "dDFfb3B0ZnlxbA==",
        "hasNextPage": true
      }
    }
  }
}

Response fields

FieldMeaning
redditorInfoByName.comments.edges[].node.idComment ID in the form t1_....
redditorInfoByName.comments.edges[].node.content.previewShortened text of the comment. The full text may be cut off with an ellipsis.
redditorInfoByName.comments.edges[].node.content.htmlHTML version of the comment. It was null in this response.
redditorInfoByName.comments.edges[].node.scoreScore of the comment. It can be negative.
redditorInfoByName.comments.edges[].node.createdAtTime the comment was created, as an ISO 8601 string with a +0000 offset.
redditorInfoByName.comments.edges[].node.authorInfo.displayNameUsername of the comment author.
redditorInfoByName.comments.edges[].node.postInfo.id / redditorInfoByName.comments.edges[].node.postInfo.titleID (form t3_...) and title of the post the comment was left on.
redditorInfoByName.comments.edges[].node.postInfo.subreddit.prefixedNameSubreddit of the post, such as r/RDDT. It is absent when postInfo.__typename is ProfilePost.
redditorInfoByName.comments.pageInfo.hasNextPagetrue when more comments are available after this page.
redditorInfoByName.comments.pageInfo.endCursorCursor for the last item on this page. Use it as after to get the next page.

Notes

  • Pass the endCursor value from pageInfo as after in the next request, and stop when hasNextPage is false.
  • Comments on a user's own profile post have postInfo.__typename set to ProfilePost and no subreddit object.
  • sort accepts NEW, TOP, HOT and CONTROVERSIAL. page_size defaults to 25.
  • To see the user's posts instead of comments, call Reddit User Posts.

Pricing

$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Khám phá thêm

APIs liên quan

Tất cả APIs
APIGiáPhản hồi
Reddit$0.001 mỗi lần gọiJSON
Reddit$0.001 mỗi lần gọiJSON
Reddit$0.001 mỗi lần gọiJSON
Reddit$0.001 mỗi lần gọiJSON
Reddit$0.001 mỗi lần gọiJSON
Reddit$0.001 mỗi lần gọiJSON

Hướng dẫn:Best Reddit API in 2026: Pricing Compared

Câu hỏi

FAQ

Làm thế nào để dùng API Reddit User Comments?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/reddit/app/user-comments với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.

API Reddit User Comments có giá bao nhiêu?

$0.001 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.

API Reddit User Comments chấp nhận những tham số nào?

Bắt buộc: username (string). Tùy chọn: after (string), need_format (boolean), page_size (integer) và sort (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.

API Reddit User Comments trả về gì?

Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.

Tôi có cần tài khoản nhà phát triển hoặc API key của Reddit không?

Không. Reddit User Comments chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Reddit.