Reddit App Fetch Post Comments

2.07 credits/call
ae_reddit_app_fetch_post_comments

## Purpose Retrieve comments for a specified Reddit post, with optional sorting, pagination, language preference, and data formatting. ## Inputs - **post_id** (required): An app-format post ID such as `t3_1ojnvca`. It must have the `t3_` prefix followed by 1–17 lowercase letters or digits; do not supply a post URL or an unprefixed ID. - **sort_type**: One of `CONFIDENCE`, `NEW`, `TOP`, `HOT`, `CONTROVERSIAL`, `OLD`, or `RANDOM`. Default: `CONFIDENCE`. - **after**: Cursor for fetching the next page, up to 4096 characters. Default: `""`. Reuse a cursor returned by a previous request; an example location is `$.data.postInfoById.commentForest.trees[-1].more.cursor`, when present. - **language**: Preferred response language as an IETF language tag, such as `en-US`. Default: `en-US`. Length: 2–16 characters; begins with 2–3 letters and may have hyphen-separated alphanumeric subtags of 2–8 characters each. - **need_format**: Whether to request cleaned and formatted data. Default: `false`. ## Returns and limitations Returns JSON with the comment result in `data`. The detailed comment structure is not fixed, and a single response is not guaranteed to include all comments. Use a returned pagination cursor for additional pages. ## Example `{"post_id":"t3_1ojnvca","sort_type":"CONFIDENCE","after":"","language":"en-US","need_format":false}`

Social
2.07 credits/call

Pricing

2.07 credits/call
ConditionCharge
Each call2.07 credits/call

The fixed fee per call is 2.07 credits. Charges are per query. A successful query is billed even if it returns no results.

Fetching more comments with a pagination cursor requires another call, which is charged separately.

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
afterstringNo分页参数/Pagination parameter for fetching next page""
post_idstringYes帖子ID/Post ID—
languagestringNo返回内容使用的语言,采用 IETF 语言标签;默认 en-US / Preferred response language as an IETF language tag; default: en-USen-US
sort_typeenum (CONFIDENCE | NEW | TOP | HOT | CONTROVERSIAL | OLD | RANDOM)No排序方式/Sort method: CONFIDENCE, NEW, TOP, HOT, CONTROVERSIAL, OLD, RANDOMCONFIDENCE
need_formatbooleanNo是否需要清洗数据/Whether to clean and format the datafalse

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key
Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_reddit_app_fetch_post_comments' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "language": "en-US",
    "need_format": true,
    "post_id": "t3_1xpa5hw",
    "sort_type": "TOP"
  }
}'
Response exampleresponse.json
JSONPartial content
{
  "code": 200,
  "data": {
    "postInfoById": {
      "commentCount": 78,
      "commentForest": {
        "pageInfo": {
          "commentCount": 71,
          "hasNextPage": true
        },
        "trees": [
          {
            "childCount": 2,
            "depth": 0,
            "node": {}
          }
        ]
      }
    }
  },
  "docs": "https://api.tikhub.io/#/Reddit-APP-API/fetch_post_comments_api_v1_reddit_app_fetch_post_comments_get",
  "message": "Request successful. This request will incur a charge.",
  "message_zh": "请求成功,本次请求将被计费。",
  "request_id": "70f78be9-0807-4f19-a47d-001af37a0e20"
}

This example shows part of the response. Copied content is valid JSON.