# Reddit comments API

Platform: Reddit.

Call `GET /v1/reddit/posts/{id}/comments` with the post ID. The answer is a tree: each comment holds its replies, and each reply holds its own.

You do not need a Reddit OAuth client or data access approval.

## GET /v1/reddit/posts/{id}/comments?sort=top

```bash
curl "https://api.openhandle.dev/v1/reddit/posts/synthetic/comments?sort=top" \
  -H "Authorization: Bearer $OPENHANDLE_API_KEY"
```

```ts
import { OpenHandle } from '@openhandle/sdk';

const openhandle = new OpenHandle({ apiKey: process.env.OPENHANDLE_API_KEY! });
const page = await openhandle.reddit.post('synthetic').comments.list({ sort: 'top' });

const walk = (comments: typeof page.data, indent = '') => {
    for (const comment of comments) {
        console.log(indent + comment.author?.handle, comment.metrics.score, comment.text);
        walk(comment.replies, indent + '  ');
    }
};
walk(page.data);
```

200 OK:

```json
{
  "platform": "reddit",
  "resource": "comment",
  "capturedAt": "2026-09-19T09:20:31Z",
  "source": "live",
  "data": [
    {
      "id": "t1_reddit1",
      "postId": "t3_reddit1",
      "parentId": "t3_reddit1",
      "depth": 0,
      "text": "Synthetic comment",
      "author": { "id": "t2_syn0001", "handle": "synthetic_reddit" },
      "metrics": { "score": 0 },
      "replies": []
    }
  ],
  "meta": { "cursors": { "next": null } }
}
```

Trimmed to one top-level comment. Replies nest inside `replies`, each with its own `depth`. The example is a Test post, so you can run it on a free Test key.

## What you get

- **Comments.** Each comment has `id`, `text`, the `author`, and its `score` in `metrics`.
- **A tree.** `depth` is 0 for a top-level comment. `parentId` is the post for top-level comments and the parent comment below that.
- **Sort.** Use `sort` with `confidence`, `top`, `new`, `controversial`, `old`, or `qa`, as on Reddit.
- **Size.** Pass `depth` to limit how deep the tree goes and `limit` to cap comments per level.

## Price

- **Per request.** $0.0025 per live request. $0.002 per request after 100,000 requests in a month. One page of results is one request.
- **Older data costs less.** Set `freshness` to say how old the data may be. Data up to 24 hours old: $0.0005. Data up to 7 days old: $0.0001. Data up to 30 days old: free.
- **Failed means free.** Errors and invalid requests are never billed. You pay for answers, and a confirmed not-found is an answer.
- **Free to start.** Every new workspace starts with 100 free live requests, no card needed. Test keys are never charged.

## When this does not work

These answers are definitive. Store them, do not retry them.

| Situation | Status | Code |
|---|---|---|
| The post was deleted or removed | 404 | `POST_NOT_FOUND` |
| The subreddit is private, quarantined, or banned | 403 | `PROFILE_PRIVATE` |
| The identifier is malformed | 400 | `INVALID_IDENTIFIER` |

```json
{
  "error": {
    "code": "POST_NOT_FOUND",
    "message": "This post was not found.",
    "requestId": "req_01j8…",
    "retryable": false
  }
}
```

A locked or archived post still returns its comments. It just cannot get new ones.

## Related

- [Reddit API](https://openhandle.dev/apis/reddit): Every Reddit endpoint with examples.
- [List post comments](https://openhandle.dev/docs/api-reference/reddit-post-comments-list): The endpoint reference with every parameter and SDK.
- [How do I get the comment thread of a Reddit post?](https://openhandle.dev/questions/how-do-i-get-the-comment-thread-of-a-reddit-post): Sort orders, trees, and when to read a thread.
