A powerful, async-first Reddit scraper (with built-in proxy support) for posts and comments with detailed metrics (no login or API key). Scrape subreddits, profiles, and specific posts, or search Reddit site-wide by keywords. Collect rich, structured data including authors, scores, timestamps, post flairs, full comment threads, and more (24+ fields).
If this repo is useful to you or saved you time, consider starring β it to support me and help others find it and have an easier time scraping Reddit β€οΈ.
Need a hosted version? Check Reddit Scraper Pro on Apify.
Installation β’ Quickstart β’ Stealth Mode β’ Features β’ Output Dataset β’ Reddrix Arguments
Tip
Reddrix works best with the stealth=True argument (see below) . This argument is the default argument, unless you choose to switch it off.
pip install -U reddrix
reddrix install # Mandatory for installing the Camoufox browser.Using Async Context Manager:
from reddrix import Reddrix
import asyncio
async def main():
async with Reddrix(
mode="standard",
subreddit_urls=[
"https://www.reddit.com/r/webscraping",
# URLs of specific subreddits to include when scraping posts and comments
# Add as many as you want
],
profile_urls=[], # URLs of specific profiles to include when scraping posts and comments; add as many as you want. Only public data is scraped
post_urls=[], # URLs of specific posts to include in the scraping; add as many as you like
sort="new",
include_comments=True,
max_results=500,
max_posts_per_collection=500,
verbose=True
) as reddrix:
scrape_count = 0
async for item in reddrix.get_items():
# item is a Python dictionary with 24 keys.
scrape_count += 1
print(scrape_count, item["submissionType"], item["submissionUrl"])
if __name__ == "__main__":
asyncio.run(main())Without the context manager:
from reddrix import Reddrix
import asyncio
async def main():
reddrix = Reddrix(
mode="standard",
subreddit_urls=["https://www.reddit.com/r/webscraping"],
sort="new",
include_comments=True,
max_results=500,
max_posts_per_collection=500,
verbose=True
)
await reddrix.start()
scrape_count = 0
async for item in reddrix.get_items():
# item is a Python dictionary with 24 keys.
scrape_count += 1
print(scrape_count, item["submissionType"], item["submissionUrl"])
await reddrix.stop()
if __name__ == "__main__":
asyncio.run(main())Scraping Posts and Comments Based on Keywords (uses Reddit's current shreddit search engine):
from reddrix import Reddrix
import asyncio
async def main():
async with Reddrix(
mode="keyword_search",
sort="new", # The sort option is ignored for this mode
query="how to scrape reddit",
include_comments=True,
max_results=500,
max_posts_per_collection=500,
verbose=True
) as reddrix:
scrape_count = 0
async for item in reddrix.get_items():
# item is a Python dictionary with 24 keys.
scrape_count += 1
print(scrape_count, item["submissionType"], item["submissionUrl"])
if __name__ == "__main__":
asyncio.run(main())Using Reddrix as a standalone Reddit http client for your custom scraping setup (has both GET and POST methods):
from reddrix import Reddrix
import asyncio
async def main():
async with Reddrix() as reddrix:
html_content = await reddrix.get(url="https://www.reddit.com/search?q=how+to+scrape+reddit") # Only HTML/XML is supported
print(html_content)
if __name__ == "__main__":
asyncio.run(main())Tip
Random request jittering does not apply when using the GET and POST methods directly, so use your own jittering in this case, or just use the preset scraping setup shown above.
Using Reddrix with Proxies:
from reddrix import Reddrix
import asyncio
async def main():
async with Reddrix(
# Your normal arguments above ...,
proxies=[
"scheme://user:pass@hostname:port",
"scheme://user2:pass2@hostname2:port2",
# Add as many as you want, and Reddrix automatically rotates between them...
]
) as reddrix:
scrape_count = 0
async for item in reddrix.get_items():
# item is a Python dictionary with 24 keys.
scrape_count += 1
print(scrape_count, item["submissionType"], item["submissionUrl"])
if __name__ == "__main__":
asyncio.run(main())The stealth mode has 3 options: True, False, and adaptive.
Why is it needed?
Reddrix no longer relies on Reddit's legacy JSON endpoints, since these endpoints are now behind login walls. Instead, it scrapes New Reddit's HTML and internal API endpoints, and these are protected by Cloudflare and reCaptcha Enterprise.
How It Works:
When stealth is set to True (the default option), Reddrix will open Camoufox, navigate to an empty sub page to harvest cookies, then will start scraping by sending direct HTTP requests to Reddit's internal API endpoints from within the same Camoufox browser context using JavaScript fetch (no navigation, no clicking). While firing these requests, Reddrix will initialize randomized mouse movements with random delays and human-like patterns in the loaded page. This approach avoids the fingerprint drift between the browser and the wreq client by sending the HTTP requests from the same browser. Additionally, the random mouse movements constantly generate reCaptcha Enterprise clearances, ensuring the session remains trusted and lasts a long time while still preserving most of the scraping speed.
Disadvantage:
The disadvantage is heavy resource usage.
If this option is set to adaptive, it will only be activated when include_comments is set to True, since comments are often more protected by anti-bot measures.
Example Code:
from reddrix import Reddrix
import asyncio
async def main():
async with Reddrix(
mode="standard",
stealth=True, # Can also be set to False or "adaptive"
subreddit_urls=["https://www.reddit.com/r/webscraping"],
sort="new",
include_comments=True,
max_results=500,
max_posts_per_collection=500,
verbose=True
) as reddrix:
scrape_count = 0
async for item in reddrix.get_items():
# item is a Python dictionary with 24 keys.
scrape_count += 1
print(scrape_count, item["submissionType"], item["submissionUrl"])
if __name__ == "__main__":
asyncio.run(main())- π Async-First: High-performance asynchronous scraping with
asyncioand an async iterator for streaming results. - π₯· Adaptive Stealth: Optionally enable the
stealthmode for intelligent, highly undetectable scraping. - π No Login or API Key: Scrape Reddit seamlessly without logging in or providing an API key.
- π Multiple Search Modes: Scrape subreddits, user profiles, and specific posts, or search Reddit by keywords.
- π¬ Comprehensive Data Extraction: Collect posts and comments with 24+ structured fields, including authors, scores, timestamps, flairs, media URLs, and FULL comment threads (no depth limit).
- π‘οΈ Resilient Scraping: Built-in retries, cookie renewal, request jittering, and configurable proxies.
- βοΈ Fine-Grained Control: Configure sorting, time frames, result limits, comment depth, and comment counts.
- π§© Standalone HTTP Client: Use Reddrix's asynchronous
get()orpost()method in your own custom scraping workflows. - π Pythonic API: Manage scraper resources with an async context manager or explicit
start()andstop()methods.
If you use the preset scraping setup from async for item reddrix.get_items(), each item is a Python dictionary with 24 keys.
Example Reddit Post Output:
{
"submissionId": "1w1gc8p",
"submissionIdPrefixed": "t3_1w1gc8p",
"submissionType": "post",
"submissionUrl": "https://www.reddit.com/r/Sat/comments/1w1gc8p/is_this_good_improvement_for_10_hours_of/",
"submittedAt": "2026-08-29T07:53:42+00:00",
"parentId": None,
"parentPostId": None,
"parentPostUrl": None,
"postType": "image",
"crosspostParentId": None,
"crosspostParentUrl": None,
"title": "Is this good improvement for 10 hours of dedicated study + need help for rw section",
"bodyText": "math significantly improved but reading writing is too tough for me (international student)\n\nplease help, i have to give the sat in two months, will reading novels improve my rw score?",
"author": "stcer",
"depth": None,
"postFlair": None,
"tags": [],
"subreddit": "r/Sat",
"score": 32,
"upvoteRatio": 0.98,
"numComments": 29,
"numCrossposts": 0,
"externalUrl": "https://i.redd.it/cjhezz5bs9mh1.jpeg",
"galleryImagesUrls": []
}Example Comment Output:
{
"submissionId": "p6lwobb",
"submissionIdPrefixed": "t1_p6lwobb",
"submissionType": "comment",
"submissionUrl": "https://www.reddit.com/r/Sat/comments/1w1gc8p/is_this_good_improvement_for_10_hours_of/p6lwobb/",
"submittedAt": "2026-08-29T13:41:52+00:00",
"parentId": "t3_1w1gc8p",
"parentPostId": "t3_1w1gc8p",
"parentPostUrl": "https://www.reddit.com/r/Sat/comments/1w1gc8p",
"postType": None,
"crosspostParentId": None,
"crosspostParentUrl": None,
"title": None,
"bodyText": "How did you do that in 10 hours? Can you please give me the sources that you used? I also need help in rw section and Iβll take the sat in 2 weeks",
"author": "AnalysisStill4932",
"depth": 0,
"postFlair": None,
"tags": [],
"subreddit": "r/Sat",
"score": 9,
"upvoteRatio": None,
"numComments": None,
"externalUrl": None,
"thumbnailUrl": None,
"galleryImagesUrls": []
}Output Fields Explanation:
submissionIdβ [string] The ID of the post or comment.submissionIdPrefixedβ [string] The prefixed ID of the post or comment.submissionTypeβ [string] Whether the submission is apostorcomment.submissionUrlβ [string] The URL for the submission.submittedAtβ [string] The date and time the post or comment was submitted in UTC timezone and ISO format.parentIdβ [string,None] The ID of the direct parent post or comment.parentPostIdβ [string,None] The ID of the parent post. For posts, this field will always beNonesince posts have no parent.parentPostUrlβ [string,None] The URL of the parent post. For posts, this field will always beNonesince posts have no parent.postTypeβ [string,None] The post type. Can be any oftext,poll,link,crosspost,image,gallery, orvideo. For comments, this field will always beNone.crosspostParentIdβ [string,None] The ID of the parent of the crosspost (for posts that are not crossposts, will beNone).crosspostParentUrlβ [string,None] The URL of the parent of the crosspost (for posts that are not crossposts, will beNone).titleβ [string,None] The post title (will always beNonefor comments).bodyTextβ [string,None] The main text content of a post or comment.authorβ [string] The author of the post or comment.depthβ [integer,None] The comment depth (top-level comments have a depth of0and posts have a depth ofNone).postFlairβ [string,None] The post flair (will beNonefor comments).tagsβ [list] A list of the tags for the post (always empty for comments).subredditβ [string,None] The subreddit in which the post or comment was submitted.scoreβ [integer,None] The vote score of the post or comment.upvoteRatioβ [float,None] The ratio of upvotes to total number of votes of a post (alwaysNonefor comments).numCommentsβ [integer,None] The number of comments in a post (alwaysNonefor comments).externalUrlβ [string,None] The external URL in a post. For comments, this field will beNonebecause external URLs will be included in thebodyTextanyway.thumbnailUrlβ [string,None] The thumbnail image URL forvideo,image, andgallerypost types (alwaysNonefor any other submission).galleryImagesUrlsβ [list] A list of URLs for all images in a gallery (always empty for any submission other thangalleryposts).
mode(string) β Eitherstandardorkeyword_search. Default isstandard.stealth(string or boolean) β Whether to use the stealth mode (explained above) in scraping. Default isTrue.max_results(integer) β The maximum total number of items (posts and comments combined) to return across all sources. Default is999999.max_posts_per_collection(integer) β The maximum number of posts to scrape from each collection. A collection is a single subreddit, profile, keyword search, or domain. Default is999999.sort(string) β One ofdefault,new,hot,top_all_time,top_past_hour,top_today,top_past_week,top_past_month, andtop_past_year. Applies to subreddits and profiles. This option is ignored inkeyword_searchmode, which always uses Reddit's relevance sorting. Default isdefault.subreddit_urls(list of strings) β Subreddit URLs to scrape, e.g.["https://www.reddit.com/r/webscraping"]. Used instandardmode only. URLs that are not valid subreddit URLs are skipped. Default is[].post_urls(list of strings) β Specific post URLs to scrape, e.g.["https://www.reddit.com/r/webscraping/comments/abc123/post_title/"]. Used instandardmode only. URLs that are not valid post URLs are skipped. Default is[].profile_urls(list of strings) β User profile URLs to scrape the submitted posts of, e.g.["https://www.reddit.com/user/username"]. Both/user/and/u/URLs are supported. Used instandardmode only. URLs that are not valid profile URLs, or those of profiles that are deleted, banned, or hiding their content, are skipped. Default is[].query(string) β The search keywords to look up site-wide on Reddit. Used inkeyword_searchmode only. Default isNone.include_comments(boolean) β Whether to scrape the comments of each post in addition to the post itself. Comments are returned as separate items withsubmissionTypeset tocomment. Default isFalse.max_comments_depth(integer) β The maximum comment depth to scrape. Top-level comments have a depth of0, their replies have a depth of1, and so on. Only applies ifinclude_commentsisTrue. Default is999999.max_comments_per_post(integer) β The maximum total number of comments (top-level comments and replies) to scrape per post. Only applies ifinclude_commentsisTrue. Default is999999.max_top_comments_per_post(integer) β The maximum number of top-level comments (depth0) to scrape per post. Only applies ifinclude_commentsisTrue. Default is999999.proxies(list of strings) β A list of proxy URLs in the formatscheme://user:pass@hostname:port. Reddrix rotates through them automatically, picking an unused proxy first and reusing proxies only after the whole list has been used. Default is[](no proxy).verbose(boolean) β Whether to print timestamped log messages (initialization, retries, etc.) to the console. Default isFalse.
