How to Get All Comments from Reddit
Reddit truncates comment trees behind "load more" stubs. How to get the full thread from any post in Python, with PRAW or plain HTTP, without Reddit API approval.
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:
- Parse the response to find all
"more"stubs - Extract the comment IDs from each stub
- Call
/api/morechildrenfor each batch (max 100 IDs per request) - Merge the results back into the tree
- 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(), Pointed at FetchLayer
PRAW’s replace_more() already does the stub expansion for you. The problem is PRAW’s access: it needs an approved Reddit OAuth app, new developers can’t get one, and Reddit closes public API access in March 2027.
You can keep the PRAW code and change where it reads from. With four lines of praw.ini (~/.config/praw.ini on Linux and macOS, %APPDATA%\praw.ini on Windows), unmodified PRAW reads Reddit through FetchLayer’s PRAW-compatible API. You don’t need a Reddit app:
[DEFAULT]
oauth_url=https://praw.fetchlayer.dev
reddit_url=https://praw.fetchlayer.dev
client_id=ss-your-fetchlayer-key
client_secret=unusedimport praw
reddit = praw.Reddit(user_agent="my-app")
submission = reddit.submission(url="https://www.reddit.com/r/AskReddit/comments/abc123/")
submission.comments.replace_more(limit=None) # expand every "load more comments"
all_comments = submission.comments.list() # flattened, free
print(f"{len(all_comments)} of {submission.num_comments} comments")
for c in all_comments:
print(c.depth, c.author, c.score, c.body[:80])What it costs: the post with its first comment tree is 1 credit, and each “load more comments” that replace_more() expands is 1 more. replace_more(limit=None) on a thread with thousands of comments can mean many expansions, so set a limit (limit=32 is PRAW’s default) when you don’t need every reply. Setup details: Migrate PRAW to FetchLayer.
Best for: existing PRAW code, and Python users who like PRAW’s Comment objects.
Method 3: FetchLayer REST API (Any Language)
If you’re not using PRAW, the REST API returns the post and a nested comment tree as plain JSON. pages sets how many pages of top-level comments to load, and depth sets how deep to follow each thread:
import requests
API = "https://api.fetchlayer.dev/reddit"
HEADERS = {"Authorization": "Bearer ss-your-fetchlayer-key"}
post = requests.post(f"{API}/post", headers=HEADERS, json={
"url": "https://www.reddit.com/r/AskReddit/comments/abc123/",
"pages": 5, # pages of top-level comments; 1 credit each page returned
"depth": 5, # how deep to follow each thread
}, timeout=120).json()
def walk(comments):
for c in comments:
yield c
yield from walk(c.get("children", []))
comments = list(walk(post["comments"]))
print(post["title"], f"{len(comments)} comments loaded")Replies the response didn’t include are listed in moreComments, each with an expandToken. Pass a token to more-comments to load those replies (1 credit each):
for more in post["moreComments"]:
extra = requests.post(f"{API}/more-comments", headers=HEADERS,
json={"expandToken": more["expandToken"]}, timeout=120).json()
comments.extend(walk(extra["comments"]))What’s different:
- One request returns the post and a nested tree, with no
"more"stubs to parse yourself - Works from any language (JavaScript, Python, Go, etc.)
- No Reddit credentials needed
- Billed per page of comments actually returned (see
pagesScraped)
Best for: new code in any language, such as sentiment analysis, content research, archiving or feeding threads to an LLM.
Method Comparison
| Reddit JSON | PRAW + Reddit | PRAW + FetchLayer | FetchLayer REST | |
|---|---|---|---|---|
| Full comment tree | No (blocked; historically truncated) | Yes, via replace_more() | Yes, via replace_more() | Yes, via pages/depth + more-comments |
| Language | Any | Python | Python | Any |
| Auth required | Unauthenticated access blocked | Approved Reddit OAuth app (closing March 2027) | FetchLayer key | FetchLayer key |
| Cost | — | Free tier, non-commercial | 1 credit per post + 1 per expansion | 1 credit per page + 1 per expansion |
| Commercial use | No | Needs a Reddit agreement (pricing) | Yes | Yes |
Getting a Specific Comment by Permalink
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 ss-your-fetchlayer-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://www.reddit.com/r/webdev/comments/abc123/post_title/def456/'
})
});
const data = await res.json();
const c = data.focalComment; // plus ancestorComments for the parent chain
console.log(c.author, c.bodyText, c.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.