Skip to content

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

🤖 Reddit Scraper API Suite: Subreddits, Search, Posts & Nested Comments ($1 / 1K)

Available on Apify n8n Creator Hub Zero Login Pricing

The fastest zero-login Reddit Scraper API suite on Apify ($1 / 1,000 items). Extract subreddit feeds, keyword brand mentions, posts, and deep nested comment trees to JSON, CSV, Python, or n8n.

🚀 Try Live on Apify • ⚡ Official n8n Creator Hub • 🔧 39 Free n8n Templates • 📖 Documentation & Schemas • 📚 Engineering Playbooks


🤖 Reddit Scraper API Suite: Subreddits, Search, Posts & Nested Comments (`$1 / 1K`)

Try it for Free
⚡ 1-Click Free Trial: Test live queries using Apify's `$5` free monthly credit • Zero login or cookies required


📦 Included in This Repository (Python Quickstarts, n8n Workflows, MCP & Sample Data)

This repository contains ready-to-run Python SDK scripts, 9-node n8n automation workflow .json templates, AI Agent MCP configuration (.cursor/mcp.json), and sample output datasets (JSON & CSV):

Extraction Engine 🐍 Python SDK Quickstart ⚡ n8n Workflow Template 📊 Sample Output 🚀 Cloud Console
Reddit Scraper & Media API: Posts, Users & Comments
unitbytes/reddit-scraper • Full Schema • Engineering Playbook
examples/run_reddit_scraper.py n8n/reddit-scraper-n8n-workflow.json JSON · CSV ⚡ Run on Apify
Reddit Search Scraper: Brand Monitoring & B2B Leads
unitbytes/reddit-search-scraper • Full Schema • Engineering Playbook
examples/run_reddit_search_scraper.py n8n/reddit-search-scraper-n8n-workflow.json JSON · CSV ⚡ Run on Apify
Reddit Comments Scraper: Comment Trees, Replies & Sentiment
unitbytes/reddit-comments-scraper • Full Schema • Engineering Playbook
examples/run_reddit_comments_scraper.py n8n/reddit-comments-scraper-n8n-workflow.json JSON · CSV ⚡ Run on Apify
Reddit Subreddit Scraper: Hot Posts & Subreddits
unitbytes/reddit-subreddits-scraper • Full Schema • Engineering Playbook
examples/run_reddit_subreddits_scraper.py n8n/reddit-subreddits-scraper-n8n-workflow.json JSON · CSV ⚡ Run on Apify

⚡ Pre-Configured 1-Click Task Presets

Launch pre-configured extraction templates directly in the Apify Cloud Console with zero parameter setup:

Task Preset Target Extraction Use Case Direct Launch
Scrape Reddit Subreddits, Threads & Nested Comments (All-in-One) Extract hot, top, or rising posts and full comment trees across any Reddit community without Reddit API OAuth keys or rate limits. ⚡ Run Task Preset
Monitor Reddit for High-Intent B2B Buying Signals & Competitor Mentions Search all of Reddit or specific subreddits for 'alternative to', 'best tool for', and competitor pain points to capture high-intent leads. ⚡ Run Task Preset
Extract Deep Reddit Comment Trees for AI RAG & Sentiment Analysis Unroll complete multi-level Reddit discussion threads with parentId hierarchy, upvote scores, and author flair for LLM training and VoC research. ⚡ Run Task Preset
Track Subreddit Community Feeds & Top Weekly Posts Bulk-monitor multiple subreddits by hot, new, top, or rising sort modes with subscriber metadata, flair tags, and permanent media URLs. ⚡ Run Task Preset

🛠️ Extraction Engines in This Suite

🚀 Reddit Scraper & Media API: Posts, Users & Comments (unitbytes/reddit-scraper)

Scrape Reddit posts, subreddits, comments, user profiles & HD media without API keys. Fast Reddit scraper API for hot posts, RAG & LLM datasets.

Key Capabilities

  • Full Subreddit Feed Extraction: Scrape Hot, New, Top, and Rising feeds across any public or NSFW subreddit with custom time filters (day, week, month, year, all-time).
  • Global Keyword & Multi-Subreddit Search: Execute cross-Reddit or targeted subreddit search queries to monitor brand mentions, emerging discussions, and sentiment.
  • Nested Discussion Comments: Optionally extract full nested discussion threads and comment trees with author karma, score, awards, and timestamp metadata.
  • Permanent Media & Video Links: Captures direct unwatermarked image URLs, Reddit video streams, external links, cross-posts, and self-text content in clean tabular format.

⚙️ Input Parameters (Schema)

