Nimbryxo Studio

Use Reddit Multi-Mode Scraper for Posts, Comments & Profiles with Python

Pick one of five modes to pull subreddit posts, full comment threads, user profiles, keyword search results or curated community listings from Reddit, each with deep post/comment filters. No account or API key needed.

1. Choose the data you need

Review the published README for supported collection modes, examples, and limits. The recipe below uses the current published input definition.

2. Prepare a source-based input

This JSON contains published prefills and required-field defaults. Review every value for your task before running it; it is not a promise of successful collection.

{
  "authors": [],
  "commentSort": "confidence",
  "excludeArchived": false,
  "excludeAuthors": [],
  "excludeCrossposts": false,
  "excludeDeletedAuthor": false,
  "excludeKeywords": [],
  "excludeLocked": false,
  "excludeRemoved": false,
  "excludeSpoilers": false,
  "excludeStickied": false,
  "failOnEmpty": false,
  "includeComments": false,
  "includeNSFW": false,
  "includePost": true,
  "includeProfileInfo": true,
  "includeSubredditInfo": false,
  "includeSubredditRules": false,
  "maxComments": 5,
  "maxCommunities": 0,
  "maxDepth": 6,
  "maxItems": 2,
  "maxPosts": 2,
  "maxProxyBytesMb": 50,
  "maxUsers": 0,
  "mode": "subreddit",
  "onlyNew": false,
  "onlyOriginalContent": false,
  "onlyWithFlair": false,
  "postUrls": [],
  "proxyMode": "none",
  "restrictSubreddits": [],
  "searchComments": false,
  "searchCommunities": false,
  "searchPosts": true,
  "searchQuery": "",
  "searchUsers": false,
  "sections": [
    "posts"
  ],
  "sort": "hot",
  "source": "archive",
  "stateKey": "reddit-mcp-state",
  "subreddits": [
    "programming"
  ],
  "timeFilter": "day",
  "usernames": []
}

Download input.example.json and save your reviewed copy as input.json.

