---
title: "Comments"
description: "获取 Reddit 帖子的评论树、某条评论下的回复，或用户的评论。"
---

```http
GET | POST /v1/reddit/comments
```

参数可以用 `GET` 的查询字符串发送，也可以用 `POST` 的 JSON 请求体发送，两者等价。

## 传入内容

| 传入 | 读取内容 | 说明 |
|---|---|---|
| `post` | 帖子的评论树 | 顶层评论及 Reddit 嵌套在其下的回复；帖子在 `ext.post` 中。`sort`：`confidence`（默认）、`top`、`new`、`controversial`、`old`、`qa` |
| `post` + `comment` | 某条评论下的回复 | 该评论及其嵌套的回复 |
| `username` | 用户的评论 | `sort`：`new`、`hot`、`top`、`controversial` |

每次调用只传一个来源。所有标识符也都接受页面 URL。

## 参数

| Parameter | Type | Required | Notes |
|---|---|---|---|
| `comment` | string |  | With `post`: the comment whose replies to load (base36 id or t1_ fullname) — e.g. one whose `moreReplies` says replies were held back. |
| `cursor` | string |  | Opaque cursor from the previous page's `cursor`. Pass it alone for the next page. |
| `limit` | integer 1–100 |  | Items per page, 1–100. |
| `period` | enum |  | Time window for sort top or controversial: hour, day, week, month, year or all. `hour` `day` `week` `month` `year` `all` |
| `post` | string |  | A post's comments: post id, fullname (t3_…) or URL. |
| `sort` | enum |  | Order. post: confidence (Reddit's 'best'), top, new, controversial, old, qa · username: new, hot, top, controversial. `confidence` `top` `new` `controversial` `old` `qa` `hot` |
| `username` | string |  | A user's comments: username or profile URL. |

## 请求

```bash tab="cURL"
curl "https://gateway.apinoa.com/v1/reddit/comments?post=1wtm5mp" \
  -H "x-api-key: $APINOA_API_KEY"
```

```js tab="JavaScript"
const params = new URLSearchParams({ post: "1wtm5mp" });
const res = await fetch(`https://gateway.apinoa.com/v1/reddit/comments?${params}`, {
  headers: { "x-api-key": process.env.APINOA_API_KEY },
});
const { success, data, error } = await res.json();
```

```python tab="Python"
import os

import requests

