Reddit Keyword Search with Advanced Filters avatar

Reddit Keyword Search with Advanced Filters

Pricing

from $0.49 / 1,000 results

Go to Apify Store
Reddit Keyword Search with Advanced Filters

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

Nimbryxo-studio

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

18 days ago

Last modified

Features

Limited permissions

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 Translate community-more-posts partial (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/ids and /api/comments/ids (when includeArchive is on) so selftext, domain, flair, media, crosspost, edited and comment body_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, upvoteRatioAsOf and archiveLagSeconds to every record so live metrics are never confused with archive snapshots
  • Searches comment bodies with searchComments via the rendered Reddit search, Redlib, and scoped Arctic, with RSS type=comment parent discovery + hydration as a fallback
  • Supports onlyNew + monitorId watermarks for scheduled monitoring, including relative windows (hour … all); onlyNew forces sort=new, and a missing monitorId gets 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_id and comments by t1_id across 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

FieldTypeDefaultDescription
keywordsarray–Keywords to search; each runs as its own search (required)
resultLimitinteger100Max 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
sortstringrelevancerelevance, hot, top, new, or comments
relativeWindowstringallhour, day, week, month, year, or all
onlyNewbooleanfalseEmit only records newer than the stored watermark; forces sort=new; records without timestamps are not re-emitted
monitorIdstring–Stable key for the onlyNew watermark/seen IDs; omit to derive one from the keyword set
searchCommentsbooleanfalseSearch comment bodies and emit recordType=comment records
commentLimitinteger50Max matching comments per keyword
subredditFilterarray[]Only keep posts/comments from these subreddits (with or without r/)
subredditBlocklistarray[]Drop posts/comments from these subreddits
minScoreinteger–Drop records below this score; sources without a score are reported as metrics_unavailable. Archive scores are timestamped snapshots
maxAgeDaysinteger–Drop records older than N days
excludeNsfwbooleanfalseDrop NSFW posts; comments without a flag are kept fail-soft and counted as nsfwUnknown
authorBlocklistarray[]Drop these usernames (case-insensitive)
keywordRequireAllbooleanfalseWith multiple keywords, keep only records whose title, content, or comment body contains all of them
dateFromstring–Earliest created_at (inclusive, YYYY-MM-DD or ISO)
dateTostring–Latest created_at (inclusive end-of-day)
includeArchivebooleantrueUse 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
redditOAuthTokensecret–Optional user OAuth Bearer token; never required
redlibInstancesarray[]Optional Redlib hostnames in priority order. Defaults to redlib-1.privadency.com, red.artemislena.eu
resolveChallengesbooleantrueAllow Playwright to solve Reddit/Redlib challenges and render the search page; disable for HTTP-only mode
proxyConfigurationobject–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.com once to resolve the JS challenge, then reads server-rendered post/comment cards. The parser accepts the sdui-post-unit / search-post-unit / search-sdui-comment-unit shapes plus shreddit-post/shreddit-comment fallbacks 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 as contentPreview; when includeArchive is on, Arctic by-ID lookup fills selftext/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 are redlib-1.privadency.com and red.artemislena.eu; override with redlibInstances.
  • 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_retired without making an HTTP request on or after that date. Self-post RSS content is split into plain content plus content_html with the submitted by boilerplate removed.
  • Arctic Shift: archive, not a monitor. Scoped keyword searches may return HTTP 422 “Timeout”; score/comment/ratio values are snapshots (dataFreshness and scoreAsOf say which). Used for subreddit-scoped backfill/hydration, as the third comment-body rung via comments/search?subreddit=...&body=..., and for by-ID enrichment via posts/ids/comments/ids (with md2html=true so comment body_html is available). Comment hydration pages forward with after (ascending) so multi-page threads are not re-requested. By-ID enrichment is best-effort: a failure is recorded in attempts but 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.com without 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 (retryAfterSecs in 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_required and falls back to Redlib.
  • Global Arctic search: posts/search?query= and comments/search?body= without subreddit, author, link_id, or parent_id return 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, upvoteRatioAsOf and archiveLagSeconds before 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_html requires a source that exposes HTML (Arctic md2html, 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.txt
python -m pytest -q
python -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.