ai newsMo., 19. Okt.

What it costs to pull 1,000 Reddit comments into an AI agent, collapsed replies included

Ask an AI to summarise a long Reddit thread and it will usually work from whatever came back on the first request. On a thread with a few hundred comments, that is often well under half of the discussion. The rest sits behind Reddit's "more replies" and "continue this thread" links, and those colla

dev.toMontag 06:37 · 19.10.6 Min. Lesezeit
Bild: dev.to

Ask an AI to summarise a long Reddit thread and it will usually work from whatever came back on the first request. On a thread with a few hundred comments, that is often well under half of the discussion. The rest sits behind Reddit's "more replies" and "continue this thread" links, and those collapsed branches tend to hold the long back-and-forth arguments you actually wanted.

This post covers three things I get asked about when people compare Reddit data tools for research: whether collapsed branches really get expanded, what fields come back for each comment, and what 1,000 comments cost. I work on ProLevelMax, the data source used in the examples, so the numbers below are ours. The checklist at the end applies to any tool.

Reddit does not send a whole comment tree in one response. Past a certain depth or count it returns a stub that says, in effect, "there are more replies here, ask again with this cursor".

A scraper can handle that stub in two ways:

Both can be described as "supports nested comments". Only the second gets you the full thread. When you test a tool, count how many records in its output are placeholders.

There are two per-call sources for a single thread:

A collapsed branch comes back with a more.cursor value. Send that to procli_reddit_h and you get the replies under it. If those replies contain stubs of their own, do the same again. An agent connected over MCP does this when you ask for "all comments, including collapsed replies". In your own code you loop until no cursor is left.

For bigger jobs across many posts there is also a bulk source ( procli_reddit_a ) that runs searches, subreddits or URL lists in one job, with a per-post comment cap.

Deleted and removed comments come back the way Reddit shows them publicly, usually without text, and flagged so you can filter them out before counting.

Per-call route: every call is $0.003. Across our recent calls the Post comments source returned a median of 10 comments per call, so:

1,000 comments ≈ 100 calls × $0.003 = $0.30 Enter fullscreen mode Exit fullscreen mode Each collapsed branch you expand is one more $0.003 call, so deep threads cost somewhat more than that.

Bulk route: $0.0108 per result plus $0.06 per run.

1,000 results in one run = 1,000 × $0.0108 + $0.06 = $10.86 Enter fullscreen mode Exit fullscreen mode The bulk route costs more per comment but covers many posts in one job. For reading a limited set of threads in full, the per-call route is cheaper. Every run is quoted before it starts and the charge never goes above the quote. Current prices are on the pricing page.

This pages through a post's comments, then expands every collapsed branch it finds, and stops if anything would need a confirmation (quotes above $0.10). It does not assume the exact nesting of the response: it walks the JSON and picks up anything that looks like a comment ( id starting with t1_ ) or a stub ( more.cursor ).

import json, sys, time, requests API = " https://prolevelmax.com/v1 " H = { " Authorization ": " Bearer sk_procli_... " } POST = " t3_1abcde " # the post you want def run ( scraper, inp ): q = requests. post ( f " { API } /inspect ", headers = H, json = { " scraper ": scraper, " input ": inp }). json () if q [ " quote " ][ " needsConfirmation " ]: sys. exit ( f " Quote is { q [ ' quote ' ][ ' maxChargeDisplay ' ] }, stopping for review " ) time. sleep ( 1.2 ) return requests. post ( f " { API } /run ", headers = H, json = { " scraper ": scraper, " input ": inp }). json () def walk ( node, comments, cursors ): if isinstance ( node, dict ): if str ( node. get ( " id ", "" )). startswith ( " t1_ " ): comments [ node [ " id " ]] = node more = node. get ( " more " ) if isinstance ( more, dict ) and more. get ( " cursor " ): cursors. append ( more [ " cursor " ]) for v in node. values (): walk ( v, comments, cursors ) elif isinstance ( node, list ): for v in node: walk ( v, comments, cursors ) comments, cursors, calls = {}, [], 0 # 1. page through the top of the thread inp = { " post_id ": POST, " sort_type ": " TOP " } while calls < 50: r = run ( " procli_reddit_b ", inp ); calls += 1 walk ( r [ " items " ], comments, cursors ) page = r. get ( " page " ) or {} if not page. get ( " hasNextPage " ) or not page. get ( " after " ): break inp [ " after " ] = page [ " after " ] # 2. expand every collapsed branch, including branches inside branches seen = set () while cursors and calls < 200: c = cursors. pop () if c in seen: continue seen. add ( c ) r = run ( " procli_reddit_h ", { " post_id ": POST, " cursor ": c }); calls += 1 walk ( r [ " items " ], comments, cursors ) json. dump ( list ( comments. values ()), open ( " thread.json ", " w " ), ensure_ascii = False, indent = 2 ) print ( len ( comments ), " comments in ", calls, " calls; balance ", r [ " wallet " ][ " balanceDisplay " ]) Enter fullscreen mode Exit fullscreen mode The two calls limits are a budget guard: 200 calls is $0.60 at most. Raise them once you have seen what a typical thread in your niche needs.

Before committing to one tool for a research project, pick three threads you can check by hand: one small, one with a few hundred comments, and one with long collapsed arguments. Then for each tool:

In Claude, Claude Code, Codex or Cursor: create an API key in the console ("Generate setup message" on the Get started page) and send it to your AI. In ChatGPT: add https://prolevelmax.com/mcp as an app and sign in with OAuth. New accounts get $1 of credit after email verification, which covers the script above several times over.

The full reference for this, including the Chinese version, is in the guide How to get full Reddit comment threads, including collapsed replies, into your AI. Questions or corrections: toph@prolevelmax.com.

Quelle: dev.to (dev.to). Original öffnen