All questionsReddit

How do I get the comment thread of a Reddit post?

Call GET /v1/reddit/posts/{id}/comments. The response is the comment tree as Reddit shows it: each comment carries its depth, its parentId, and a replies array with the comments under it. Pick sort=confidence for Reddit’s default order, or top, new, controversial, old, or qa.

The post ID is the t3_ value from a subreddit listing or a search result. If you start from a URL, pass it to the fetch endpoint first and read id from the post it returns.

Checked September 2026 · request and response run against the API · no affiliate links

GET /v1/reddit/posts/{id}/comments?sort=top
curl "https://api.openhandle.dev/v1/reddit/posts/synthetic/comments?sort=top" \
  -H "Authorization: Bearer $OPENHANDLE_API_KEY"
TypeScript SDK
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
{
  "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.

Sort orders and what they mean

sortWhat Reddit shows
confidenceReddit’s default "best". Weighs score against vote count so a new comment with two upvotes can beat an old one with ten upvotes and eight downvotes.
topHighest score first. The usual pick for "what did the room agree with".
newNewest first. The pick for monitoring a thread as it grows.
controversialComments with many votes both ways.
oldOldest first. Reads the thread in the order it happened.
qaQ&A mode. Replies from the post author are lifted, as in an AMA.

Trees, depth, and limits

  • It is a tree, not a list. Walk replies recursively. depth starts at 0 for a top-level comment. parentId is the post for top-level comments and the parent comment below that.
  • Reddit caps the tree. A huge thread is not returned whole. Pass depth to limit how deep the tree goes and limit to cap comments per level. Reddit itself collapses long threads behind "load more" for the same reason.
  • Deleted and removed. A comment the author deleted or a moderator removed shows with no text and no author, as Reddit shows it. The tree keeps its shape so replies under it still make sense.

Let a thread settle

Comments keep arriving for a day or two after a post. Scores keep moving for longer. For a report, read the thread once after 48 hours with sort=top. For monitoring, read with sort=new on a schedule, store each comment id, and skip the ones you have. Store capturedAt with every read. Reddit endpoints are in beta.

When this does not work

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

SituationStatusCode
The post was deleted or removed404POST_NOT_FOUND
The subreddit is private, quarantined, or banned403PROFILE_PRIVATE
The identifier is malformed400INVALID_IDENTIFIER
404 Not Found
{
  "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. Every new workspace starts with 100 free live requests, no card needed.

Read next

More Reddit questions

Send your agent ahead.

Paste the prompt into your agent and it sets everything up. Or come yourself, it takes five minutes.

For agents