{
  "data": {
    "id": "qdSuwLoNAqkhDc3y4",
    "actId": "BKePs1sWHACaSpzyh",
    "userId": "NL4ThgItAwaoBlffQ",
    "startedAt": "2026-10-25T01:21:36.120Z",
    "finishedAt": "2026-10-25T01:22:50.696Z",
    "status": "SUCCEEDED",
    "meta": {
      "origin": "CLI"
    },
    "stats": {
      "durationMillis": 74497,
      "runTimeSecs": 74.497,
      "computeUnits": 0.08277444444444444,
      "imageSizeBytes": 1238426112
    },
    "options": {
      "useCache": true,
      "betaPackages": false,
      "memoryMbytes": 4096,
      "diskMbytes": 8192
    },
    "createdByOrganizationMemberUserId": "zifX0mkAFMHe8CatY",
    "exitCode": 0,
    "inputSchema": "{\n  \"title\": \"Reddit Subreddit Scraper Input\",\n  \"type\": \"object\",\n  \"schemaVersion\": 1,\n  \"properties\": {\n    \"subreddits\": {\n      \"title\": \"Subreddits\",\n      \"type\": \"array\",\n      \"description\": \"List of subreddits to scrape. Accepts bare names (python), r/ prefixed (r/python) or full URLs (https://www.reddit.com/r/python/).\",\n      \"editor\": \"stringList\",\n      \"example\": [\n        \"python\",\n        \"r/programming\",\n        \"https://www.reddit.com/r/webdev/\"\n      ],\n      \"prefill\": [\n        \"python\"\n      ],\n      \"minItems\": 1\n    },\n    \"maxPosts\": {\n      \"title\": \"Maximum posts per subreddit\",\n      \"type\": \"integer\",\n      \"description\": \"Maximum number of posts to keep from each subreddit after filters. Reddit serves roughly 1,000 posts per hot/new listing and about 500 for top/controversial.\",\n      \"minimum\": 1,\n      \"maximum\": 5000,\n      \"default\": 25,\n      \"prefill\": 25,\n      \"example\": 25\n    },\n    \"maxItems\": {\n      \"title\": \"Maximum total items (safety cap)\",\n      \"type\": \"integer\",\n      \"description\": \"Global safety cap on the total number of records pushed for the whole run (posts and comments combined).\",\n      \"minimum\": 1,\n      \"maximum\": 100000,\n      \"default\": 10000,\n      \"prefill\": 10000,\n      \"example\": 5000\n    },\n    \"sort\": {\n      \"title\": \"Sort posts by\",\n      \"type\": \"string\",\n      \"description\": \"How to sort posts in the subreddit. Reddit serves roughly 1,000 posts per hot/new listing and about 500 for top/controversial.\",\n      \"enum\": [\n        \"hot\",\n        \"new\",\n        \"top\",\n        \"rising\",\n        \"controversial\",\n        \"best\"\n      ],\n      \"default\": \"new\",\n      \"prefill\": \"new\",\n      \"enumTitles\": [\n        \"Hot\",\n        \"New\",\n        \"Top\",\n        \"Rising\",\n        \"Controversial\",\n        \"Best\"\n      ]\n    },\n    \"timeFilter\": {\n      \"title\": \"Time filter (for 'top' and 'controversial' sort)\",\n      \"type\": \"string\",\n      \"description\": \"Time filter when sorting by 'top' or 'controversial'.\",\n      \"enum\": [\n        \"hour\",\n        \"day\",\n        \"week\",\n        \"month\",\n        \"year\",\n        \"all\"\n      ],\n      \"default\": \"day\",\n      \"prefill\": \"day\",\n      \"enumTitles\": [\n        \"Past Hour\",\n        \"Past Day\",\n        \"Past Week\",\n        \"Past Month\",\n        \"Past Year\",\n        \"All Time\"\n      ]\n    },\n    \"includeComments\": {\n      \"title\": \"Include comments for each post\",\n      \"type\": \"boolean\",\n      \"description\": \"When enabled, the full comment thread (including nested replies) is collected for every scraped post. Significantly increases run time and output.\",\n      \"default\": false,\n      \"prefill\": false\n    },\n    \"maxCommentsPerPost\": {\n      \"title\": \"Maximum comments per post\",\n      \"type\": \"integer\",\n      \"description\": \"Maximum number of comments to scrape per post (only used when 'Include comments' is enabled).\",\n      \"minimum\": 0,\n      \"maximum\": 100000,\n      \"default\": 0,\n      \"prefill\": 0,\n      \"example\": 100\n    },\n    \"commentSort\": {\n      \"title\": \"Sort comments by\",\n      \"type\": \"string\",\n      \"description\": \"How to sort the comment threads.\",\n      \"enum\": [\n        \"confidence\",\n        \"top\",\n        \"new\",\n        \"controversial\",\n        \"old\",\n        \"qa\"\n      ],\n      \"default\": \"confidence\",\n      \"prefill\": \"confidence\",\n      \"enumTitles\": [\n        \"Best (Confidence)\",\n        \"Top\",\n        \"New\",\n        \"Controversial\",\n        \"Old\",\n        \"Q&A\"\n      ]\n    },\n    \"postedAfter\": {\n      \"title\": \"Posts created on or after (YYYY-MM-DD)\",\n      \"type\": \"string\",\n      \"description\": \"Only keep posts created on or after this date (UTC). When set, collection runs newest-first (sort=new) and the sort option above is ignored. Reddit caps each listing at roughly 1,000 posts, so a distant date window on a very active subreddit may not be fully reachable.\",\n      \"editor\": \"datepicker\",\n      \"example\": \"2025-01-01\"\n    },\n    \"postedBefore\": {\n      \"title\": \"Posts created on or before (YYYY-MM-DD)\",\n      \"type\": \"string\",\n      \"description\": \"Only keep posts created on or before this date (interpreted as the end of that day, UTC).\",\n      \"editor\": \"datepicker\",\n      \"example\": \"2025-12-31\"\n    },\n    \"includeNSFW\": {\n      \"title\": \"Include NSFW (18+) content\",\n      \"type\": \"boolean\",\n      \"description\": \"Include posts Reddit explicitly flags as NSFW. Posts in 18+ communities are served by the actor's adult-content cookie and are not distinguishable at community level.\",\n      \"default\": false,\n      \"prefill\": false\n    },\n    \"onlyWithFlair\": {\n      \"title\": \"Only posts that have a flair\",\n      \"type\": \"boolean\",\n      \"description\": \"When enabled, posts without a flair tag are dropped from the results.\",\n      \"default\": false,\n      \"prefill\": false\n    },\n    \"postType\": {\n      \"title\": \"Only posts of this type\",\n      \"type\": \"string\",\n      \"description\": \"Keep only posts of the selected content type (based on Reddit's listing type). Leave unset to keep all types. Legacy 'self' is treated as 'text'.\",\n      \"enum\": [\n        \"text\",\n        \"link\",\n        \"image\",\n        \"video\",\n        \"gallery\",\n        \"poll\",\n        \"crosspost\",\n        \"multi_media\"\n      ],\n      \"enumTitles\": [\n        \"Text post\",\n        \"Link\",\n        \"Image\",\n        \"Video\",\n        \"Gallery\",\n        \"Poll\",\n        \"Crosspost\",\n        \"Multi-media post\"\n      ]\n    },\n    \"minScore\": {\n      \"title\": \"Minimum score (upvotes minus downvotes)\",\n      \"type\": \"integer\",\n      \"description\": \"Only keep posts with a score at or above this value. Leave unset to keep all scores.\",\n      \"minimum\": -100000,\n      \"maximum\": 1000000,\n      \"example\": 10\n    },\n    \"maxScore\": {\n      \"title\": \"Maximum score (upvotes minus downvotes)\",\n      \"type\": \"integer\",\n      \"description\": \"Only keep posts with a score at or below this value. Useful for finding overlooked/low-visibility posts. Leave unset to keep all scores.\",\n      \"minimum\": -100000,\n      \"maximum\": 1000000,\n      \"example\": 1000\n    },\n    \"minComments\": {\n      \"title\": \"Minimum number of comments\",\n      \"type\": \"integer\",\n      \"description\": \"Only keep posts with at least this many comments. Leave unset to keep all posts.\",\n      \"minimum\": 0,\n      \"maximum\": 1000000,\n      \"example\": 5\n    },\n    \"maxComments\": {\n      \"title\": \"Maximum number of comments\",\n      \"type\": \"integer\",\n      \"description\": \"Only keep posts with at most this many comments. Useful for finding under-discussed posts. Leave unset to keep all posts.\",\n      \"minimum\": 0,\n      \"maximum\": 1000000,\n      \"example\": 500\n    },\n    \"excludeStickied\": {\n      \"title\": \"Exclude stickied/pinned posts\",\n      \"type\": \"boolean\",\n      \"description\": \"When enabled, posts pinned/stickied by moderators (e.g. rules, weekly threads) are dropped from the results.\",\n      \"default\": false,\n      \"prefill\": false\n    },\n    \"minUpvoteRatio\": {\n      \"title\": \"Minimum upvote ratio\",\n      \"type\": \"number\",\n      \"description\": \"Only keep posts whose upvote ratio (fraction of votes that are upvotes, 0-1) is at or above this value. Useful for filtering out controversial/divisive posts. Leave unset to keep all ratios.\",\n      \"minimum\": 0,\n      \"maximum\": 1,\n      \"example\": 0.8\n    },\n    \"excludeCrossposts\": {\n      \"title\": \"Exclude crossposts\",\n      \"type\": \"boolean\",\n      \"description\": \"When enabled, posts that are crossposts from another subreddit are dropped from the results, keeping only original submissions to the scraped subreddit.\",\n      \"default\": false,\n      \"prefill\": false\n    },\n    \"excludeSpoilers\": {\n      \"title\": \"Exclude spoiler-tagged posts\",\n      \"type\": \"boolean\",\n      \"description\": \"When enabled, posts marked as a spoiler by their author are dropped from the results.\",\n      \"default\": false,\n      \"prefill\": false\n    },\n    \"titleContains\": {\n      \"title\": \"Title contains keyword\",\n      \"type\": \"string\",\n      \"description\": \"Only keep posts whose title contains this text (case-insensitive substring match). Leave empty to keep all titles.\",\n      \"editor\": \"textfield\",\n      \"example\": \"launch\"\n    },\n    \"contentContains\": {\n      \"title\": \"Post text contains keyword\",\n      \"type\": \"string\",\n      \"description\": \"Only keep self (text) posts whose body contains this text (case-insensitive substring match). Link/image/video posts have no body text and are excluded when this is set. Leave empty to keep all posts.\",\n      \"editor\": \"textfield\",\n      \"example\": \"tutorial\"\n    },\n    \"flairContains\": {\n      \"title\": \"Flair contains keyword\",\n      \"type\": \"string\",\n      \"description\": \"Only keep posts whose flair text contains this text (case-insensitive substring match). Leave empty to keep all flairs.\",\n      \"editor\": \"textfield\",\n      \"example\": \"Discussion\"\n    },\n    \"authors\": {\n      \"title\": \"Only posts by these authors\",\n      \"type\": \"array\",\n      \"description\": \"Only keep posts submitted by one of these usernames (bare name or u/-prefixed, case-insensitive). Leave empty to keep posts from all authors.\",\n      \"editor\": \"stringList\",\n      \"example\": [\n        \"spez\"\n      ]\n    },\n    \"domain\": {\n      \"title\": \"Domain contains\",\n      \"type\": \"string\",\n      \"description\": \"Only keep posts whose link domain contains this text (case-insensitive, e.g. 'youtube.com' or 'self.python'). Leave empty to keep all domains.\",\n      \"editor\": \"textfield\",\n      \"example\": \"youtube.com\"\n    },\n    \"minAwards\": {\n      \"title\": \"Minimum awards received\",\n      \"type\": \"integer\",\n      \"description\": \"Only keep posts with at least this many total awards. Leave unset to keep all posts.\",\n      \"minimum\": 0,\n      \"maximum\": 1000000,\n      \"example\": 1\n    },\n    \"excludeDeletedAuthor\": {\n      \"title\": \"Exclude posts with a deleted/removed author\",\n      \"type\": \"boolean\",\n      \"description\": \"When enabled, posts whose author account was deleted (shown as [deleted]/[removed]) are dropped from the results.\",\n      \"default\": false,\n      \"prefill\": false\n    },\n    \"excludeAuthors\": {\n      \"title\": \"Exclude posts by these authors\",\n      \"type\": \"array\",\n      \"description\": \"Drop posts submitted by any of these usernames (bare name or u/-prefixed, case-insensitive) — useful for filtering out bots (e.g. AutoModerator) or known spam accounts. Leave empty to keep posts from all authors.\",\n      \"editor\": \"stringList\",\n      \"example\": [\n        \"AutoModerator\"\n      ]\n    },\n    \"excludeKeywords\": {\n      \"title\": \"Exclude keywords\",\n      \"type\": \"array\",\n      \"description\": \"Drop posts whose title, self-text body or flair contains any of these keywords or phrases (case-insensitive substring match) — useful for filtering out megathreads, giveaways or spam boilerplate. Leave empty to keep all posts.\",\n      \"editor\": \"stringList\",\n      \"example\": [\n        \"megathread\"\n      ]\n    },\n    \"minContentLength\": {\n      \"title\": \"Minimum post body length (characters)\",\n      \"type\": \"integer\",\n      \"description\": \"Only keep self (text) posts whose body is at least this many characters long. Link/image/video posts have no body and are excluded when this is set. Useful for dropping one-line/low-effort text posts when building NLP datasets. Leave unset to keep all lengths.\",\n      \"minimum\": 0,\n      \"maximum\": 1000000,\n      \"example\": 100\n    },\n    \"maxContentLength\": {\n      \"title\": \"Maximum post body length (characters)\",\n      \"type\": \"integer\",\n      \"description\": \"Only keep self (text) posts whose body is at most this many characters long. Leave unset to keep all lengths.\",\n      \"minimum\": 0,\n      \"maximum\": 1000000,\n      \"example\": 5000\n    },\n    \"fullSubreddit\": {\n      \"title\": \"Full subreddit mode (deepest reachable history)\",\n      \"type\": \"boolean\",\n      \"description\": \"When enabled, walk Reddit's 'new' listing as deep as the source allows (roughly 1,000 posts per listing) instead of stopping at the first page. Combine with a higher 'Maximum posts per subreddit'.\",\n      \"default\": false,\n      \"prefill\": false\n    }\n  },\n  \"required\": [\n    \"subreddits\"\n  ]\n}",
    "readme": "# Reddit Subreddit Post & Comment Harvester\n\nHarvest posts from any public subreddit — hot, new, top, rising, controversial or best — with score, author, flair, selftext, images, galleries, video, polls and crossposts. Add full nested comment threads when you need the discussion too. Rich date, score, comment-count, upvote-ratio, keyword and author filters; no API key, no login, no proxy setup.\n\n## What this actor does\n\n- **Any public subreddit:** bare name (`python`), `r/`-prefixed name (`r/python`) or a full Reddit URL; multiple subreddits in one run\n- **Six listing modes:** `hot`, `new`, `top`, `rising`, `controversial`, `best`; `top` and `controversial` support Reddit's six time windows\n- **Deep history:** follows Reddit's listing pages to the practical ceiling (roughly 1,000 posts for hot/new, about 500 for top/controversial)\n- **Posts with media:** score, upvote ratio, comment count, author, flair, selftext, images, gallery images (full resolution), video (HLS + MP4), poll options and votes, crosspost parent\n- **Optional comment threads:** full nested trees with 6 comment sorts, depth, parent links, OP flag, edited/deleted flags and awards\n- **Rich filtering:** date range, score, comment count, upvote ratio, post type, flair, title/body keywords, authors, domain, awards, content length and moderation flags\n- **Empty fields are omitted** from the output — no need to defend against `null`/empty values downstream\n\n## Output per post\n\n- `dataType` — always `post`\n- `subreddit`, `subreddit_prefixed`, `subreddit_id`\n- `post_id`, `post_name`, `title`\n- `author`, `author_id`\n- `url`, `permalink`, `content_url`, `domain`\n- `is_self`, `post_type` (`self`/`link`/`image`/`video`/`gallery`/`poll`), `post_type_raw`\n- `score`, `upvote_ratio`, `num_comments`\n- `link_flair`, `link_flair_background_color`, `flair_url`\n- `content` (self-post text), `content_html`\n- `thumbnail_url`\n- `created_utc`, `created_at` (ISO-8601 UTC)\n- `is_stickied`, `is_nsfw`, `is_spoiler`, `is_crosspost`\n- `is_archived` — when the comment mode loads the post page\n- `total_awards_received`, `top_award_id`, `top_award_icon_url`\n- `media_type`, `has_media`\n- `images[]`, `gallery_images[]`, `gallery_count`\n- `video_url` (direct MP4), `video_hls_url` (HLS)\n- `poll_data` — options, option ids, total votes, closing time\n- `crosspost_parent_id`, `crosspost_parent_subreddit`, `crosspost_parent_url`\n- `language`, `crawled_at`, `source`\n\nFor crossposts, `content` is the parent text Reddit renders in the listing, while `post_type_raw` is `crosspost` and the `crosspost_parent_*` fields identify the source post.\n\n## Output per comment\n\nReturned when `includeComments` is on and `maxCommentsPerPost` is above 0. The parent post is emitted first, then its comments.\n\n- `dataType` — always `comment`\n- `subreddit`, `subreddit_prefixed`, `subreddit_id`\n- `post_id`, `post_url`, `post_title`, `link_id`\n- `comment_id`, `comment_name`, `parent_id`, `parent_kind`\n- `author`, `avatarUrl`\n- `body`, `body_html`\n- `score`, `total_awards_received`\n- `depth` (0 = top-level), `position`, `parentPositions`\n- `is_op`, `collapsed`, `contentType`\n- `isCommentDeleted`, `isAuthorDeleted`, `isHighlighted`, `hasPaidAward` — present only when true\n- `created_utc`, `created_at`, `edited`, `edited_at`\n- `permalink`, `crawled_at`, `source`\n\n## Fields not available anonymously\n\nReddit no longer exposes these to logged-out readers of the public pages, so they are omitted rather than guessed: author flair, raw upvotes/downvotes, post `distinguished` (mod/admin badge), `removed_by_category`, post `locked`, original-content marker, `gilded`, the award-type breakdown, video duration/bitrate/dimensions, and oEmbed title/author/HTML for external links. Link posts still carry their target URL and preview image.\n\n## Input\n\n| Field | Type | Default | Description |\n|---|---|---|---|\n| `subreddits` | array | – | **Required.** Subreddit names, `r/`-prefixed names or full URLs |\n| `maxPosts` | int | `25` | Max posts per subreddit after filters (1–5,000) |\n| `maxItems` | int | `10,000` | Global safety cap on total records (posts + comments) |\n| `sort` | enum | `new` | `hot`, `new`, `top`, `rising`, `controversial`, `best` |\n| `timeFilter` | enum | `day` | `hour`, `day`, `week`, `month`, `year`, `all` (top/controversial) |\n| `includeComments` | bool | `false` | Collect comments for every harvested post |\n| `maxCommentsPerPost` | int | `0` | Max comments per post (0–100,000); needs `includeComments` |\n| `commentSort` | enum | `confidence` | `confidence`, `top`, `new`, `controversial`, `old`, `qa` |\n| `postedAfter` | date | – | Only posts created on/after this date (UTC); switches the listing to `new` |\n| `postedBefore` | date | – | Only posts created on/before this date (UTC) |\n| `includeNSFW` | bool | `false` | Include posts explicitly flagged NSFW |\n| `onlyWithFlair` | bool | `false` | Drop posts without a link flair |\n| `postType` | enum | – | `text`, `link`, `image`, `video`, `gallery`, `poll`, `crosspost`, `multi_media` |\n| `minScore` | int | – | Minimum post score |\n| `maxScore` | int | – | Maximum post score |\n| `minComments` | int | – | Minimum comment count |\n| `maxComments` | int | – | Maximum comment count |\n| `minUpvoteRatio` | number | – | Minimum upvote ratio (0–1) |\n| `excludeStickied` | bool | `false` | Drop pinned/stickied posts |\n| `excludeCrossposts` | bool | `false` | Drop crossposts |\n| `excludeSpoilers` | bool | `false` | Drop spoiler-tagged posts |\n| `titleContains` | string | – | Keep posts whose title contains this text |\n| `contentContains` | string | – | Keep self posts whose body contains this text |\n| `flairContains` | string | – | Keep posts whose flair contains this text |\n| `authors` | array | – | Keep posts by these usernames |\n| `excludeAuthors` | array | – | Drop posts by these usernames |\n| `excludeKeywords` | array | – | Drop posts whose title/body/flair contains any keyword |\n| `domain` | string | – | Keep posts whose link domain contains this text |\n| `minAwards` | int | – | Minimum total awards |\n| `excludeDeletedAuthor` | bool | `false` | Drop posts with a deleted/removed author |\n| `minContentLength` | int | – | Minimum self-post body length |\n| `maxContentLength` | int | – | Maximum self-post body length |\n| `fullSubreddit` | bool | `false` | Walk the `new` listing as deep as Reddit allows |\n\n### Example: 25 new posts from r/Python\n\n```json\n{\n  \"subreddits\": [\"python\"],\n  \"maxPosts\": 25,\n  \"sort\": \"new\"\n}\n```\n\n### Example: top image posts with media\n\n```json\n{\n  \"subreddits\": [\"pics\"],\n  \"maxPosts\": 50,\n  \"sort\": \"top\",\n  \"timeFilter\": \"week\",\n  \"postType\": \"gallery\"\n}\n```\n\n### Example: posts plus full comment threads\n\n```json\n{\n  \"subreddits\": [\"technology\"],\n  \"maxPosts\": 20,\n  \"sort\": \"hot\",\n  \"includeComments\": true,\n  \"maxCommentsPerPost\": 100,\n  \"commentSort\": \"top\"\n}\n```\n\n### Example: brand monitoring with filters\n\n```json\n{\n  \"subreddits\": [\"startups\", \"Entrepreneur\", \"SaaS\"],\n  \"maxPosts\": 100,\n  \"sort\": \"new\",\n  \"postedAfter\": \"2026-10-01\",\n  \"minScore\": 5,\n  \"excludeAuthors\": [\"AutoModerator\"],\n  \"excludeKeywords\": [\"megathread\", \"giveaway\"]\n}\n```\n\n## Use cases\n\n- **Market research** — collect authentic community opinions and pain points\n- **Brand monitoring** — track product mentions across subreddits on a schedule\n- **Content ideation** — find trending questions and high-engagement topics\n- **Training data** — build clean Reddit corpora with full comment context for NLP/LLM work\n- **Competitive intelligence** — monitor launches, sentiment and competitor discussions\n- **Academic and social research** — export a subreddit's reachable history for discourse analysis\n\n## FAQ\n\n**Do I need a Reddit API key or login?**\nNo. The actor reads Reddit's public web data — no API key, no OAuth, no cookies, no account.\n\n**Do I need to configure a proxy?**\nNo. The actor chooses a working connection to Reddit automatically. Just fill in the input and run it.\n\n**What happens with private, banned or misspelled subreddits?**\nThey return no records and the run continues with the remaining subreddits. If nothing is found, the run finishes with a status message suggesting you check the names or loosen filters.\n\n**How many posts can I get from one subreddit?**\nUp to `maxPosts` (5,000), but Reddit serves roughly 1,000 posts per hot/new listing and about 500 for top/controversial. `fullSubreddit` walks the `new` listing to that ceiling. Filters are applied after posts are loaded, so strict filters can return fewer rows than `maxPosts`.\n\n**Why did I get no comments?**\n`maxCommentsPerPost` defaults to `0`, which collects none. Set it (for example `100`) and enable `includeComments`. If `maxItems` is tight, the actor keeps every requested post and trims comments first.\n\n**Why are some fields missing from a record?**\nThe actor omits values Reddit does not expose publicly (author flair, raw upvotes/downvotes, post distinguished/removed flags, award breakdown, video duration). Empty values are omitted rather than emitted as `null`, so records stay clean.\n\n**Why is the video URL a low-resolution MP4?**\nReddit serves a direct low-resolution MP4 plus an HLS playlist. The actor provides both: `video_url` for durable downloads and `video_hls_url` for the adaptive stream when Reddit's signed playlist is available. HLS links can expire; `video_url` is the stable choice.\n\n**Why are some NSFW or spoiler posts still included?**\n`includeNSFW` filters posts Reddit explicitly flags. Posts in 18+ communities are served to the actor's adult-content session and cannot be distinguished at community level; use `excludeSpoilers` or keyword filters for tighter control.\n\n**Can I schedule recurring runs?**\nYes — create a schedule in Apify Console for daily or weekly monitoring. Use `postedAfter` or `sort: \"new\"` to collect only recent posts.\n\n**How do I export or integrate the data?**\nDownload JSON, CSV, Excel or HTML from the run, call the dataset API, or connect to n8n, Make, Zapier or the Apify MCP server.\n",
    "actorDefinition": {
      "actorSpecification": 1,
      "name": "reddit-subreddit-post-and-comment-harvester",
      "title": "Reddit Subreddit Post & Comment Harvester",
      "description": "Harvest posts from any subreddit with score, flair, selftext, images, galleries, video, polls and crossposts, plus optional full comment threads. Rich date, score, author and keyword filters. No API key or login.",
      "version": "1.0",
      "buildTag": "latest",
      "dockerfile": "./Dockerfile",
      "readme": "# Reddit Subreddit Post & Comment Harvester\n\nHarvest posts from any public subreddit — hot, new, top, rising, controversial or best — with score, author, flair, selftext, images, galleries, video, polls and crossposts. Add full nested comment threads when you need the discussion too. Rich date, score, comment-count, upvote-ratio, keyword and author filters; no API key, no login, no proxy setup.\n\n## What this actor does\n\n- **Any public subreddit:** bare name (`python`), `r/`-prefixed name (`r/python`) or a full Reddit URL; multiple subreddits in one run\n- **Six listing modes:** `hot`, `new`, `top`, `rising`, `controversial`, `best`; `top` and `controversial` support Reddit's six time windows\n- **Deep history:** follows Reddit's listing pages to the practical ceiling (roughly 1,000 posts for hot/new, about 500 for top/controversial)\n- **Posts with media:** score, upvote ratio, comment count, author, flair, selftext, images, gallery images (full resolution), video (HLS + MP4), poll options and votes, crosspost parent\n- **Optional comment threads:** full nested trees with 6 comment sorts, depth, parent links, OP flag, edited/deleted flags and awards\n- **Rich filtering:** date range, score, comment count, upvote ratio, post type, flair, title/body keywords, authors, domain, awards, content length and moderation flags\n- **Empty fields are omitted** from the output — no need to defend against `null`/empty values downstream\n\n## Output per post\n\n- `dataType` — always `post`\n- `subreddit`, `subreddit_prefixed`, `subreddit_id`\n- `post_id`, `post_name`, `title`\n- `author`, `author_id`\n- `url`, `permalink`, `content_url`, `domain`\n- `is_self`, `post_type` (`self`/`link`/`image`/`video`/`gallery`/`poll`), `post_type_raw`\n- `score`, `upvote_ratio`, `num_comments`\n- `link_flair`, `link_flair_background_color`, `flair_url`\n- `content` (self-post text), `content_html`\n- `thumbnail_url`\n- `created_utc`, `created_at` (ISO-8601 UTC)\n- `is_stickied`, `is_nsfw`, `is_spoiler`, `is_crosspost`\n- `is_archived` — when the comment mode loads the post page\n- `total_awards_received`, `top_award_id`, `top_award_icon_url`\n- `media_type`, `has_media`\n- `images[]`, `gallery_images[]`, `gallery_count`\n- `video_url` (direct MP4), `video_hls_url` (HLS)\n- `poll_data` — options, option ids, total votes, closing time\n- `crosspost_parent_id`, `crosspost_parent_subreddit`, `crosspost_parent_url`\n- `language`, `crawled_at`, `source`\n\nFor crossposts, `content` is the parent text Reddit renders in the listing, while `post_type_raw` is `crosspost` and the `crosspost_parent_*` fields identify the source post.\n\n## Output per comment\n\nReturned when `includeComments` is on and `maxCommentsPerPost` is above 0. The parent post is emitted first, then its comments.\n\n- `dataType` — always `comment`\n- `subreddit`, `subreddit_prefixed`, `subreddit_id`\n- `post_id`, `post_url`, `post_title`, `link_id`\n- `comment_id`, `comment_name`, `parent_id`, `parent_kind`\n- `author`, `avatarUrl`\n- `body`, `body_html`\n- `score`, `total_awards_received`\n- `depth` (0 = top-level), `position`, `parentPositions`\n- `is_op`, `collapsed`, `contentType`\n- `isCommentDeleted`, `isAuthorDeleted`, `isHighlighted`, `hasPaidAward` — present only when true\n- `created_utc`, `created_at`, `edited`, `edited_at`\n- `permalink`, `crawled_at`, `source`\n\n## Fields not available anonymously\n\nReddit no longer exposes these to logged-out readers of the public pages, so they are omitted rather than guessed: author flair, raw upvotes/downvotes, post `distinguished` (mod/admin badge), `removed_by_category`, post `locked`, original-content marker, `gilded`, the award-type breakdown, video duration/bitrate/dimensions, and oEmbed title/author/HTML for external links. Link posts still carry their target URL and preview image.\n\n## Input\n\n| Field | Type | Default | Description |\n|---|---|---|---|\n| `subreddits` | array | – | **Required.** Subreddit names, `r/`-prefixed names or full URLs |\n| `maxPosts` | int | `25` | Max posts per subreddit after filters (1–5,000) |\n| `maxItems` | int | `10,000` | Global safety cap on total records (posts + comments) |\n| `sort` | enum | `new` | `hot`, `new`, `top`, `rising`, `controversial`, `best` |\n| `timeFilter` | enum | `day` | `hour`, `day`, `week`, `month`, `year`, `all` (top/controversial) |\n| `includeComments` | bool | `false` | Collect comments for every harvested post |\n| `maxCommentsPerPost` | int | `0` | Max comments per post (0–100,000); needs `includeComments` |\n| `commentSort` | enum | `confidence` | `confidence`, `top`, `new`, `controversial`, `old`, `qa` |\n| `postedAfter` | date | – | Only posts created on/after this date (UTC); switches the listing to `new` |\n| `postedBefore` | date | – | Only posts created on/before this date (UTC) |\n| `includeNSFW` | bool | `false` | Include posts explicitly flagged NSFW |\n| `onlyWithFlair` | bool | `false` | Drop posts without a link flair |\n| `postType` | enum | – | `text`, `link`, `image`, `video`, `gallery`, `poll`, `crosspost`, `multi_media` |\n| `minScore` | int | – | Minimum post score |\n| `maxScore` | int | – | Maximum post score |\n| `minComments` | int | – | Minimum comment count |\n| `maxComments` | int | – | Maximum comment count |\n| `minUpvoteRatio` | number | – | Minimum upvote ratio (0–1) |\n| `excludeStickied` | bool | `false` | Drop pinned/stickied posts |\n| `excludeCrossposts` | bool | `false` | Drop crossposts |\n| `excludeSpoilers` | bool | `false` | Drop spoiler-tagged posts |\n| `titleContains` | string | – | Keep posts whose title contains this text |\n| `contentContains` | string | – | Keep self posts whose body contains this text |\n| `flairContains` | string | – | Keep posts whose flair contains this text |\n| `authors` | array | – | Keep posts by these usernames |\n| `excludeAuthors` | array | – | Drop posts by these usernames |\n| `excludeKeywords` | array | – | Drop posts whose title/body/flair contains any keyword |\n| `domain` | string | – | Keep posts whose link domain contains this text |\n| `minAwards` | int | – | Minimum total awards |\n| `excludeDeletedAuthor` | bool | `false` | Drop posts with a deleted/removed author |\n| `minContentLength` | int | – | Minimum self-post body length |\n| `maxContentLength` | int | – | Maximum self-post body length |\n| `fullSubreddit` | bool | `false` | Walk the `new` listing as deep as Reddit allows |\n\n### Example: 25 new posts from r/Python\n\n```json\n{\n  \"subreddits\": [\"python\"],\n  \"maxPosts\": 25,\n  \"sort\": \"new\"\n}\n```\n\n### Example: top image posts with media\n\n```json\n{\n  \"subreddits\": [\"pics\"],\n  \"maxPosts\": 50,\n  \"sort\": \"top\",\n  \"timeFilter\": \"week\",\n  \"postType\": \"gallery\"\n}\n```\n\n### Example: posts plus full comment threads\n\n```json\n{\n  \"subreddits\": [\"technology\"],\n  \"maxPosts\": 20,\n  \"sort\": \"hot\",\n  \"includeComments\": true,\n  \"maxCommentsPerPost\": 100,\n  \"commentSort\": \"top\"\n}\n```\n\n### Example: brand monitoring with filters\n\n```json\n{\n  \"subreddits\": [\"startups\", \"Entrepreneur\", \"SaaS\"],\n  \"maxPosts\": 100,\n  \"sort\": \"new\",\n  \"postedAfter\": \"2026-10-01\",\n  \"minScore\": 5,\n  \"excludeAuthors\": [\"AutoModerator\"],\n  \"excludeKeywords\": [\"megathread\", \"giveaway\"]\n}\n```\n\n## Use cases\n\n- **Market research** — collect authentic community opinions and pain points\n- **Brand monitoring** — track product mentions across subreddits on a schedule\n- **Content ideation** — find trending questions and high-engagement topics\n- **Training data** — build clean Reddit corpora with full comment context for NLP/LLM work\n- **Competitive intelligence** — monitor launches, sentiment and competitor discussions\n- **Academic and social research** — export a subreddit's reachable history for discourse analysis\n\n## FAQ\n\n**Do I need a Reddit API key or login?**\nNo. The actor reads Reddit's public web data — no API key, no OAuth, no cookies, no account.\n\n**Do I need to configure a proxy?**\nNo. The actor chooses a working connection to Reddit automatically. Just fill in the input and run it.\n\n**What happens with private, banned or misspelled subreddits?**\nThey return no records and the run continues with the remaining subreddits. If nothing is found, the run finishes with a status message suggesting you check the names or loosen filters.\n\n**How many posts can I get from one subreddit?**\nUp to `maxPosts` (5,000), but Reddit serves roughly 1,000 posts per hot/new listing and about 500 for top/controversial. `fullSubreddit` walks the `new` listing to that ceiling. Filters are applied after posts are loaded, so strict filters can return fewer rows than `maxPosts`.\n\n**Why did I get no comments?**\n`maxCommentsPerPost` defaults to `0`, which collects none. Set it (for example `100`) and enable `includeComments`. If `maxItems` is tight, the actor keeps every requested post and trims comments first.\n\n**Why are some fields missing from a record?**\nThe actor omits values Reddit does not expose publicly (author flair, raw upvotes/downvotes, post distinguished/removed flags, award breakdown, video duration). Empty values are omitted rather than emitted as `null`, so records stay clean.\n\n**Why is the video URL a low-resolution MP4?**\nReddit serves a direct low-resolution MP4 plus an HLS playlist. The actor provides both: `video_url` for durable downloads and `video_hls_url` for the adaptive stream when Reddit's signed playlist is available. HLS links can expire; `video_url` is the stable choice.\n\n**Why are some NSFW or spoiler posts still included?**\n`includeNSFW` filters posts Reddit explicitly flags. Posts in 18+ communities are served to the actor's adult-content session and cannot be distinguished at community level; use `excludeSpoilers` or keyword filters for tighter control.\n\n**Can I schedule recurring runs?**\nYes — create a schedule in Apify Console for daily or weekly monitoring. Use `postedAfter` or `sort: \"new\"` to collect only recent posts.\n\n**How do I export or integrate the data?**\nDownload JSON, CSV, Excel or HTML from the run, call the dataset API, or connect to n8n, Make, Zapier or the Apify MCP server.\n",
      "input": {
        "title": "Reddit Subreddit Scraper Input",
        "type": "object",
        "schemaVersion": 1,
        "properties": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "List of subreddits to scrape. Accepts bare names (python), r/ prefixed (r/python) or full URLs (https://www.reddit.com/r/python/).",
            "editor": "stringList",
            "example": [
              "python",
              "r/programming",
              "https://www.reddit.com/r/webdev/"
            ],
            "prefill": [
              "python"
            ],
            "minItems": 1
          },
          "maxPosts": {
            "title": "Maximum posts per subreddit",
            "type": "integer",
            "description": "Maximum number of posts to keep from each subreddit after filters. Reddit serves roughly 1,000 posts per hot/new listing and about 500 for top/controversial.",
            "minimum": 1,
            "maximum": 5000,
            "default": 25,
            "prefill": 25,
            "example": 25
          },
          "maxItems": {
            "title": "Maximum total items (safety cap)",
            "type": "integer",
            "description": "Global safety cap on the total number of records pushed for the whole run (posts and comments combined).",
            "minimum": 1,
            "maximum": 100000,
            "default": 10000,
            "prefill": 10000,
            "example": 5000
          },
          "sort": {
            "title": "Sort posts by",
            "type": "string",
            "description": "How to sort posts in the subreddit. Reddit serves roughly 1,000 posts per hot/new listing and about 500 for top/controversial.",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "best"
            ],
            "default": "new",
            "prefill": "new",
            "enumTitles": [
              "Hot",
              "New",
              "Top",
              "Rising",
              "Controversial",
              "Best"
            ]
          },
          "timeFilter": {
            "title": "Time filter (for 'top' and 'controversial' sort)",
            "type": "string",
            "description": "Time filter when sorting by 'top' or 'controversial'.",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "default": "day",
            "prefill": "day",
            "enumTitles": [
              "Past Hour",
              "Past Day",
              "Past Week",
              "Past Month",
              "Past Year",
              "All Time"
            ]
          },
          "includeComments": {
            "title": "Include comments for each post",
            "type": "boolean",
            "description": "When enabled, the full comment thread (including nested replies) is collected for every scraped post. Significantly increases run time and output.",
            "default": false,
            "prefill": false
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "type": "integer",
            "description": "Maximum number of comments to scrape per post (only used when 'Include comments' is enabled).",
            "minimum": 0,
            "maximum": 100000,
            "default": 0,
            "prefill": 0,
            "example": 100
          },
          "commentSort": {
            "title": "Sort comments by",
            "type": "string",
            "description": "How to sort the comment threads.",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "default": "confidence",
            "prefill": "confidence",
            "enumTitles": [
              "Best (Confidence)",
              "Top",
              "New",
              "Controversial",
              "Old",
              "Q&A"
            ]
          },
          "postedAfter": {
            "title": "Posts created on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Only keep posts created on or after this date (UTC). When set, collection runs newest-first (sort=new) and the sort option above is ignored. Reddit caps each listing at roughly 1,000 posts, so a distant date window on a very active subreddit may not be fully reachable.",
            "editor": "datepicker",
            "example": "2025-01-01"
          },
          "postedBefore": {
            "title": "Posts created on or before (YYYY-MM-DD)",
            "type": "string",
            "description": "Only keep posts created on or before this date (interpreted as the end of that day, UTC).",
            "editor": "datepicker",
            "example": "2025-12-31"
          },
          "includeNSFW": {
            "title": "Include NSFW (18+) content",
            "type": "boolean",
            "description": "Include posts Reddit explicitly flags as NSFW. Posts in 18+ communities are served by the actor's adult-content cookie and are not distinguishable at community level.",
            "default": false,
            "prefill": false
          },
          "onlyWithFlair": {
            "title": "Only posts that have a flair",
            "type": "boolean",
            "description": "When enabled, posts without a flair tag are dropped from the results.",
            "default": false,
            "prefill": false
          },
          "postType": {
            "title": "Only posts of this type",
            "type": "string",
            "description": "Keep only posts of the selected content type (based on Reddit's listing type). Leave unset to keep all types. Legacy 'self' is treated as 'text'.",
            "enum": [
              "text",
              "link",
              "image",
              "video",
              "gallery",
              "poll",
              "crosspost",
              "multi_media"
            ],
            "enumTitles": [
              "Text post",
              "Link",
              "Image",
              "Video",
              "Gallery",
              "Poll",
              "Crosspost",
              "Multi-media post"
            ]
          },
          "minScore": {
            "title": "Minimum score (upvotes minus downvotes)",
            "type": "integer",
            "description": "Only keep posts with a score at or above this value. Leave unset to keep all scores.",
            "minimum": -100000,
            "maximum": 1000000,
            "example": 10
          },
          "maxScore": {
            "title": "Maximum score (upvotes minus downvotes)",
            "type": "integer",
            "description": "Only keep posts with a score at or below this value. Useful for finding overlooked/low-visibility posts. Leave unset to keep all scores.",
            "minimum": -100000,
            "maximum": 1000000,
            "example": 1000
          },
          "minComments": {
            "title": "Minimum number of comments",
            "type": "integer",
            "description": "Only keep posts with at least this many comments. Leave unset to keep all posts.",
            "minimum": 0,
            "maximum": 1000000,
            "example": 5
          },
          "maxComments": {
            "title": "Maximum number of comments",
            "type": "integer",
            "description": "Only keep posts with at most this many comments. Useful for finding under-discussed posts. Leave unset to keep all posts.",
            "minimum": 0,
            "maximum": 1000000,
            "example": 500
          },
          "excludeStickied": {
            "title": "Exclude stickied/pinned posts",
            "type": "boolean",
            "description": "When enabled, posts pinned/stickied by moderators (e.g. rules, weekly threads) are dropped from the results.",
            "default": false,
            "prefill": false
          },
          "minUpvoteRatio": {
            "title": "Minimum upvote ratio",
            "type": "number",
            "description": "Only keep posts whose upvote ratio (fraction of votes that are upvotes, 0-1) is at or above this value. Useful for filtering out controversial/divisive posts. Leave unset to keep all ratios.",
            "minimum": 0,
            "maximum": 1,
            "example": 0.8
          },
          "excludeCrossposts": {
            "title": "Exclude crossposts",
            "type": "boolean",
            "description": "When enabled, posts that are crossposts from another subreddit are dropped from the results, keeping only original submissions to the scraped subreddit.",
            "default": false,
            "prefill": false
          },
          "excludeSpoilers": {
            "title": "Exclude spoiler-tagged posts",
            "type": "boolean",
            "description": "When enabled, posts marked as a spoiler by their author are dropped from the results.",
            "default": false,
            "prefill": false
          },
          "titleContains": {
            "title": "Title contains keyword",
            "type": "string",
            "description": "Only keep posts whose title contains this text (case-insensitive substring match). Leave empty to keep all titles.",
            "editor": "textfield",
            "example": "launch"
          },
          "contentContains": {
            "title": "Post text contains keyword",
            "type": "string",
            "description": "Only keep self (text) posts whose body contains this text (case-insensitive substring match). Link/image/video posts have no body text and are excluded when this is set. Leave empty to keep all posts.",
            "editor": "textfield",
            "example": "tutorial"
          },
          "flairContains": {
            "title": "Flair contains keyword",
            "type": "string",
            "description": "Only keep posts whose flair text contains this text (case-insensitive substring match). Leave empty to keep all flairs.",
            "editor": "textfield",
            "example": "Discussion"
          },
          "authors": {
            "title": "Only posts by these authors",
            "type": "array",
            "description": "Only keep posts submitted by one of these usernames (bare name or u/-prefixed, case-insensitive). Leave empty to keep posts from all authors.",
            "editor": "stringList",
            "example": [
              "spez"
            ]
          },
          "domain": {
            "title": "Domain contains",
            "type": "string",
            "description": "Only keep posts whose link domain contains this text (case-insensitive, e.g. 'youtube.com' or 'self.python'). Leave empty to keep all domains.",
            "editor": "textfield",
            "example": "youtube.com"
          },
          "minAwards": {
            "title": "Minimum awards received",
            "type": "integer",
            "description": "Only keep posts with at least this many total awards. Leave unset to keep all posts.",
            "minimum": 0,
            "maximum": 1000000,
            "example": 1
          },
          "excludeDeletedAuthor": {
            "title": "Exclude posts with a deleted/removed author",
            "type": "boolean",
            "description": "When enabled, posts whose author account was deleted (shown as [deleted]/[removed]) are dropped from the results.",
            "default": false,
            "prefill": false
          },
          "excludeAuthors": {
            "title": "Exclude posts by these authors",
            "type": "array",
            "description": "Drop posts submitted by any of these usernames (bare name or u/-prefixed, case-insensitive) — useful for filtering out bots (e.g. AutoModerator) or known spam accounts. Leave empty to keep posts from all authors.",
            "editor": "stringList",
            "example": [
              "AutoModerator"
            ]
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop posts whose title, self-text body or flair contains any of these keywords or phrases (case-insensitive substring match) — useful for filtering out megathreads, giveaways or spam boilerplate. Leave empty to keep all posts.",
            "editor": "stringList",
            "example": [
              "megathread"
            ]
          },
          "minContentLength": {
            "title": "Minimum post body length (characters)",
            "type": "integer",
            "description": "Only keep self (text) posts whose body is at least this many characters long. Link/image/video posts have no body and are excluded when this is set. Useful for dropping one-line/low-effort text posts when building NLP datasets. Leave unset to keep all lengths.",
            "minimum": 0,
            "maximum": 1000000,
            "example": 100
          },
          "maxContentLength": {
            "title": "Maximum post body length (characters)",
            "type": "integer",
            "description": "Only keep self (text) posts whose body is at most this many characters long. Leave unset to keep all lengths.",
            "minimum": 0,
            "maximum": 1000000,
            "example": 5000
          },
          "fullSubreddit": {
            "title": "Full subreddit mode (deepest reachable history)",
            "type": "boolean",
            "description": "When enabled, walk Reddit's 'new' listing as deep as the source allows (roughly 1,000 posts per listing) instead of stopping at the first page. Combine with a higher 'Maximum posts per subreddit'.",
            "default": false,
            "prefill": false
          }
        },
        "required": [
          "subreddits"
        ]
      },
      "output": {
        "actorOutputSchemaVersion": 1,
        "title": "Reddit Subreddit Post & Comment Harvester Output",
        "description": "Reddit subreddit posts with score, flair, selftext, images, galleries, video, polls and crosspost context, plus optional nested comment threads.",
        "properties": {
          "postAndCommentRecords": {
            "type": "string",
            "title": "Post & comment records",
            "description": "Dataset containing one record per post, plus one record per comment when 'Include comments' is on. Records are distinguished by the `dataType` field (`post` or `comment`).",
            "template": "{{links.apiDefaultDatasetUrl}}/items"
          }
        }
      },
      "storages": {
        "dataset": {
          "actorSpecification": 1,
          "views": {
            "overview": {
              "title": "Reddit Posts",
              "transformation": {
                "fields": [
                  "subreddit_prefixed",
                  "title",
                  "author",
                  "score",
                  "upvote_ratio",
                  "num_comments",
                  "post_type",
                  "created_at",
                  "link_flair",
                  "url"
                ]
              },
              "display": {
                "component": "table",
                "properties": {}
              }
            }
          }
        }
      },
      "environmentVariables": {},
      "defaultRunOptions": {
        "build": "latest",
        "timeoutSecs": 3600,
        "memoryMbytes": 1024
      }
    },
    "buildNumber": "1.0.2",
    "imageDigest": "49cb51a602ee0f90df0e84a211bca763327fe80b78a4b426044877d78a1a945b",
    "actVersion": {
      "sourceType": "SOURCE_FILES",
      "buildTag": "latest",
      "versionNumber": "1.0"
    },
    "usage": {
      "ACTOR_COMPUTE_UNITS": 0.08277444444444444
    }
  }
}