Skip to content
forumdataapi.com
AI & RAG Pipelines · Tutorial6 min read·Updated 2026-11-05

Scraping Nested Reddit Comment Trees for LLM & RAG Pipelines

How to extract full multi-level Reddit discussion threads with explicit depth and parent_id pointers for AI sentiment analysis, RAG knowledge bases, and fine-tuning datasets.

$0.10 / 1K Posts · $0.10 / 1K Comments · $0.20 / 1K Lookups · No Card Required · Supports Stripe (Card / Apple Pay / Google Pay) & 0%-Fee Crypto

Instant Quickstart · Copy & Run in 30 Seconds

Fetch nested comments for a post

Execute in Live Playground →
import requests

res = requests.get(
    "https://api.forumdataapi.com/v1/posts/comments",
    params={"post_id": "1u0z4vz", "sort": "top", "limit": 100},
    headers={"x-api-key": "rd_live_your_api_key"},
)
comments = res.json()["data"]["items"]

Key Engineering Takeaways (TL;DR)

  • ✓GET /v1/posts/comments extracts up to 200 comments per call with depth (0, 1, 2...) and parent_id (t3_... or t1_...).
  • ✓Supports sorting by top, best, new, controversial, or old, plus offset cursor pagination for mega-threads.
  • ✓Costs 1 Credit per returned comment ($0.10 per 1,000 comments base rate, or $0.0575 per 1,000 on Pro).

1. Reconstructing Parent-Child Comment Threads

Every comment item includes comment_id (t1_...), parent_id, and integer depth so you can reconstruct the exact conversation tree or chunk threads for embeddings.

Unit cost to extract 200,000 nested comments across 1,000 Reddit threads
MethodHTTP Calls NeededTotal CostWall-Clock Time
ForumData API (/v1/posts/comments)1,000 calls (200/call)$20.00 ($11.50 Pro)~3.5 minutes
Official Reddit API + MoreComments15,000 – 40,000 calls$3.60–$9.60 + OAuth 100 QPM cap2.5 – 6.6 hours
Apify Comment Scraper Actor1,000 actor tasks$300.00+45+ minutes

Fetch nested comments for a post

Live response captured from /v1/posts/comments?post_id=1u0z4vz.

curl "https://api.forumdataapi.com/v1/posts/comments?post_id=1u0z4vz&sort=top&limit=100" \
  -H "x-api-key: rd_live_your_api_key"

Interactive Engineering Workbench · GET /v1/posts/comments

Verify real-time latency, pagination math & JSON schema

5,000 posts/day
10,000 comments/day
1,000 lookups/day
Our HTTP Calls/Day
1,100
Large page sizes
Legacy Provider Calls
1,400
30-item small pages
Official Research API
Exceeds 1K Cap
1,000 req/day limit
Estimated Monthly Pipeline Cost (30 Days)
$30.91/ mo with Business bonus ($51.00 base rate)
Daily consumption: 17,000 Credits ($1.70/day)
ForumData API (with volume bonus):$30.91 / mo
Legacy Scrapers ($1.50 / 1K calls):$63.00 / mo
Failed / 404 request fee:$0.00 (0 Credits)

Frequently Asked Questions

Can I pass a full Reddit post URL to /v1/posts/comments?
Yes. Both ?post_id=1u0z4vz and ?url=https://www.reddit.com/r/SaaS/comments/1u0z4vz/... are automatically normalized by the gateway.