FieldTypeRequiredDescription
modestringrequiredWhat to scrape: a subreddit listing, post URLs with comments, a user profile, or keyword search.
sourcestringoptionalauto uses live Reddit first and the Arctic Shift archive for depth/bulk or as a fallback. archive is faster and cheaper but lags live Reddit by several hours; live never uses archive data.
subredditsarrayoptionalSubreddits to scrape (mode=subreddit). Accepts names, r/ names or URLs.
postUrlsarrayoptionalPost URLs, comment URLs, share links or bare post IDs (mode=post).
usernamesarrayoptionalReddit usernames to scrape (mode=profile). Accepts names, u/ names or profile URLs.
searchQuerystringoptionalKeyword or phrase to search for (mode=search). Reddit search syntax such as "exact phrase", author:name, subreddit:name and -exclude is supported by live search.
maxItemsintegeroptionalHard cap on all records pushed by the run, across every target.
maxPostsintegeroptionalPosts per subreddit, keyword or profile section.
maxCommentsintegeroptionalComments per post, keyword, or profile comment section. 0 disables comment records.
maxDepthintegeroptionalDeepest reply level to emit (0 = top-level comments only).
includeCommentsbooleanoptionalEmit comment records for each post. Disable to fetch only the parent post.
includePostbooleanoptionalEmit the post record before its comments.
sortstringoptionalPost/listing sort. Search accepts relevance, hot, top, new or comments; other modes use hot, new, top, rising, controversial or best.
timeFilterstringoptionalTime window for top/controversial sorts and search.
commentSortstringoptionalComment ordering for mode=post.
includeNSFWbooleanoptionalInclude over-18 posts and communities.
includeSubredditInfobooleanoptionalEmit one community record per subreddit before its posts.
includeSubredditRulesbooleanoptionalAttach posting rules to the community record. Requires includeSubredditInfo.
includeProfileInfobooleanoptionalEmit a profile record with karma, counts and account metadata.
sectionsarrayoptionalWhich history sections to fetch (mode=profile). Allowed values: overview, posts, comments.
searchPostsbooleanoptionalInclude post results in keyword search.
searchCommentsbooleanoptionalInclude comment results in keyword search when Reddit's comment tab returns them.
searchCommunitiesbooleanoptionalInclude subreddit matches in keyword search.
searchUsersbooleanoptionalInclude matching Reddit accounts in keyword search.
withinCommunitystringoptionalLimit post/comment search to a single subreddit (name, r/name or URL). Required for archive keyword search.
maxCommunitiesintegeroptionalMaximum subreddit matches per search query.
maxUsersintegeroptionalMaximum account matches per search query.
onlyNewbooleanoptionalEmit only records newer than the watermark saved under stateKey by a previous run.
stateKeystringoptionalKey-value store key prefix used by onlyNew watermarks.
failOnEmptybooleanoptionalMark the run FAILED with a clear status message instead of finishing silently with 0 records.
maxProxyBytesMbintegeroptionalSafety ceiling for paid proxy traffic. The run stops when the ceiling is reached. Images, media and fonts are never downloaded.
proxyModestringoptionalDirect (no proxy) is the default. Choose datacenter if Reddit blocks your runs. Residential is an explicit last resort and is capped by maxProxyBytesMb.
minScoreintegeroptionalDrop posts/comments below this score.
maxScoreintegeroptionalDrop posts/comments above this score.
minPostCommentsintegeroptionalDrop posts with fewer comments than this.
maxPostCommentsintegeroptionalDrop posts with more comments than this.
minUpvoteRationumberoptionalDrop posts below this upvote ratio (0-1).
postTypestringoptionalKeep only posts of this type.
titleContainsstringoptionalKeep only posts whose title contains this text.
contentContainsstringoptionalKeep only posts whose body/self-text contains this text.
flairContainsstringoptionalKeep only posts whose link flair contains this text.
authorFlairContainsstringoptionalKeep only posts whose author flair contains this text.
domainstringoptionalKeep only posts whose link domain contains this text.
authorsarrayoptionalKeep posts by these usernames.
excludeAuthorsarrayoptionalDrop posts by these usernames.
excludeKeywordsarrayoptionalDrop posts whose title, body or flair contains any of these terms.
excludeStickiedbooleanoptionalExclude pinned/stickied posts from results.
excludeRemovedbooleanoptionalExclude posts or comments removed by moderators.
excludeCrosspostsbooleanoptionalExclude crossposts.
excludeSpoilersbooleanoptionalExclude posts marked as spoilers.
excludeLockedbooleanoptionalExclude locked posts and comments.
excludeDeletedAuthorbooleanoptionalExclude records whose author account was deleted.
excludeArchivedbooleanoptionalExclude archived posts that no longer accept votes or comments.
onlyWithFlairbooleanoptionalDrop posts without a link flair.
onlyOriginalContentbooleanoptionalKeep only posts tagged as OC.
minAwardsintegeroptionalKeep only posts with at least this many awards.
minContentLengthintegeroptionalKeep only posts whose body is at least this many characters.
maxContentLengthintegeroptionalKeep only posts whose body is at most this many characters.
postedAfterstringoptionalUTC date lower bound (YYYY-MM-DD).
postedBeforestringoptionalUTC date upper bound (YYYY-MM-DD), inclusive.
restrictSubredditsarrayoptionalOnly keep profile posts/comments made in these subreddits.
keywordstringoptionalOnly keep profile posts/comments whose title, body or text contains this phrase.
minCommunitySubscribersintegeroptionalCommunity search only: drop smaller subreddits.
maxCommunitySubscribersintegeroptionalCommunity search only: drop larger subreddits.
minUserKarmaintegeroptionalUser search only: drop accounts with less total karma.
maxUserKarmaintegeroptionalUser search only: drop accounts with more total karma.
distinguishedstringoptionalKeep only moderator/admin/special posts, or only regular posts.

3. Start an Actor run

Set APIFY_TOKEN in your environment. Python 3.10 or newer is sufficient; this recipe uses no third-party packages.

Execution may incur charges. Review current pricing on Apify. The request asks for a 120-second timeout and a charge limit; these settings are subject to Apify’s pricing and do not guarantee an all-inclusive spending cap.

import json
import os
import urllib.request

# Save the schema-derived example as input.json; review and edit it first.
with open("input.json", encoding="utf-8") as stream:
    actor_input = json.load(stream)

token = os.environ["APIFY_TOKEN"]
request = urllib.request.Request(
    "https://api.apify.com/v2/acts/TvCs8gaYvL352HNwD/runs?timeout=120&maxTotalChargeUsd=0.50",
    data=json.dumps(actor_input).encode("utf-8"),
    headers={"Authorization": "Bearer " + token, "Content-Type": "application/json"},
    method="POST",
)
# This starts a potentially billable run. Do not automatically retry this POST.
with urllib.request.urlopen(request, timeout=40) as response:
    run = json.load(response)["data"]
print("Run ID:", run["id"])
print("Status:", run["status"])
# Inspect and download results in Apify Console once the run succeeds.

4. Inspect the actual results

Open the run in Apify Console and wait for a successful completion. Use the published output schema to locate results and the dataset schema to understand declared views. Missing or optional record fields must not be treated as guaranteed values.

Reddit posts, comments, profiles and community records with engagement metrics, derived activity and per-record source provenance.

Questions before you run

Which inputs are required?

The published required fields are mode

What does this guide verify?

The fields, prefills, and schema links are rendered from the published build. This is a usage recipe, not a paid live extraction test. Source availability and collection results can vary.

What if the run request times out?

Check Apify Console before retrying. The first request may already have created a run. Do not automatically repeat a run-creation POST.

Generated from source build ilFk20SGtzrsuw9Db and its README and schemas. Source changes regenerate this guide; no third-party editorial claims are inferred.