Price alert Hurry up! Google SERP API from $0.03/1K API calls — prices likely to rise 10× from December 2026.Hurry up! Google SERP from $0.03/1K API calls — likely 10× from Dec 2026Google SERP $0.03/1K · likely 10× from Dec$0.03/1K · likely 10× in Dec Deposit Now

Get a Reddit thread's comments as JSON, flat or nested

By Anurag Pathak · · 11 min read

Call GET /api/reddit/comments with a subreddit and a post id, and you get that thread's comments as JSON. Add tree=true for nested replies; leave it off for a flat list. Each call returns up to 100 comments and is priced per started block of 25.

Short answer: use the flat form when the comments are going into a table or a script, and tree=true when you will draw a conversation; the comments are the same either way. Budget in blocks: limit 25 or less is one unit, from $0.059 per 1K API calls, pay as you go, no subscription (pricing). Always compare count with total_comments to see how much of the thread you hold. If you need every reply at every depth of a very large thread, pick a tool built to expand every "load more" placeholder, such as PRAW's replace_more() or an Apify actor with unlimited depth.

What does one call return?

I run Serpent, the API this site sells, so the examples below use it. One synchronous GET, one thread. You send two required parameters and two optional ones, and the response is a single JSON object with the comments inside it. The full parameter list is in the Reddit comments section of the docs; your key goes in the X-API-Key header as described under authentication.

Parameters of /api/reddit/comments, from the API reference (read 25 Nov 2026)
ParameterRequiredWhat it takes
subredditYesThe community name. python, r/python and /r/python are accepted
post_idYesThe post's base36 id, 4 to 10 characters. A t3_ prefix is accepted and stripped, and the id is lower-cased for you
limitNoAn integer from 1 to 100, default 25. It prices the call
treeNotrue, 1, yes or on returns the nested shape. Anything else, including leaving it out, returns the flat shape

A call has a 45-second time limit. Here is the request for a nested pull of 100 comments:

curl "https://apiserpent.com/api/reddit/comments?subreddit=python&post_id=1abcdef&limit=100&tree=true" \
  -H "X-API-Key: sk_live_your_api_key"

The documented response has five top-level keys. The ids and numbers below are the documented example, not a thread I pulled:

{
  "success": true,
  "post_id": "1abcdef",
  "subreddit": "python",
  "total_comments": 412,
  "count": 100,
  "comments": [ ... ]
}

count is how many comments this response holds. total_comments is something different, and the difference gets its own section below.

Every comment served is checked against the post_id you sent. If a single comment belongs to a different post, the whole call is a 404 instead of a mixed thread.

What is inside each comment?

Nine fields, documented with their types. Strings and integers can be null when the thread did not state them; award_count is 0 when there are none.

Comment fields in comments[], from the API reference (read 25 Nov 2026)
FieldTypeWhat it holds
idstring or nullComment id, without its t1_ prefix
authorstring or nullUsername, without u/
bodystring or nullThe comment text
scoreinteger or nullScore as stated
depthinteger or null0 on a top-level comment
parent_idstring or nullThe parent comment's id, prefix stripped. null on a top-level comment
created_atstring or nullISO 8601 timestamp, as the thread states it
permalinkstring or nullPath to the comment
award_countinteger0 when there are none

Two of those fields do the structural work. depth says how deep a comment sits and parent_id says which comment it answers, so you can rebuild a thread yourself from the flat list and nest at display time.

A flat comment looks like this. The values are illustrative; the keys are the documented ones:

{
  "id": "c2",
  "author": "example_user",
  "body": "Example comment text",
  "score": 12,
  "depth": 1,
  "parent_id": "c1",
  "created_at": "2026-01-01T00:00:00.000Z",
  "permalink": "/r/python/comments/1abcdef/example/c2/",
  "award_count": 0
}

Flat or nested: what does tree=true change?

It adds one key and moves nothing else. With tree=true, every comment gains a replies key: an array of comments in exactly the same shape, nested, and an empty array [] at a leaf. The flat form does not carry that key at all.

The set of comments is the same in both forms. The docs put it as "tree changes the arrangement, not the contents". One detail catches people out when they write a check: count is the total number of comments in both forms, not the number of top-level ones. A nested response with 5 comments and 2 top-level entries still says count: 5.

The switch does not change the price. If you pull flat today and want a tree tomorrow, you change one parameter.

How do I know I got the whole thread?

Compare count with total_comments. count is what this call returned. total_comments is the thread's own stated total, never our count of what came back. It is null when no total was stated, and it is never back-filled from count, which would turn "this call returned 100" into "the thread has 100".

That design is deliberate, and it is the honest answer for any Reddit comment tool, not only this one. A thread's stated total and the comments you can actually extract often differ. The PRAW documentation says so in plain words: "the value of submission.num_comments may not match up 100% with the number of comments extracted via PRAW". The call returns the comments it holds, deep replies are not guaranteed, and the two numbers tell you where you stand.