Parameter Type Default / Prefill Description
startUrls array — Direct Reddit URLs to scrape. Supports Subreddit URLs (e.g. https://www.reddit.com/r/technology/), Post URLs with comments (e.g. https://www.reddit.com/r/technology/comments/...), and User Profile URLs (e.g. https://www.reddit.com/user/username/).
searchQuery string artificial intelligence Keyword to search across Reddit (or within the specified subreddit). Leave blank if using Start URLs.
searchTab string posts Reddit search tab / surface to scrape when performing a search query.
subreddit string — Target subreddit name (e.g. 'technology', 'SaaS', 'wallstreetbets') to restrict search results or scrape directly.
sort string hot Sorting criteria for subreddit posts or search results.
timeFilter string all Time filter applied when sorting by 'top' posts.
maxItems integer 50 Maximum number of items or posts to extract.
scrapeComments boolean — Whether to extract comment threads and full post bodies for posts discovered in Subreddit or Search feeds. (Direct Post URLs always extract comments unless disabled).
maxCommentsPerPost integer 20 Maximum number of top-level and nested comments to extract per post.
proxyConfiguration object {"useApifyProxy": true, "apifyProxyGroups": ["RE Residential proxy configuration. Reddit blocks datacenter IPs, so residential proxies are automatically enforced by default for high reliability.
customProxyUrl string — Optional custom residential proxy URL (e.g. MrScraper). If provided, it will be prioritized before falling back to Apify Residential.

Python SDK Quickstart (examples/run_reddit_scraper.py)

from apify_client import ApifyClient

APIFY_TOKEN = os.getenv("APIFY_API_TOKEN", "YOUR_APIFY_API_TOKEN")
if not APIFY_TOKEN or APIFY_TOKEN.startswith("YOUR_"):
    raise SystemExit("Please set your Apify API token: export APIFY_API_TOKEN='apify_api_...'")

client = ApifyClient(APIFY_TOKEN)

run_input = {
    "searchQuery": "artificial intelligence",
    "searchTab": "posts",
    "sort": "hot",
    "timeFilter": "all",
    "maxItems": 50,
    "maxCommentsPerPost": 20
}

run = client.actor("unitbytes/reddit-scraper").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("title"), item.get("url"), item.get("itemType"))

Sample Output Schema (samples/reddit-scraper-sample.json)

{
  "itemType": "post",
  "id": "1x0b0f5",
  "title": "Fraudster jailed for using 10K bots and AI songs to outstream Taylor Swift",
  "subreddit": "technology",
  "author": "music_fan",
  "score": 1542,
  "upvoteRatio": 0.96,
  "numComments": 85,
  "postType": "image",
  "url": "https://www.reddit.com/r/technology/comments/1x0b0f5/fraudster_jailed/",
  "permalink": "https://www.reddit.com/r/technology/comments/1x0b0f5/fraudster_jailed/",
  "createdAt": "2026-10-08T07:14:53.000Z",
  "mediaUrls": [
    "https://i.redd.it/fraudster-jailed-sample.jpeg"
  ],
  "scrapedAt": "2026-10-08T11:40:00.000Z"
}

Frequently Asked Questions

Q: Do I need a Reddit API key or OAuth developer app? No. The Actor runs zero-login in the cloud without Reddit API keys, OAuth tokens, or rate-limit quotas.

Q: Are extracted Reddit image and video links permanent? Yes. Reddit's default preview URLs contain temporary tokens that expire within hours. Our engine converts every image and gallery asset into a permanent CDN URL (https://i.redd.it/...).

Q: How are nested comment threads structured in the dataset? When scrapeComments: true or when scraping post URLs, the engine extracts both root comments (depth: 0, parentId: null) and deep reply trees (depth: 1, 2, 3+) with parentId and postId foreign keys.

Q: How does Pay-Per-Event pricing work for Reddit extraction? Standard runs cost $1.00 per 1,000 items ($0.001/item), with volume discounts down to $0.50 per 1,000 items on higher Apify plan tiers.


🚀 Reddit Search Scraper: Brand Monitoring & B2B Leads (unitbytes/reddit-search-scraper)

Search Reddit posts, comments, communities, users & media by keyword. Fast Reddit search scraper for brand monitoring, B2B lead generation & alerts.

Key Capabilities

  • All 5 Native Search Dimensions: The official Reddit API restricts search primarily to basic post endpoints. UnitBytes unlocks all 5 search tabs—including Subreddits, Users, Media, and Comments—in one unified API.
  • No Commercial Approval Gate: Official API access requires commercial licensing agreements and rigorous developer verification. UnitBytes operates instantly with zero credentials.
  • Permanent HD Media CDN Links: Standard API queries return media URLs that expire in hours. UnitBytes normalizes all media assets to permanent CDN URLs so your reports and dashboards never break.
  • Unbeatable Unit Economics: At $0.50–$1.00 per 1,000 results with no monthly commitments, you can run daily brand monitoring at 90% lower cost than official enterprise licensing.

⚙️ Input Parameters (Schema)

Parameter Type Default / Prefill Description
searchQuery (Required) string artificial intelligence Keyword, phrase, or topic to search across Reddit.
searchTab string posts Select which Reddit search tab to extract: Posts, Communities, People/Profiles, Media, or Comments.
subreddit string — Restrict keyword search within a specific subreddit (e.g. 'technology', 'SaaS', 'wallstreetbets'). Leave blank to search all of Reddit.
sort string relevance Sorting criteria for search results.
timeFilter string all Time filter applied when sorting by 'top' or 'relevance'.
maxItems integer 50 Maximum number of search results to extract.
scrapeComments boolean False When searching Posts, enable this to also fetch the full post body (selftext) and nested comment threads for each post.
maxCommentsPerPost integer 20 Maximum number of top-level and nested comments to extract per post when 'Extract Full Post Body & Comments' is enabled.
proxyConfiguration object {"useApifyProxy": true, "apifyProxyGroups": ["RE Residential proxy configuration. Reddit blocks datacenter IPs, so residential proxies are automatically enforced by default for high reliability.
customProxyUrl string — Optional custom residential proxy URL (e.g. MrScraper). If provided, it will be prioritized before falling back to Apify Residential.

Python SDK Quickstart (examples/run_reddit_search_scraper.py)

from apify_client import ApifyClient

APIFY_TOKEN = os.getenv("APIFY_API_TOKEN", "YOUR_APIFY_API_TOKEN")
if not APIFY_TOKEN or APIFY_TOKEN.startswith("YOUR_"):
    raise SystemExit("Please set your Apify API token: export APIFY_API_TOKEN='apify_api_...'")

client = ApifyClient(APIFY_TOKEN)

run_input = {
    "searchQuery": "artificial intelligence",
    "searchTab": "posts",
    "sort": "relevance",
    "timeFilter": "all",
    "maxItems": 50,
    "scrapeComments": False
}

run = client.actor("unitbytes/reddit-search-scraper").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("title"), item.get("searchQuery"), item.get("url"))

Sample Output Schema (samples/reddit-search-scraper-sample.json)

{
  "itemType": "post",
  "id": "1x0b0f5",
  "title": "Top AI tools changing small business operations in 2026",
  "subreddit": "smallbusiness",
  "author": "digital_growth_lead",
  "score": 420,
  "upvoteRatio": 0.94,
  "numComments": 85,
  "postType": "image",
  "url": "https://www.reddit.com/r/smallbusiness/comments/1x0b0f5/best_inventory_management_workflow_for_2026/",
  "permalink": "https://www.reddit.com/r/smallbusiness/comments/1x0b0f5/best_inventory_management_workflow_for_2026/",
  "createdAt": "2026-10-10T14:20:00.000Z",
  "mediaUrls": [
    "https://i.redd.it/example_asset.jpg"
  ],
  "searchQuery": "AI tools",
  "scrapedAt": "2026-10-11T16:00:00.000Z"
}

Frequently Asked Questions

Q: Can I search within a specific subreddit? Yes. Fill in both searchQuery and subreddit. The scraper will restrict search results strictly to that community.

Q: Can I search for user profiles or communities? Yes. Change searchTab to communities to find subreddits, or people to find user accounts and authors.

Q: What happens if no results match my search? The actor finishes cleanly with exit code 0, outputs an empty dataset, and charges $0.00.

Q: Are the media links permanent? Yes. All image and video links are automatically converted to permanent high-definition CDN links that never expire in your spreadsheets or dashboards.


🚀 Reddit Comments Scraper: Comment Trees, Replies & Sentiment (unitbytes/reddit-comments-scraper)

Scrape Reddit comments, full comment trees, and nested replies from any post URL. Fast Reddit comments scraper for sentiment analysis & LLM data.

Key Capabilities

  • Skip Weeks of Waiting & Strict Approval: Reddit requires commercial applications, legal reviews, and enterprise agreements to access comment streams. UnitBytes lets you pull full threads immediately.
  • No Expensive Monthly Contracts: The official API requires enterprise commitments starting at $1,000+/mo. UnitBytes charges from $0.50 per 1,000 comments on a pure pay-per-result basis.
  • Full Depth & Nested Hierarchy: While standard API endpoints limit comment depth and require pagination loops, UnitBytes harvests the complete conversational hierarchy (depth 0, 1, 2, 3+) in a single run.
  • Zero Formatting Headaches: Reddit returns deeply nested JSON trees that complicate spreadsheet analysis. UnitBytes flattens discussions into clean, relational rows that open directly in Excel or Google Sheets.

⚙️ Input Parameters (Schema)

Parameter Type Default / Prefill Description
startUrls (Required) array [{"url": "https://www.reddit.com/r/technology/co Direct Reddit post URLs to extract nested comment trees from (e.g. https://www.reddit.com/r/technology/comments/1x0b0f5/...).
maxCommentsPerPost integer 100 Maximum number of top-level comments and nested replies to extract per post.
proxyConfiguration object {"useApifyProxy": true, "apifyProxyGroups": ["RE Residential proxy configuration. Reddit blocks datacenter IPs, so residential proxies are automatically enforced by default for high reliability.
customProxyUrl string — Optional custom residential proxy URL (e.g. MrScraper). If provided, it will be prioritized before falling back to Apify Residential.

Python SDK Quickstart (examples/run_reddit_comments_scraper.py)

from apify_client import ApifyClient

APIFY_TOKEN = os.getenv("APIFY_API_TOKEN", "YOUR_APIFY_API_TOKEN")
if not APIFY_TOKEN or APIFY_TOKEN.startswith("YOUR_"):
    raise SystemExit("Please set your Apify API token: export APIFY_API_TOKEN='apify_api_...'")

client = ApifyClient(APIFY_TOKEN)

run_input = {
    "startUrls": [
        {
            "url": "https://www.reddit.com/r/technology/comments/1x0b0f5/fraudster_jailed_for_using_10k_bots_and_ai_songs/"
        }
    ],
    "maxCommentsPerPost": 100
}

run = client.actor("unitbytes/reddit-comments-scraper").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("itemType"), item.get("postId"), item.get("author"))

Sample Output Schema (samples/reddit-comments-scraper-sample.json)

{
  "itemType": "comment",
  "id": "m3k0x1y",
  "postId": "1x0b0f5",
  "parentId": null,
  "author": "tech_enthusiast",
  "body": "Streaming platforms need stricter auditing mechanisms. 10k bots running 24/7 is an insane amount of synthetic streams.",
  "score": 342,
  "depth": 0,
  "isSubmitter": false,
  "createdAt": "2026-10-11T12:30:15.000Z",
  "permalink": "https://www.reddit.com/r/technology/comments/1x0b0f5/comment/m3k0x1y/",
  "scrapedAt": "2026-10-11T16:01:26.000Z"
}

Frequently Asked Questions

Q: Do I need a Reddit account or API key? No. You can run this actor immediately with zero API keys, developer tokens, or Reddit accounts.

Q: How do I open the results in Excel or Google Sheets? Once your run finishes, click Export on the Apify dataset tab and choose CSV or Excel. The data is pre-flattened so every column loads cleanly with zero formatting errors.

Q: Can I reconstruct who replied to whom? Yes. Every comment record has depth, id, parentId, and postId. Top-level comments have depth: 0 and parentId: null. Nested replies (depth: 1, 2, 3...) set parentId directly to the id of the comment they are replying to.

Q: How many comments can I extract from a post? You can extract anywhere from 1 up to 5,000 comments and nested replies per post by adjusting maxCommentsPerPost.


🚀 Reddit Subreddit Scraper: Hot Posts & Subreddits (unitbytes/reddit-subreddits-scraper)

Scrape Reddit subreddits and subreddit posts (Hot, New, Top, Rising) with HD media. Fast Reddit subreddit scraper & hot posts feed extractor.

Key Capabilities

  • Zero API Developer Accounts or Approvals: Official access requires navigating Reddit's gated developer portal and satisfying strict commercial usage restrictions. UnitBytes works immediately with 1 click.
  • Fraction of Official API Costs: Official enterprise access involves $1,000+/mo commitments. UnitBytes offers flexible Pay-Per-Event pricing starting at $0.50 per 1,000 posts with zero minimums.
  • Permanent HD Media Links: Stop dealing with expiring media URLs that break your spreadsheets after a few hours. UnitBytes normalizes all media links to permanent CDN assets.
  • Instant Multi-Subreddit Batching: Scrape multiple communities in a single automated run without managing OAuth2 token refreshes, rate limits, or pagination cursors.

⚙️ Input Parameters (Schema)

Parameter Type Default / Prefill Description
subreddit string technology Subreddit name to scrape (e.g. 'technology', 'SaaS', 'wallstreetbets').
startUrls array — Direct subreddit links (e.g. https://www.reddit.com/r/technology/).
sort string hot Sorting criteria for the subreddit feed.
timeFilter string all Time filter applied when sorting by 'top' posts.
maxItems integer 50 Maximum number of posts to extract from the subreddit.
scrapeComments boolean False Whether to extract comment threads for scraped posts.
maxCommentsPerPost integer 20 Maximum number of top-level and nested comments to extract per post.
proxyConfiguration object {"useApifyProxy": true, "apifyProxyGroups": ["RE Residential proxy configuration. Reddit blocks datacenter IPs, so residential proxies are automatically enforced by default for high reliability.
customProxyUrl string — Optional custom residential proxy URL (e.g. MrScraper). If provided, it will be prioritized before falling back to Apify Residential.

Python SDK Quickstart (examples/run_reddit_subreddits_scraper.py)

from apify_client import ApifyClient

APIFY_TOKEN = os.getenv("APIFY_API_TOKEN", "YOUR_APIFY_API_TOKEN")
if not APIFY_TOKEN or APIFY_TOKEN.startswith("YOUR_"):
    raise SystemExit("Please set your Apify API token: export APIFY_API_TOKEN='apify_api_...'")

client = ApifyClient(APIFY_TOKEN)

run_input = {
    "subreddit": "technology",
    "sort": "hot",
    "timeFilter": "all",
    "maxItems": 50,
    "scrapeComments": False,
    "maxCommentsPerPost": 20
}

run = client.actor("unitbytes/reddit-subreddits-scraper").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("title"), item.get("url"), item.get("itemType"))

Sample Output Schema (samples/reddit-subreddits-scraper-sample.json)

{
  "itemType": "post",
  "id": "1x0b0f5",
  "title": "Major cybersecurity update released for enterprise systems",
  "subreddit": "technology",
  "author": "security_researcher",
  "score": 1250,
  "upvoteRatio": 0.96,
  "numComments": 142,
  "postType": "link",
  "url": "https://www.reddit.com/r/technology/comments/1x0b0f5/open_source_ai_models_reach_new_milestone/",
  "permalink": "https://www.reddit.com/r/technology/comments/1x0b0f5/open_source_ai_models_reach_new_milestone/",
  "createdAt": "2026-10-11T10:15:00.000Z",
  "selftext": "",
  "flair": "Cybersecurity",
  "isOver18": false,
  "isPinned": false,
  "mediaUrls": [
    "https://i.redd.it/security_infographic.png"
  ],
  "scrapedAt": "2026-10-11T16:00:00.000Z"
}

Frequently Asked Questions

Q: Can I scrape multiple subreddits in one run? Yes. Use the startUrls field to add multiple subreddit URLs. The actor will scrape each one in order and merge them into one dataset.

Q: Can I extract comments along with the posts? Yes. Toggle scrapeComments: true and specify maxCommentsPerPost. The actor will harvest full discussions and replies for each post.

Q: What happens if a subreddit does not exist or is private? The actor finishes cleanly with exit code 0, outputs an empty dataset, and charges $0.00.

Q: Are image and video links permanent? Yes. Expiring Reddit media links are automatically converted to permanent high-definition CDN links that never expire.


⚡ Quick Installation & Local Usage

1. Run with Python (apify-client)

git clone https://github.com/unitbytes/Reddit-Scraper-API.git
cd Reddit-Scraper-API
pip install -r requirements.txt
export APIFY_API_TOKEN="your_apify_api_token"
python examples/run_reddit_scraper.py

2. Import into n8n (Self-Hosted or Cloud)

  1. Open any .json file inside the n8n/ folder (or copy in 1 click from unitbytes.com/n8n / n8n.io/creators/unitbytes).
  2. Press Ctrl+V / Cmd+V directly onto your n8n workflow canvas.
  3. Configure your Apify API Token in the HTTP Header Auth credential on Node 2. Run UnitBytes (...) (and customize your search inputs in Node 1. Configure Search & Rules), then click Test Workflow.

3. Use with AI Coding Agents (Cursor, Windsurf & Claude Code MCP)

This repository includes a ready-to-use Model Context Protocol configuration at .cursor/mcp.json pointing to https://mcp.apify.com with this suite's UnitBytes actors pre-registered. Open this folder in Cursor or Windsurf to let your AI agent run live extractions and inspect schemas automatically.


💼 Need Done-For-You Datasets or Custom Pipelines?

Don't want to manage API tokens or scripts? UnitBytes Data Delivery provides ready-to-use CSV, Excel (.xlsx), Google Sheets, or Webhook feeds tailored to your exact target keywords, cities, or categories.

Releases

Packages

Contributors