If you have ever tried to answer "what do people complain about in our category?" by reading Reddit, you know the useful part is rarely the post. It is the comment thread underneath, three or four levels deep, where someone explains why they returned the product and five people reply with what they bought instead. This post walks through how to get those threads into an AI agent as structured data, using MCP for chat clients and a plain REST API for scripts.
I work on ProLevelMax, the data source used in the examples below. The approach (discover a source, check the price, run it, page through results) is the part worth taking away.
Why scraping Reddit yourself gets old fast
Getting one thread is easy. Getting a few hundred threads reliably is where the time goes:
- Comment trees are nested and truncated. Long threads come back with collapsed branches and "more replies" stubs. To get the whole conversation you have to follow each stub, keep parent links straight, and stitch the tree back together.
- Pagination is per thread. Every post has its own cursor, so a research job across 30 threads is 30 separate paging loops, each of which can fail halfway.
- Access needs upkeep. You register an app, manage credentials, watch rate limits and handle the day the response format or the HTML changes.
- Agents make it worse. If you hand a raw HTTP tool to an LLM and say "read these threads", it will happily fetch page one and summarise a fraction of the discussion as if it were all of it.
What I wanted instead: the agent asks for "comments on this post", gets a price before anything runs, and receives clean records it can count and quote.
Two ways in: MCP or REST
ProLevelMax exposes the same data three ways:
- A remote MCP server at
https://prolevelmax.com/mcp. Claude.ai, Claude Desktop and ChatGPT connect with OAuth (no key). Claude Code, Codex and Cursor can use an API key as a Bearer token. - An Agent Skill at
https://prolevelmax.com/SKILL.md. You create an API key in the dashboard, then send your AI the lineset up https://prolevelmax.com/SKILL.mdtogether with the key, and it configures itself. - A REST API under
https://prolevelmax.com/v1, described in an OpenAPI 3.1 file.
For Claude Code, the setup line from SKILL.md is:
claude mcp add --scope user --transport http prolevelmax https://prolevelmax.com/mcp --header "Authorization: Bearer sk_procli_..."
Once connected, the agent has eight tools. The four that matter for research are procli_discover, procli_inspect, procli_run and procli_runs_get. The REST endpoints mirror them, so I will use REST for the rest of this post because it is easier to show.
The request flow
1. Discover. You describe what you want in plain words (English or Chinese) and get candidate sources back.
curl https://prolevelmax.com/v1/discover \
-H "Authorization: Bearer sk_procli_..." \
-H "Content-Type: application/json" \
-d '{"query":"reddit comments"}'
The response has recommended and items. Each source carries a scraper id, a title, bestFor, a verdict (recommended, ok or not_recommended), a why, its pricing and an estimate. For Reddit there are separate sources for search, subreddit feeds, a post with its comments, post comments page by page, and replies under one comment for deep threads.
2. Inspect. Before running anything, ask for the input fields and a quote.
curl https://prolevelmax.com/v1/inspect \
-H "Authorization: Bearer sk_procli_..." \
-H "Content-Type: application/json" \
-d '{"scraper":"procli_reddit_b","input":{"post_id":"t3_1abcde"}}'
The response shape (values omitted):
{
"scraper": "procli_reddit_b",
"inputFields": [
{ "name": <string>, "type": <string>, "required": <bool>, "description": <string>, "paging": <bool> }
],
"exampleInput": { ... },
"pagingNote": <string>,
"quote": {
"maxCharge": <number, USD>,
"maxChargeDisplay": <string>,
"needsConfirmation": <bool>,
"balanceTooLow": <bool>
}
}
quote.maxCharge is the most this run can cost. needsConfirmation is true when the quote is above $0.10. Fields marked paging: true are the ones you fill from the previous result to get the next page.
3. Run.
curl https://prolevelmax.com/v1/run \
-H "Authorization: Bearer sk_procli_..." \
-H "Content-Type: application/json" \
-d '{"scraper":"procli_reddit_b","input":{"post_id":"t3_1abcde"}}'
A finished run returns runId, items, count, a page object with cursor values for the next page, cost (with amountDisplay), quote, wallet (with balanceDisplay) and download links for json, csv and xlsx. For long jobs, send "async": true and you get a 202 with a runId to poll at GET /v1/runs/:id.
4. Download. GET /v1/runs/RUN_ID/download?format=csv (or xlsx, json). Nested fields become a.b columns in CSV.
A small working script
This pulls every page of comments for one Reddit post, refuses to run anything that needs confirmation, and writes the records to a JSON file. Replace the key and the post id.
import json, sys, requests
API = "https://prolevelmax.com/v1"
H = {"Authorization": "Bearer sk_procli_..."}
SOURCE = "procli_reddit_b" # "Post comments", page by page
inp = {"post_id": "t3_1abcde"} # the post you want
comments, spent = [], []
for _ in range(10): # hard stop at 10 pages
info = requests.post(f"{API}/inspect", headers=H, json={"scraper": SOURCE, "input": inp}).json()
if info["quote"]["needsConfirmation"]:
sys.exit(f"Quote is {info['quote']['maxChargeDisplay']}, stopping for review")
run = requests.post(f"{API}/run", headers=H, json={"scraper": SOURCE, "input": inp}).json()
comments += run["items"]
spent.append(run["cost"]["amountDisplay"])
paging = [f["name"] for f in info["inputFields"] if f.get("paging")]
page = run.get("page") or {}
if not paging or not any(page.get(n) for n in paging):
break # no next cursor: done
inp.update({n: page[n] for n in paging if page.get(n)})
json.dump(comments, open("comments.json", "w"), ensure_ascii=False, indent=2)
print(len(comments), "comments, charges:", spent, "balance:", run["wallet"]["balanceDisplay"])
The script does not hard-code the cursor field name. It reads which input fields are marked paging from inspect and copies matching values from the result's page object, which is how the docs describe paging for per-call sources. Error handling is left out to keep it short; errors come back as JSON with a stable type (for example insufficient_balance, spend_limit, invalid_input, rate_limited) you can branch on.
From here, feed comments.json to whatever model you use and ask for themes with counts and verbatim quotes. Asking for quotes with links keeps the summary honest, because you can check each claim against the thread.
Keeping costs predictable
Running an agent against a paid API is only comfortable if spend has a ceiling. The pieces that give you one:
-
A quote before every run.
inspectreturnsmaxCharge, and the charge never exceeds the quote. The Skill tells agents to state the price and wait for your OK when the quote is above $0.10. - No overdraft. Per-result runs shrink to what your balance covers, per-call runs do not start without enough balance, and the account cannot go below zero.
-
Spend limits per key or app. You can set daily or monthly limits in the dashboard. A run that hits one fails with
spend_limitinstead of charging. -
Caps on schedules. If you monitor threads on a schedule (
POST /v1/schedules), each schedule takes arunCapand an optionalmonthlyCap, anddryRun: truepreviews the cost without saving anything. - Failed runs. These are generally not charged; a partial charge, if any, stays within the quote.
Billing is pay per use: some sources charge per call, others per result plus a per-run fee with a minimum. Most Reddit sources are per call. Current rates are on the pricing page, and new accounts get $1 of credit after email verification, which is enough to try the flow above.
Limits worth knowing
- Public data only. Private and quarantined subreddits cannot be read, and anything that needs someone's login is not collected.
- Deleted content stays deleted. Removed or deleted posts and comments show only what Reddit still shows publicly, usually nothing.
- Scores are a snapshot. Upvotes and comment counts are the public numbers at the moment of the request.
-
Concurrency. Up to 5 jobs run at once per account, across all keys and connections. Extra runs get
429 too_many_runs. -
Run size and time. Per-result sources return up to 100 results unless you set
maxItems. A synchronous run waits at most 300 seconds (timeout), so useasyncfor big jobs. - Retention. Run results are kept for 30 days. Download what you want to keep.
Where to go next
- Docs: prolevelmax.com/docs
- OpenAPI: prolevelmax.com/openapi.json
- Agent Skill: prolevelmax.com/SKILL.md
- Client configs: github.com/tophmeee/prolevelmax-mcp
If something in the flow is unclear or broken, email toph@prolevelmax.com.
Top comments (0)