Here is a short Python check that walks a nested response, confirms the walk matches count, and flags a partial pull. It only handles the documented shape:

import os
import requests

API_KEY = os.environ["SERPENT_API_KEY"]


def get_comments(subreddit, post_id, limit=100, tree=False):
    params = {"subreddit": subreddit, "post_id": post_id, "limit": limit}
    if tree:
        params["tree"] = "true"
    r = requests.get(
        "https://apiserpent.com/api/reddit/comments",
        params=params,
        headers={"X-API-Key": API_KEY},
        timeout=60,
    )
    r.raise_for_status()
    return r.json()


def walk(comments):
    """Yield every comment in a tree=true response, depth first."""
    for c in comments:
        yield c
        yield from walk(c.get("replies", []))


data = get_comments("python", "1abcdef", limit=100, tree=True)
returned = sum(1 for _ in walk(data["comments"]))
print("count:", data["count"], "| walked:", returned, "| thread says:", data["total_comments"])

if data["total_comments"] is not None and data["count"] < data["total_comments"]:
    print("This call holds part of the thread. Store it as a partial pull.")

There is one more signal. When a response comes back short of what you asked for, it carries a delivery block with what was requested, what was returned and a reason. A complete answer carries no delivery key at all, so its presence alone tells you the response was short. A count of 0 on a 200 is a real answer (the thread held nothing) and it is charged like any other.

Where does the post_id come from?

From the two Reddit calls that list posts. The id field in /api/reddit/posts and in /api/reddit/search is the value this endpoint takes as post_id. The posts docs say it directly: this is what /api/reddit/comments takes as post_id.

A search result also carries a subreddit field, so one search row gives you both required parameters: search with /api/reddit/search?q=... (or list a community with /api/reddit/posts), take subreddit and id from the row, and send them as subreddit and post_id.

A search result is not a post record: it has no score, comment count or body. To size a thread before you spend on it, read num_comments from /api/reddit/posts first: a post that states 40 comments needs limit=50, two blocks, not 100. The Reddit search route post covers the search side.

What does a call cost as limit goes up?

Each started block of 25 comments is one unit. The documented rate buys 25 comments; ask for 26 and a second block starts, and the second block is charged the moment it starts. So limit=26 costs exactly what limit=50 costs. If you are choosing a limit, pick the top of a block: 25, 50, 75 or 100.

Blocks charged per call, from the API reference (read 25 Nov 2026)
limitBlocksCost as a multiple of the one-block rate
1 to 25 (default 25)11x
26 to 5022x
51 to 7533x
76 to 100 (the maximum per call)44x

Our lowest rate is from $0.059 per 1K API calls for one block of 25 comments, pay as you go, no subscription; the full ladder is on the pricing page, which I read on 25 Nov 2026. That page also says prices are likely to rise from December 2026, so re-read it on the day you budget rather than trusting a number in a blog post, including this one.

So limit=100 is four blocks, 4x the one-block rate. That is a price per call, not a promise of how many comments arrive, so read it next to the previous section.

The free tier counts calls, not blocks. A free-pool call consumes exactly one free unit whatever limit you send, and a free account has 10 free calls shared across services.

What gets charged when a call does not go to plan (API reference, read 25 Nov 2026)
What happenedCharged?
200 with the comments you asked forYes, the blocks you asked for
200 but short of limit (a delivery block is present)Yes. There are no partial refunds: limit=100 that returns 60 comments is charged four blocks
200 with count 0Yes. The thread held nothing, and that is an answer
400 for a missing or malformed parameter, such as a bad idNo. The reserved credit is released
404 because the post is not there or the comments do not match the postYes
502 or 504No. Credits are refunded automatically

Because a short pull is still charged for the blocks you asked for, set limit from what the thread states, not from a habit of always sending 100. The ledger at GET /api/billing/usage is the authority on what any call cost.

How do other comment APIs handle this?

I opened six pages that document or sell Reddit comment access on 25 Nov 2026. One thing stood out: PRAW, Apify and ScrapeCreators each say that very large threads need extra work from you or are not expanded by default. Apify's scraper page also lists 24 typed fields per comment, so a long field list is not what separates this endpoint; the flat-or-nested switch and the count check are.