res = requests.get(
    "https://gateway.apinoa.com/v1/reddit/comments",
    params={"post": "1wtm5mp"},
    headers={"x-api-key": os.environ["APINOA_API_KEY"]},
)
body = res.json()
```

## 响应

在 `data` 中返回 [`Comment`](/docs/api-reference/sns/response-schema#comment) [`Page`](/docs/api-reference/sns/response-schema#page)。 真实响应的节选：数组只保留前几项，长文本已截断。

```json
{
  "success": true,
  "data": {
    "platform": "reddit",
    "items": [
      {
        "platform": "reddit",
        "id": "pcvg4r0",
        "url": "https://www.reddit.com/r/technology/comments/1wtm5mp/comment/pcvg4r0/",
        "postId": "1wtm5mp",
        "author": {
          "platform": "reddit",
          "handle": "bryancald",
          "avatarUrl": "https://styles.redditmedia.com/t5_21dyao/styles/profileIcon_snoo96d39f88-0d0d-4954-a766-4738a4900b3a-headshot.png?width…"
        },
        "text": "I truly hope this leads to the demise of McDonalds and any other company that uses this business model.",
        "createdAt": "2026-09-29T21:14:47.455Z",
        "replies": [],
        "moreReplies": {
          "count": 114,
          "cursor": "L4XGv5gQ_FjNqfTT50wyH8HLEFcVKbYmFyUeCUqK7sWTOyfFoRJhjidTb3_j1nbWbQFGMKsNt5HrRLGMOg0FKTXRRGR0E7PbYOr0toK3-hr569AwBmuPKON…"
        },
        "ext": {
          "fullname": "t1_pcvg4r0",
          "parentFullname": "t3_1wtm5mp",
          "depth": 0,
          "score": 2311,
          "awards": 4,
          "community": "technology"
        }
      }
    ],
    "cursor": "uLbhrTSCxojEb5jzOX2Bo3KUoyHedf6jaMv9hj7OlvK_HdPrLWt8_nE12KPBUV3ilwsATxuZi_45UdCtRMCxSMjSdrBmRFU_oHiRvSHt1R3A7S1Qzdg5n-J…",
    "ext": {
      "post": {
        "platform": "reddit",
        "id": "1wtm5mp",
        "url": "https://www.reddit.com/r/technology/comments/1wtm5mp/mcdonalds_is_reportedly_using_ai_to_dynamically/",
        "author": {
          "platform": "reddit",
          "handle": "AdSpecialist6598",
          "id": "cc0n0rs5"
        },
        "title": "McDonald's Is Reportedly Using AI To \"Dynamically\" Price Its Burgers",
        "createdAt": "2026-09-29T21:06:04.000Z",
        "media": [],
        "metrics": {
          "comments": 3406
        },
        "linkPreview": {
          "url": "https://www.engadget.com/2272211/mcdonalds-is-reportedly-using-ai-to-dynamically-price-its-burgers/",
          "domain": "engadget.com",
          "thumbnailUrl": "https://external-preview.redd.it/AQiUEhcGHE3YfA3sQBeQ19JM5rWJBxMI7qHIwZZXKCE.jpeg?auto=webp&s=b396d5d14e8ed04fcfdafd4db…"
        },
        "sensitive": false,
        "ext": {
          "fullname": "t3_1wtm5mp",
          "score": 19516,
          "ups": 19516,
          "upvoteRatio": 0.94,
          "numCrossposts": 6,
          "awards": 0,
          "flair": "Business",
          "flairTextColor": "dark",
          "flairTemplateId": "49cac61c-a816-11e9-be34-0ebbab5890a0",
          "kind": "link",
          "preview": {
            "source": {
              "url": "https://external-preview.redd.it/AQiUEhcGHE3YfA3sQBeQ19JM5rWJBxMI7qHIwZZXKCE.jpeg?auto=webp&s=b396d5d14e8ed04fcfdafd4db…",
              "width": 1600,
              "height": 898
            },
            "resolutions": [
              {
                "url": "https://external-preview.redd.it/AQiUEhcGHE3YfA3sQBeQ19JM5rWJBxMI7qHIwZZXKCE.jpeg?width=108&crop=smart&auto=webp&s=300b…",
                "width": 108,
                "height": 60
              },
              {
                "url": "https://external-preview.redd.it/AQiUEhcGHE3YfA3sQBeQ19JM5rWJBxMI7qHIwZZXKCE.jpeg?width=216&crop=smart&auto=webp&s=74aa…",
                "width": 216,
                "height": 121
              }
            ],
            "enabled": false
          },
          "thumbnailUrl": "https://external-preview.redd.it/AQiUEhcGHE3YfA3sQBeQ19JM5rWJBxMI7qHIwZZXKCE.jpeg?width=320&crop=smart&auto=webp&s=7d75…",
          "spoiler": false,
          "locked": false,
          "archived": false,
          "community": {
            "name": "technology",
            "id": "2qh16",
            "subscribers": 20595712,
            "type": "public"
          }
        }
      }
    }
  }
}
```

## 错误

| 状态 | 代码 | 含义 |
|---|---|---|
| 400 | `INVALID_CURSOR` | 该 `cursor` 不是本操作返回的。请不带它重新开始。 |
| 400 | `INVALID_PARAMS` | 参数缺失、未知或超出范围。消息中会指出是哪一个。 |
| 401 | `UNAUTHORIZED` | 缺少 `x-api-key` 请求头，或密钥已吊销或未知。 |
| 402 | `INSUFFICIENT_BALANCE` | 余额不足以支付本次调用。请在控制台充值。 |
| 404 | `NOT_FOUND` | 账号、帖子或分组不存在，或为私密、已删除、有年龄限制。 |
| 429 | `MARKETPLACE_SATURATED` | 并发调用过多。请等待 `Retry-After` 秒后重试。 |
| 502 | `UPSTREAM_ERROR` | 平台返回了无法使用的内容。请退避后重试。 |

全部错误代码见 [Errors](/docs/errors)。失败的调用不计费。

## 价格

**Price** $0.001 per call, plus $0.001 for each extra call it makes — at most 2 more, so $0.003 in total. [List price](https://apinoa.com/en/pricing); the rate steps down above 1,000 calls a day.

## 说明

- **帖子的评论按 Reddit 自己的分页返回。** 第一页包含 Reddit 的前 25 条评论及嵌套在其下的回复；每个 `cursor` 页加载下一批，与 Reddit 的“更多评论”一致。`ext.more.count` 表示尚未加载的顶层评论数。帖子的评论不适用 `limit`。
- **Reddit 暂未展开的回复。** 回复未全部包含的评论带有 `moreReplies.count`。将其 `id` 作为 `comment`（与同一个 `post` 一起）传入即可加载：返回该评论及其回复，`cursor` 继续加载它的直接回复。
- `comment` 接受 base36 id 或 `t1_` fullname。帖子中不存在的评论返回 `404 NOT_FOUND`。
- `period`（`hour` … `all`）适用于 `sort=top` 或 `sort=controversial` 的用户评论；`sort=hot` 仅用于用户评论。
