Reddit Keyword Search with Advanced Filters
Pricing
from $0.49 / 1,000 results
Reddit Keyword Search with Advanced Filters
Search Reddit by keyword and filter the matches by subreddit, score, date range, NSFW status, and author before they reach your dataset.
Pricing
from $0.49 / 1,000 results
Rating
0.0
(0)
Developer
Nimbryxo-studio
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
18 days ago
Last modified
Categories
Features
Share
Search Reddit for one or more keywords and get back matching posts plus optional keyword-matched comments, narrowed down with subreddit allow/block lists, a minimum score, a relative or absolute date window, an NSFW toggle, and an author blocklist.
Reddit's anonymous old.reddit and public JSON endpoints are blocked, so this actor uses a multi-source transport with explicit provenance instead of pretending a blocked page was an empty successful run.
What this actor does
- Runs a separate search for each keyword and tags every record with the keyword that found it
- Uses a source cascade: a challenge-solved Playwright session on the rendered
www.reddit.com/search/page (default global path), Redlib (search, comment search, opaque cursors), Google Translatecommunity-more-postspartial (subreddit-scoped live listing), Arctic Shift archive (subreddit-scoped backfill/hydration and by-ID enrichment), the optional user-supplied OAuth token, and Reddit RSS only through its 2026-11-13 retirement date - Enriches rendered-search records through Arctic
/api/posts/idsand/api/comments/ids(whenincludeArchiveis on) so selftext, domain, flair, media, crosspost, edited and commentbody_html/reply fields are filled when the archive has them; live web metrics always win over the archive snapshot - Adds
source,sourceUrl,retrievedAt,dataFreshness,scoreAsOf,upvoteRatioAsOfandarchiveLagSecondsto every record so live metrics are never confused with archive snapshots - Searches comment bodies with
searchCommentsvia the rendered Reddit search, Redlib, and scoped Arctic, with RSStype=commentparent discovery + hydration as a fallback - Supports
onlyNew+monitorIdwatermarks for scheduled monitoring, including relative windows (hour…all);onlyNewforcessort=new, and a missingmonitorIdgets a stable keyword-set-derived id - Applies subreddit, score, age, date range, NSFW, author and multi-keyword AND filters; when client-side filters can starve results, sources are over-fetched (bounded) and then capped at the requested limit
- Does not treat unknown NSFW flags or missing score metrics as safe/passing; posts are dropped with a typed status, while comments without their own NSFW flag are kept fail-soft and counted as
nsfwUnknown - De-duplicates posts by
t3_idand comments byt1_idacross keywords and sources, merging provenance and preferring live metrics over archive snapshots - Fails loudly when every source fails; a working source with zero matches emits
no_results, not an error
Output records
Post records (recordType: "post")
Legacy fields are preserved: keyword, post_id, post_name, title, author, author_fullname, subreddit, subreddit_prefixed, content, score, num_comments, url, permalink, external_url, thumbnail_url, link_flair, created_utc, created_at, is_self, is_stickied, is_nsfw, is_spoiler, is_promoted, is_original_content, gilded_count, num_crossposts, crosspost_parent, post_hint, title_word_count, post_age_seconds.
Added fields include: keywords, upvote_ratio, source, sourceUrl, retrievedAt, dataFreshness, scoreAsOf, upvoteRatioAsOf, archiveLagSeconds, metricsAvailable, isNsfwKnown, isGallery, galleryItems, mediaUrls, videoUrl, removedByCategory, removalType, wasDeletedLater, subreddit_id, postType and provenance.
Content, media and metadata fields are additive and omit-empty: selftext, selftext_html, content_html, contentPreview, domain, url_overridden_by_dest, link_flair_type, link_flair_text_color, link_flair_background_color, link_flair_template_id, author_flair_text, author_flair_type, author_flair_text_color, author_flair_background_color, edited, edited_utc, edited_at, is_locked, is_archived, gildings, total_awards_received, all_awardings, crosspost_parent_id, crosspost_parent_title, crosspost_parent_subreddit, crosspost_parent_author, crosspost_parent_permalink, poll_data, previewUrls, video, videoDurationSeconds, subreddit_subscribers, subreddit_type, subreddit_nsfw and subreddit_quarantined.
subreddit is the bare name (Python); subreddit_prefixed is r/Python.
Comment records (recordType: "comment")
keyword, keywords, commentId, comment_id, post_id, link_id, parentId, parent_id, depth, body, author, author_fullname, subreddit, subreddit_prefixed, score, created_utc, created_at, permalink, isSubmitter, stickied, distinguished, scoreHidden, edited, collapsed, source, sourceUrl, retrievedAt, dataFreshness, scoreAsOf and provenance.
Added comment fields include: body_html, replies (direct child comment ids when the source exposes a tree), replyCount, hasMoreReplies, author_flair_text, author_flair_type, author_flair_text_color, author_flair_background_color, edited_utc, edited_at, controversiality, gildings, total_awards_received, all_awardings, subreddit_id, link_title, link_permalink and removedByCategory.
Status/error records (recordType: "status" or "error")
Emitted when sources partially fail, are rate-limited, return no results, cannot supply a requested metric/NSFW flag, or when every source fails. They include reason, message, keywords, sources, attemptedSources, counts, appliedFilters, sourceFailures and retryAfterSecs.
Typed reasons include: invalid_input, all_sources_failed, transport_blocked, login_required, challenge_required, rate_limited, source_timeout, source_unavailable, metrics_unavailable, nsfw_status_unavailable, all_filters_dropped_results, partial_results and no_results.
Input
| Field | Type | Default | Description |
|---|---|---|---|
keywords | array | – | Keywords to search; each runs as its own search (required) |
resultLimit | integer | 100 | Max posts per keyword (1-1000). Source caps are real: rendered search returns one page at a time, Translate 24/page, Redlib 7/page, Arctic 100/page |
sort | string | relevance | relevance, hot, top, new, or comments |
relativeWindow | string | all | hour, day, week, month, year, or all |
onlyNew | boolean | false | Emit only records newer than the stored watermark; forces sort=new; records without timestamps are not re-emitted |
monitorId | string | – | Stable key for the onlyNew watermark/seen IDs; omit to derive one from the keyword set |
searchComments | boolean | false | Search comment bodies and emit recordType=comment records |
commentLimit | integer | 50 | Max matching comments per keyword |
subredditFilter | array | [] | Only keep posts/comments from these subreddits (with or without r/) |
subredditBlocklist | array | [] | Drop posts/comments from these subreddits |
minScore | integer | – | Drop records below this score; sources without a score are reported as metrics_unavailable. Archive scores are timestamped snapshots |
maxAgeDays | integer | – | Drop records older than N days |
excludeNsfw | boolean | false | Drop NSFW posts; comments without a flag are kept fail-soft and counted as nsfwUnknown |
authorBlocklist | array | [] | Drop these usernames (case-insensitive) |
keywordRequireAll | boolean | false | With multiple keywords, keep only records whose title, content, or comment body contains all of them |
dateFrom | string | – | Earliest created_at (inclusive, YYYY-MM-DD or ISO) |
dateTo | string | – | Latest created_at (inclusive end-of-day) |
includeArchive | boolean | true | Use Arctic Shift for subreddit backfill, comment hydration, and by-ID enrichment of rendered-search records. Enrichment only fills missing fields and never overwrites live metrics |
redditOAuthToken | secret | – | Optional user OAuth Bearer token; never required |
redlibInstances | array | [] | Optional Redlib hostnames in priority order. Defaults to redlib-1.privadency.com, red.artemislena.eu |
resolveChallenges | boolean | true | Allow Playwright to solve Reddit/Redlib challenges and render the search page; disable for HTTP-only mode |
proxyConfiguration | object | – | Optional Apify proxy configuration, used by HTTP sources and the Playwright browser session |
Example: single keyword, top posts
{"keywords": ["machine learning"],"resultLimit": 100,"sort": "top","relativeWindow": "month"}
Example: brand monitoring with only-new watermarks
{"keywords": ["mybrand", "mybrand review"],"resultLimit": 100,"sort": "new","onlyNew": true,"monitorId": "mybrand-daily","relativeWindow": "day","excludeNsfw": true}
Example: subreddit-scoped comments
{"keywords": ["layoffs"],"subredditFilter": ["technology", "cscareerquestions"],"searchComments": true,"commentLimit": 50,"maxAgeDays": 30,"resultLimit": 50}
Source behavior and limits
- Rendered Reddit search (default global path): a headless Playwright session loads
www.reddit.comonce to resolve the JS challenge, then reads server-rendered post/comment cards. The parser accepts thesdui-post-unit/search-post-unit/search-sdui-comment-unitshapes plusshreddit-post/shreddit-commentfallbacks and tracking-context-only cards, so markup changes degrade to alternate selectors instead of zero results. Cards carry live score, comment count, author, subreddit, timestamp and NSFW/spoiler flags. A card preview is stored ascontentPreview; whenincludeArchiveis on, Arctic by-ID lookup fillsselftext/content, domain, flair, media, crosspost, poll, edited and subreddit metadata without presenting a snippet as the full post. If the archive has no row yet, those fields stay omitted. The session uses the configured proxy when one is provided. - Redlib: live third-party front-end; 7 posts / 10 comments per page with opaque cursors; Anubis challenges and upstream rate limits are common. This is the primary HTTP comment-body search. It also supplies
content_html/body_html, author flair, external link/domain, gallery media URLs and detail-level upvote ratio. Default instances areredlib-1.privadency.comandred.artemislena.eu; override withredlibInstances. - Translate partial: live, subreddit-scoped listing; 24 posts/page with opaque cursors; keyword matching is client-side on title/body. No per-post NSFW/locked/spoiler flags. All gallery images found in the post element are exposed through
mediaUrls/galleryItems. - Reddit RSS: global/subreddit search, max 100 entries per request, no pagination, no score/comment/ratio metrics. Retired on 2026-11-13; the transport returns
source_retiredwithout making an HTTP request on or after that date. Self-post RSS content is split into plaincontentpluscontent_htmlwith thesubmitted byboilerplate removed. - Arctic Shift: archive, not a monitor. Scoped keyword searches may return HTTP 422 “Timeout”; score/comment/ratio values are snapshots (
dataFreshnessandscoreAsOfsay which). Used for subreddit-scoped backfill/hydration, as the third comment-body rung viacomments/search?subreddit=...&body=..., and for by-ID enrichment viaposts/ids/comments/ids(withmd2html=trueso commentbody_htmlis available). Comment hydration pages forward withafter(ascending) so multi-page threads are not re-requested. By-ID enrichment is best-effort: a failure is recorded inattemptsbut does not fail a run that already produced live web records. - OAuth: only when you supply a token; the actor never obtains one.
oauth.reddit.comwithout a token returns a login/block page, so there is no fake “cookieless OAuth”. - Retries: HTTP and browser requests retry transient 429/5xx/timeouts with exponential backoff and honour
Retry-After/x-ratelimit-reset(retryAfterSecsin status records), capped so a bad header cannot stall a run.
Hard limits (2026-11)
- old.reddit.com: anonymous requests redirect to a login wall (
/login/?reason=lor2). The actor does not use old.reddit. - Reddit RSS retirement: RSS search stopped on 2026-11-13; the code disables it automatically. Global live search uses the rendered Reddit search, then Redlib.
- Rendered search availability: the browser path can still receive a Reddit block/captcha page from some datacenter IPs. When that happens the run retries through Apify AUTO and then RESIDENTIAL automatically; no user proxy setup is required. If all routes fail it reports
transport_blocked/challenge_requiredand falls back to Redlib. - Global Arctic search:
posts/search?query=andcomments/search?body=withoutsubreddit,author,link_id, orparent_idreturn HTTP 400. Global keyword/comment search cannot use Arctic; only subreddit-scoped archive queries are supported. - Arctic archive staleness: scores, comment counts, upvote ratios and removal flags are snapshots, not live. Check
dataFreshness,scoreAsOf,upvoteRatioAsOfandarchiveLagSecondsbefore treating archive engagement as current; removed/deleted flags may lag live Reddit state. - Enrichment lag: rendered-search cards do not expose full selftext/media. Arctic by-ID enrichment is limited by archive lag (new posts may not be archived yet) and by the 300-record per-run enrichment cap; missing fields stay omitted rather than being inferred from a snippet. Live web score/comment/ratio fields are never replaced by archive values.
- Field availability varies by source: awards, polls, crossposts and full galleries are rare on live cards;
body_htmlrequires a source that exposes HTML (Arcticmd2html, OAuth, Redlib) and is omitted otherwise. Redlib NSFW/locked/stickied detection is best-effort from page markers; absence is reported as unknown, not safe. - Client-side filtering: score/age/NSFW/author/date/AND filters run after the source returns. The actor over-fetches up to 3× + 25 rows (max 1000) when filters are active, then caps the output at
resultLimit; highly selective filters can still exhaust a source's page cap. - Legal/ToS: Reddit requires approved API access and prohibits unapproved scraping and commercialization. Arctic Shift, Redlib and the Translate proxy are third-party services and do not create Reddit authorization. Get legal/product sign-off and provide provenance and removal handling; this actor is not affiliated with Reddit.
Local development
pip install -r requirements.txtpython -m pytest -qpython -m src
python -m src needs an input; with Apify local storage use .actor/INPUT.json or APIFY_LOCAL_STORAGE_DIR with a key-value store INPUT.json.
FAQ
Do I need a Reddit account or API credentials? No. The default rendered-search path works without credentials. An optional OAuth token improves live metrics if you have one.
Why are some posts missing score or num_comments?
Some sources (notably RSS and parts of Translate) do not expose them. Those records carry metricsAvailable: false; requesting a score filter causes a typed metrics status instead of silently passing rows.
Why is content or body_html missing on a rendered-search record?
Search cards only expose a preview, which is stored as contentPreview. The actor looks up the post/comment by ID in Arctic when includeArchive is on; if the archive has no row yet, content/selftext/body_html stay omitted. The actor never substitutes a preview or invents HTML.
Why did I get fewer results than resultLimit?
Source caps are real (rendered search renders one page at a time; Translate 24/page; Redlib 7/page; Arctic 100/page). When client-side filters are active the actor over-fetches first, but a selective filter can still exhaust a source. Partial results are reported in the status record rather than silently hidden.
What does dataFreshness mean?
live for rendered search/Redlib/Translate/RSS/OAuth; archive_initial or archive_second_snapshot for Arctic. Check scoreAsOf, upvoteRatioAsOf and archiveLagSeconds before treating archive engagement as current.
Is this affiliated with Reddit? No. This is an independent actor. Reddit's terms, the Responsible Builder Policy, and third-party service terms still apply; get legal/product approval for commercial or automated collection.