Comment access as each page describes it (checked 25 Nov 2026)
ProviderHow you askNestingPrice shown on the page
Serpent APIGET with subreddit and post_id, limit 1 to 100tree=true nests the same commentsPer 1K API calls of one 25-comment block: Default $0.12, Growth $0.108, Scale $0.084, Enterprise $0.071, Enterprise Plus $0.059. Each further 25 is one more unit
Apify, Reddit comment scraper (brilliant_gum)Post URL, subreddit or keywordmaxDepth: 1 is top level only, 0 is unlimited$2.00 per 1,000 comments ($0.002 each), plus $0.01 per run
Apify, Reddit API by APISHurl, subreddit or post_idtree=1 adds comment_tree with replies and folded more_replies$4.00 per 1,000 credits; a comment call is 2 credits, so $0.008 by my arithmetic
Bright DataThe URL of a post or comment threadThe sample response shows num_replies and a replies field per comment; the page does not say how deep it nestsNot on that page
ScrapeCreatorsPOST with a post URL; one opaque cursor for more comments or repliesNot stated on the page I readNo per-request cost on that page; 100 free credits on sign-up
PRAW (open-source library)You write the codereplace_more() resolves "load more" placeholdersNone on the docs; Reddit's own terms not checked

PRAW is the clearest about the mechanics, because it exposes them. Its tutorial says "Each replacement requires one network request, and its response may yield additional MoreComments instances", and that by default replace_more() "only replaces at most 32 MoreComments instances". A big thread arrives with placeholders, and filling them costs requests. Write that loop yourself and you control the depth, and you also own the waiting and the bookkeeping.

The Apify comment scraper promises "every reply, every depth level, parent-child relationships preserved", and its own FAQ adds that very deep tail threads are "noted in the log but not auto-expanded by default". The APISH actor has the same tree idea as this endpoint, with a folded more_replies key for what it did not expand.

Bright Data's page tells you what to send, a thread URL, and says nothing on price. ScrapeCreators documents a cursor for paging comments and replies, with no per-request cost on the page.

Compare the unit before the number. Apify charges per comment scraped, APISH per call in credits, and this endpoint per call in blocks of 25. A small per-call price is a good deal only if the call returns what you need, which is why the count check matters more than the rate.

Which route should you pick?

Pick by what you will do with the comments, not by the lowest number on a pricing page.

You can try the call from the playground before writing code, and the Reddit API page lists the other four Reddit endpoints beside this one.

How we checked this

On 25 Nov 2026 I read six outside pages: two PRAW documentation pages (the comments tutorial and the CommentForest reference), two Apify actor pages, one Bright Data docs page and one ScrapeCreators endpoint page. Every claim about our endpoint comes from our API reference and our pricing page, read the same day. The response shapes shown are the documented ones, with made-up ids and values, and I did not call the endpoint to write this post.

What I could not verify: Reddit's own API documentation and current terms (the pages could not be opened, so nothing here describes Reddit's rules beyond what PRAW's docs say); how deep a real thread's replies come back on a live call, which is why the post tells you to compare count with total_comments; whether the Google results for this topic include pages I did not read; and the competitor prices, which I read through a page-reading tool rather than raw page text, so check them on the vendor pages before you rely on them.

Pull your first thread as JSON

Our lowest rate is from $0.059 per 1K API calls (one block of 25 comments), pay as you go, no subscription. Start with 10 free API calls, then compare count with total_comments on a thread you know.

Get Your Free API Key

Explore: Reddit API · Playground · Docs · Pricing

FAQ

How do I get the comments of a Reddit post as JSON?

Send a GET to /api/reddit/comments with the subreddit and the post's post_id, and set limit up to 100. The response lists the comments the call holds. Compare count with total_comments to see how much of the thread that is. Add tree=true if you want replies nested instead of a flat list.

What is the difference between count and total_comments?

count is the number of comments in this response, in both the flat and the nested form. total_comments is the thread's own stated total, and it is null when the thread did not state one. It is never filled in from count. If count is lower than total_comments, you hold part of the thread.

How much does it cost to pull 100 comments?

A limit of 100 is four blocks of 25. The rate is from $0.059 per 1K API calls for one block of 25 comments, so limit=100 is 4x that one-block rate. Prices were read on 25 Nov 2026 and the pricing page announces a likely rise from December 2026, so check the pricing page on the day you budget.

Can I get nested replies instead of a flat list?

Yes. Add tree=true (or 1, yes or on) and every comment gains a replies array in the same shape, with [] at a leaf. The comments themselves are the same as in the flat form, and the price is the same. Deep replies are not guaranteed, so check count against total_comments.

Is there a free way to try the comments endpoint?

A free account has 10 free calls shared across services, and one call to this endpoint uses exactly one free unit whatever limit you send. So a limit=100 call costs one free call, not four. Use that on a thread whose stated total you already know and see how count compares.

Can I pull thousands of comments from a thread in one call?

No. A call returns up to 100 comments and has a 45-second time limit. For a thread with several hundred comments, a single call gives you a slice; the stated total in total_comments shows how big the rest is. If you need the complete tree of a very large thread, a tool built to expand every "load more" placeholder, such as PRAW's replace_more(), is the better fit.

Related Posts