FetchLayer fetchlayer.dev Sign in

Integration Guide

· Updated August 4, 2026

How to Get All Comments from a Reddit Post (Complete Thread)

Reddit's API truncates comment trees. Here's how to get the full thread from any post — with code examples and method comparison.

Written by Alex P.

  • reddit comments
  • reddit API
  • comment tree
  • reddit scraping
  • full thread

Getting all comments from a Reddit post sounds simple. It’s not.

Reddit’s approved OAuth API truncates comment trees by design. Its legacy unauthenticated JSON endpoints did the same before Reddit broadly blocked them on May 30, 2026. Deeply nested replies are replaced with "more" stubs — placeholder objects that say “there are more comments here, make another request to fetch them.” A popular post with 500 comments might return 50 top-level comments on the first call, with dozens of "more" stubs hiding the rest.

If you need the full comment thread — for analysis, archiving, sentiment analysis, or feeding into an AI — here’s how to actually do it.


Why Reddit Truncates Comments

Reddit’s comment rendering uses a tree structure. When a thread is long or deeply nested, the API returns a partial tree with "kind": "more" nodes. Each "more" node contains a list of comment IDs that weren’t included.

To get those missing comments, you need to:

  1. Parse the response to find all "more" stubs
  2. Extract the comment IDs from each stub
  3. Call /api/morechildren for each batch (max 100 IDs per request)
  4. Merge the results back into the tree
  5. Repeat if the newly fetched comments contain their own "more" stubs

This is tedious, slow (each call eats into your rate limit), and easy to get wrong. A 1,000-comment thread can require 10+ API calls just for the comments.


Method 1: Legacy JSON Endpoint (Blocked and Incomplete)

Before May 30, 2026, you could append .json to a Reddit post URL. Unauthenticated requests are now broadly blocked and usually return 403 Forbidden, so this example is historical and should not be used in new code:

const res = await fetch(
  'https://www.reddit.com/r/AskReddit/comments/abc123/whats_your_opinion.json',
  { headers: { 'User-Agent': 'MyApp/1.0' } }
);
const [postData, commentData] = await res.json();

// Top-level comments (many will be missing)
const comments = commentData.data.children;

// Check for truncation
const moreStubs = comments.filter(c => c.kind === 'more');
console.log(`Got ${comments.length} items, ${moreStubs.length} "more" stubs hiding additional comments`);

Problems:

  • Unauthenticated access is broadly blocked and usually returns 403
  • Only returns the first ~200 comments (Reddit’s default)
  • Nested replies beyond 2-3 levels are replaced with "more" stubs
  • No built-in way to expand stubs without OAuth
  • Before the shutdown, unauthenticated access was limited to roughly 10 req/min

Method 2: PRAW’s replace_more() (Approved Apps Only)

PRAW has a replace_more() method that automates the stub expansion, but it works only with an approved Reddit OAuth app. PRAW does not supply credentials, and new developers generally cannot obtain approval. Treat this as an option for existing credential holders, not a new-project solution:

import praw

reddit = praw.Reddit(client_id="...", client_secret="...", user_agent="...")
submission = reddit.submission(url="https://www.reddit.com/r/AskReddit/comments/abc123/")
submission.comments.replace_more(limit=None)  # Expand all stubs

all_comments = submission.comments.list()
print(f"Total comments: {len(all_comments)}")

Catches:

  • replace_more(limit=None) makes one API call per stub — a 1,000-comment thread can trigger 10-20 extra requests
  • Each call counts against your 100 req/min rate limit
  • Python-only
  • Requires an already-approved Reddit OAuth app; new approvals are effectively unavailable for most developers
  • Can take minutes on large threads
  • Non-commercial use only on the free tier

Method 3: FetchLayer API (Full Tree, One Call)

FetchLayer returns the complete comment tree in a single request — no stubs, no extra calls:

const res = await fetch('https://api.fetchlayer.dev/reddit/post', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk-your-api-key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    url: 'https://www.reddit.com/r/AskReddit/comments/abc123/whats_your_opinion/'
  })
});

const data = await res.json();

console.log(data.title);
console.log(`${data.comments.length} comments (full tree)`);

// Each comment has: author, body, score, timestamp, and nested replies
for (const comment of data.comments) {
  console.log(`${comment.author}: ${comment.body.slice(0, 80)}...`);
  if (comment.replies?.length) {
    console.log(`  └─ ${comment.replies.length} replies`);
  }
}

What’s different:

  • Returns the full comment tree, not a truncated version
  • No "more" stubs to expand
  • One API call regardless of thread size
  • Works from any language (JavaScript, Python, Go, etc.)
  • No Reddit credentials needed

Best for: Any use case where you need complete comment data — sentiment analysis, content research, AI training, archiving.


Method Comparison

Reddit JSONPRAWFetchLayer
Full comment treeNo (blocked; historically truncated)Yes (slow, multi-call)Yes (single call)
LanguageAnyPython onlyAny
Auth requiredUnauthenticated access broadly blockedAlready-approved Reddit OAuth appAPI key
Rate limit impact1+ calls per thread10-20+ calls per large thread1 call per thread
Commercial useNo (free tier)~$12K/yrFree tier + pay-per-use

If you need a single comment and its parent context (not the whole thread), use the comment-permalink endpoint:

const res = await fetch('https://api.fetchlayer.dev/reddit/comment-permalink', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk-your-api-key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    url: 'https://www.reddit.com/r/webdev/comments/abc123/post_title/def456/'
  })
});

const comment = await res.json();
console.log(comment.author, comment.body, comment.score);

Use Case: Feeding Comments into an AI

If you’re using an AI coding tool (Cursor, Claude Desktop, VS Code), you can skip the API code entirely. FetchLayer’s MCP server lets your AI agent fetch comment threads directly:

"Scrape all comments from this Reddit post and summarize the main opinions"

The agent calls the scrape_post tool, gets the full comment tree, and processes it inline.