Search a subreddit
Search posts within a single subreddit, with optional sort, time window, and date cutoff. Returns subreddit, count, and threads (each with id, url, title, author, score, num_comments, created, subreddit, nsfw, preview_text). `limit` is a maximum, not a guarantee: a search with fewer matches returns what exists. With `sort=new`, pass `since` (an ISO date or shorthand like "7d") to filter out results older than that cutoff — useful for searching a subreddit for recent activity by date rather than by relevance/rank. When a query has no genuine matches, Reddit's own search sometimes silently returns a small number of loosely-related posts from the subreddit instead of an empty result, with no way to tell them apart from real hits — a non-zero count doesn't guarantee relevance. Reddit's subreddit-scoped search cards show titles only, with no body excerpt, so preview_text is null here on every sort; that is the surface, not a limitation of the script. To get per-subreddit results that include body excerpts, use reddit.com/search_reddit with a `subreddit:name` term in the query. Reddit caps each page at 100 results, so paginate with the after cursor to go beyond that.
Input
topic requiredSearch query
subreddit requiredSubreddit name, with or without the r/ prefix
sort optionalReddit's native sort (default relevance)
Default: "relevance"time optionalReddit's native time filter (default all). Ignored by Reddit when sort=new.
Default: "all"limit optionalMax results, paginating via the site's own infinite scroll (default 25)
Default: 25since optionalsort:"new" only — filters out results older than this cutoff: ISO date ("2026-06-01") or shorthand ("24h", "7d", "2w").
Output
count requiredthreads requiredsubreddit requiredFAQ
Get Reddit thread
Fetch a full Reddit thread from its URL. Returns title, op_text, score, num_comments, and comments (author, body, score, nesting depth). Compare num_comments to total_comments to detect truncation; use all_comments to expand every "more replies" thread automatically.
Search Reddit
Search posts across all of Reddit (no subreddit restriction), with optional sort and time window. Returns count and threads (each with id, url, title, author, subreddit, score, num_comments, created, nsfw, preview_text). `limit` is a maximum: fewer matching posts than requested returns however many exist. Useful to discover which subreddits discuss a topic. Reddit refuses connections from datacenter addresses, so this works as-is on your own browser; on a hosted cloud browser the session has to be given a country so it exits through a residential address, otherwise Reddit blocks it and the script says so.
Get subreddit threads
List a subreddit's threads by Reddit's native sort (best/hot/new/top/rising). "new" is chronological (filter with `since`); "top" takes a `time` window (hour…all); others paginate by `limit`. Returns url, title, author, score, num_comments, created, post_type, and body — the post's full text (never truncated; null for link/image posts). `limit` is a maximum, not a guarantee: fewer matching threads returns what exists.
