Reddit Comment Tree Scraper - Post Comments with Depth
Pricing
from $2.13 / 1,000 results
Reddit Comment Tree Scraper - Post Comments with Depth
Reads a Reddit post's comments from its link or its id and saves one flat row per comment, each carrying the depth and the parent Reddit states for it, so the thread rebuilds exactly. Every row also reports how much of the tree the run reached and how many branches were left unread.
Pricing
from $2.13 / 1,000 results
Rating
0.0
(0)
Developer
The Netaji
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Reddit Comment Tree Scraper
The Actor reads a Reddit post's comments and saves one flat record per comment, each carrying the depth and the parent Reddit states for it, so the nested thread can be rebuilt exactly from the saved rows. Every row also reports how much of the tree the run reached and how much was left, which is the part of a comment dataset that is easiest to get wrong. No Reddit account, application, or API credential is involved.
Accepted input
| Field | Required | Default | Notes |
|---|---|---|---|
post_id | yes | — | A base36 post id (1vqcqpz), a t3_ fullname, or a pasted permalink. A permalink also supplies the community. |
subreddit | no | — | Only needed when post_id is a bare id rather than a link. |
commentSort | no | — | top, new, controversial, or old. Empty asks for Reddit's own default order. |
maxItems | no | 100 | Comments to save. A tree is read in one request, so the effective ceiling is 200. |
Pasting the post's link is the reliable form. A post is addressed by its id together with the community it was posted in, and a link carries both in one string, so they cannot contradict each other. An id paired with the wrong community does not return an empty result; it fails. If both are supplied and they disagree, the link wins and the run log says so.
{"post_id": "https://www.reddit.com/r/technology/comments/1vqcqpz/example_title/","commentSort": "top","maxItems": 200}
Response fields
Each saved record carries kind, id, fullname, body, author, author_icon, score,
created_at, permalink, award_count, subreddit, post_id, post_fullname,
parent_fullname, depth, position, parent_positions, is_deleted, is_collapsed,
total_comments, tree_complete, unfollowed_branches, and truncated_threads.
{"kind": "comment","id": "p44qdpd","fullname": "t1_p44qdpd","body": "This is the comment text.","author": "example_user","score": 42,"created_at": "2026-08-14T09:41:07.000Z","permalink": "/r/technology/comments/1vqcqpz/example_title/p44qdpd/","post_id": "1vqcqpz","post_fullname": "t3_1vqcqpz","parent_fullname": "t1_ixbo2n8","depth": 1,"position": 3,"parent_positions": [1],"total_comments": 464,"tree_complete": false,"unfollowed_branches": 7,"truncated_threads": 2}
Rebuilding the thread
Comments are returned flat, in reading order, and the nesting is stated rather than implied. depth
is Reddit's own value for the comment, not something inferred from indentation, and
parent_fullname names the comment or post it replies to. Grouping rows by parent_fullname and
ordering each group by position reproduces the thread exactly. parent_positions gives the same
location as a path from the top of the tree, for consumers that prefer to sort on one column.
How much of the tree a run reaches
A comment tree is read in branches rather than in pages. Reddit serves the top-level batch together
with a separate continuation for each collapsed branch beneath it — a large thread can hand back
nineteen of them at once — and following one branch to its end says nothing about the other
eighteen. The Actor works through them in turn until maxItems is reached or the branches run out.
The result is that a run routinely returns part of the tree rather than all of it, and a partial tree that reads as complete is the failure this Actor exists to avoid. Four columns on every saved row make the difference visible without reference to the run log:
total_commentsis Reddit's own total for the post. It is the denominator, and it is normally larger than the number of rows saved.tree_completeistrueonly when every branch was read.unfollowed_branchescounts branches still waiting when the run stopped. A non-zero value means a largermaxItemswould return more comments.truncated_threadscounts sub-threads Reddit links to by address only, giving no way to continue them from inside the tree. These are not reachable at any value ofmaxItems; each needs its own run against the address in the sub-thread's own permalink.
The run log states the same thing in words, and warns rather than informs when the tree was left incomplete.
Sort order
commentSort accepts top, new, controversial, and old, and all four were checked against
the same post and returned content. Leaving it empty is not the same as choosing one: Reddit applies
its own default order to a thread nobody has re-sorted, and there is no value in the list that names
that order, so it is asked for by omitting the field rather than by guessing at a spelling for it.
Sort order changes which branches are read first, and therefore which comments a bounded run
returns. A run of 50 comments sorted by top and one sorted by new will not overlap much.
Deleted comments and absent fields
A comment Reddit reports as deleted keeps its position in the tree and keeps its replies, so it is
saved rather than dropped, with is_deleted set, body null, and no author. Removing it would
break the parent chain of everything beneath it. is_collapsed reports whether Reddit renders the
comment collapsed by default. Fields absent from the source are returned as null rather than
omitted, so the column set is the same in every record.
Failures and partial results
A post value that cannot be reduced to an id is rejected before any request is made, and a bare id with no community is rejected with a message saying why an id alone does not address a post. A post with no comments ends the run cleanly rather than failing — an empty thread is an answer.
Cost
Charging is per comment saved to the dataset, plus the platform's one-off Actor start event. Reading
deeper into a large tree costs more because it saves more, so maxItems is the direct control on
what a run costs.
Related Actors
- Reddit Post Details Scraper — the post itself: title, body, media, score, and Reddit's comment total, without the comments.
- Reddit Subreddit Feed Scraper — the posts of a community, to find threads worth reading.
- Reddit User Comment History Scraper — one account's comments across every thread, rather than one thread's comments across every account.
Support
Questions, bug reports, and requests for a field that is not here yet: thenetaji@proton.me.