# Reddit Search Scraper (`parsebird/reddit-search-scraper`) Actor

Search Reddit posts and comments by keyword, across all of Reddit, chosen subreddits, or auto-discovered communities. Full search syntax, sort and time filters, rich post, comment, author, and subreddit data.

- **URL**: https://apify.com/parsebird/reddit-search-scraper.md
- **Developed by:** [ParseBird](https://apify.com/parsebird) (community)
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.79 / 1,000 reddit post or comments

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Reddit Search Scraper

Reddit Search Scraper searches [Reddit](https://www.reddit.com) for posts and comments that match your keywords, across all of Reddit, inside the subreddits you pick, or in related communities it finds for you, and returns detailed, structured results.

<table><tr>
<td style="border-left:4px solid #FF4500;padding:12px 16px;font-weight:600">
Use Reddit's full search syntax — "exact phrases", OR, NOT, author:, title:, selftext:, flair:, url: — sort by relevance, new, top, hot, or most comments, filter by hour to year, and get up to 49 fields per post and 30 per comment.
</td>
</tr></table>

<br>

<table>
<tr>
<td colspan="3" style="padding:10px 14px;background:#FF4500;border:none;border-radius:4px 4px 0 0">
<span style="color:#FFFFFF;font-size:14px;font-weight:700;letter-spacing:0.5px">ParseBird Reddit Suite</span>
<span style="color:#FFD6C7;font-size:13px">&nbsp;&nbsp;&bull;&nbsp;&nbsp;Posts, comments &amp; subreddit data</span>
</td>
</tr>
<tr>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-radius:0 0 0 4px;border-right:none;border-top:none;vertical-align:top;width:33%;background:#FFF0EA">
<a href="https://apify.com/parsebird/reddit-search-scraper" style="color:#FF4500;text-decoration:none;font-weight:700;font-size:13px">Reddit Search Scraper</a><br>
<span style="color:#FF4500;font-size:11px;font-weight:600">You are here</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:33%;background:#FFFFFF">
<a href="https://apify.com/parsebird/reddit-comments-search-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">Reddit Comments Search Scraper</a><br>
<span style="color:#78716C;font-size:11px">Comments by keyword &amp; subreddit</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-radius:0 0 4px 0;border-top:none;vertical-align:top;width:33%;background:#FFFFFF">
<a href="https://apify.com/parsebird/reddit-subreddit-posts-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">Reddit Subreddit Posts Scraper</a><br>
<span style="color:#78716C;font-size:11px">Hot, new &amp; top posts with comments</span>
</td>
</tr>
</table>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```
Use the Apify actor "parsebird/reddit-search-scraper" to search Reddit posts and comments. Call it with the apify-client package: client.actor("parsebird/reddit-search-scraper").call(run_input={"query": "notion alternative", "contentType": "posts", "sort": "relevance", "maxResults": 100}), then read results from client.dataset(run["defaultDatasetId"]).iterate_items(). Inputs: query (string, required, Reddit search syntax, max 700 chars), contentType ("posts" | "comments" | "both", default "posts"), maxResults (integer, default 100, 0 = no limit), sort ("relevance" | "new" | "top" | "hot" | "comments", default "relevance"; hot/comments are posts-only), timeFilter ("" | "hour" | "day" | "week" | "month" | "year", default "" = all time), subreddit (string, one community), subreddits (array of strings), autoDiscoverSubreddits (boolean, default true), maxSubreddits (integer 1-50, default 20), includeNsfw (boolean, default false). Every row has _type ("post" or "comment"). Post rows include id, title, author, subreddit, score, commentCount, upvoteRatio, createdAt, permalink, url, body, domain, postHint, flair, media, gallery, poll, crosspostRoot, subredditInfo (subscribers, icon, banner, description) and author details. Comment rows include id, parentId, body, author, score, createdAt, permalink, authorKarma, and parent post fields (postId, postTitle, postScore, postCommentCount, postFlair). Pricing: pay per saved result. API docs: https://apify.com/parsebird/reddit-search-scraper/api — get an API token at https://console.apify.com/settings/integrations
```

### What is Reddit Search Scraper?

**Reddit Search Scraper** is a **Reddit search API alternative** that runs Reddit searches for you and saves every matching **post and comment** as clean data. Enter a query such as `notion alternative`, pick posts, comments, or both, and get each result with its **score, comment count, date, author, text, media, and subreddit details**.

The easiest way to try it: open the Input tab, keep the example query, and click **Start**. A run with the example input finishes in under a minute.

### What can Reddit Search Scraper do?

- 🔎 **Search posts, comments, or both** — every row is labeled with `_type` so you can split them later.
- 🧠 **Full Reddit search syntax** — exact phrases, `OR`, `AND`, `NOT`, `-exclude`, parentheses, and field operators such as `author:`, `title:`, `selftext:`, `flair:`, `url:`, `self:yes`, and `subreddit:`.
- 🧭 **Search anywhere** — all of Reddit, one subreddit, or a list of subreddits in any format (`python`, `r/python`, `https://old.reddit.com/r/python`).
- ✨ **Auto-discover subreddits** — when all-of-Reddit search runs out before your limit, the scraper finds up to 50 related communities and searches inside them too.
- ↕️ **Five sort orders and six time windows** — relevance, new, top, hot, most comments; past hour, day, week, month, year, or all time.
- 🖼️ **Rich post data** — image previews, video stream URLs, gallery items, poll options, crossposts, events, flair, and subreddit subscribers, icons, and description.
- 🧵 **Thread context for comments** — `parentId` for rebuilding reply chains, plus the parent post's title, score, flair, and comment count.
- 🧹 **No duplicates** — results from several subreddits are merged and deduplicated.

Because it runs on the Apify platform, you also get:

- **Scheduling** — run a search every hour or every day with [Apify Schedules](https://docs.apify.com/platform/schedules) to build a live mention feed.
- **API access** — start runs and fetch results with the [Apify API](https://docs.apify.com/api/v2) or the Python and JavaScript clients.
- **Integrations** — send results to Google Sheets, Slack, Zapier, Make, n8n, or webhooks with [Apify integrations](https://docs.apify.com/platform/integrations).
- **Export formats** — download results as JSON, CSV, Excel, XML, or HTML.

### What data can you extract from Reddit search?

**Posts** (`_type: "post"`):

| Field | Description |
|-------|-------------|
| `id`, `title`, `author`, `subreddit` | Post ID (`t3_…`), title, author, and community |
| `score`, `upvoteRatio`, `commentCount`, `crosspostCount` | Engagement numbers |
| `createdAt`, `editedAt` | Post and edit times (ISO 8601, UTC) |
| `permalink`, `url`, `outboundUrl`, `domain` | Reddit link and the linked content |
| `body` | Text of self posts |
| `postHint`, `isSelfPost`, `isVideo`, `isGallery`, `isPollIncluded` | What kind of post it is |
| `isNsfw`, `isSpoiler`, `isLocked`, `isStickied`, `isArchived`, `isOriginalContent`, … | Post flags |
| `flair`, `thumbnail`, `distinguishedAs`, `removedByCategory` | Flair, thumbnail, and moderation info |
| `authorId`, `authorFlair`, `authorIconUrl`, `authorIsNsfw`, `authorIsCakeDayNow` | Author details |
| `media`, `gallery`, `poll`, `postEventInfo`, `crosspostRoot` | Image and video URLs, gallery items, poll options, event times, original crosspost |
| `subredditInfo` | Subreddit ID, title, type, subscribers, NSFW and quarantine flags, colors, icon, banner, description |

**Comments** (`_type: "comment"`):

| Field | Description |
|-------|-------------|
| `id`, `body`, `author`, `subreddit` | Comment ID (`t1_…`), text, author, and community |
| `score`, `isScoreHidden`, `createdAt`, `editedAt`, `permalink` | Score, dates, and link |
| `parentId` | Parent comment ID, or `null` for a top-level comment |
| `isOP` | Whether the commenter is the post's author |
| `authorId`, `authorKarma`, `authorIconUrl`, `authorIsCakeDayNow` | Author details (`authorKarma` = post karma + comment karma) |
| `postId`, `postTitle`, `postUrl`, `postAuthor`, `postScore`, `postCommentCount`, `postFlair`, `postDomain`, `postIsSelfPost`, `postIsNsfw`, `postCreatedAt` | The parent post |
| `subredditSubscribers` | Subscriber count of the community |

Fields are `null` when Reddit doesn't provide the value, for example `media` on a text post or `editedAt` on an unedited comment. The scraper never fills in missing values.

### How to scrape Reddit search results

1. Open [Reddit Search Scraper](https://apify.com/parsebird/reddit-search-scraper) and go to the **Input** tab.
2. Type your **Search query**, for example `notion alternative` or `title:"acquired by"`.
3. Choose **Search in**: posts, comments, or both.
4. Optionally pick a **Sort by** order and a **Time filter**.
5. Optionally add a **Subreddit** or **Subreddits**. Leave them empty to search all of Reddit.
6. Set **Max results**, click **Start**, and download your Reddit data from the **Output** tab as JSON, CSV, or Excel.

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `query` | string | **Yes** | — | Keywords with Reddit search syntax (max 700 characters) |
| `contentType` | string | No | `posts` | `posts`, `comments`, or `both` |
| `maxResults` | integer | No | `100` | Most results to save, posts and comments combined. `0` = no limit |
| `sort` | string | No | `relevance` | `relevance`, `new`, `top`, `hot`, `comments` (the last two are posts-only) |
| `timeFilter` | string | No | all time | `hour`, `day`, `week`, `month`, `year`, or empty for all time |
| `subreddit` | string | No | — | One community to search |
| `subreddits` | array | No | `[]` | Several communities; results are merged and deduplicated |
| `autoDiscoverSubreddits` | boolean | No | `true` | Search related communities when no subreddits are given and more results are needed |
| `maxSubreddits` | integer | No | `20` | Most related communities to search (1–50) |
| `includeNsfw` | boolean | No | `false` | Include posts and communities Reddit marks as NSFW |
| `proxyConfiguration` | object | No | Residential Apify Proxy | Network settings. Keep the default |

**Sort orders:** `relevance` is Reddit's default mix of match quality and engagement; `new` is newest first; `top` is highest score; `hot` is currently trending posts; `comments` is posts with the most comments. For comments, `hot` and `comments` fall back to `new` when a time filter is set, otherwise to `relevance`.

**Time windows:** `hour` = past 60 minutes, `day` = past 24 hours, `week` = past 7 days, `month` = past 30 days, `year` = past 365 days. The window is applied exactly to every result.

### Reddit search query recipes

**Brand and competitor monitoring** — newest mentions of several products:

```json
{
    "query": "(\"1Password\" OR \"Bitwarden\" OR \"Dashlane\") \"switched\"",
    "contentType": "both",
    "sort": "new",
    "maxResults": 100
}
```

**Buying-intent leads** — people asking for recommendations, minus the noise:

```json
{
    "query": "(\"recommend a VPN\" OR \"best VPN for\" OR \"VPN suggestions\") -free",
    "contentType": "posts",
    "sort": "new",
    "maxResults": 100
}
```

**Title-only topic tracking:**

```json
{ "query": "title:(\"acquired by\" OR \"merger\")", "sort": "new", "maxResults": 100 }
```

**Account monitoring:**

```json
{ "query": "author:AutoModerator", "sort": "new", "maxResults": 50 }
```

**Body-text phrase search:**

```json
{ "query": "selftext:\"finally quit my job\"", "maxResults": 100 }
```

**Discussion threads in one community:**

```json
{ "query": "flair:\"Discussion\"", "subreddits": ["MachineLearning"], "sort": "top", "maxResults": 100 }
```

**Several communities, newest first:**

```json
{
    "query": "best budget laptop 2026",
    "subreddits": ["SuggestALaptop", "r/laptops", "https://www.reddit.com/r/thinkpad"],
    "sort": "new",
    "maxResults": 300
}
```

### Output example

```json
[
    {
        "_type": "post",
        "_status": "found",
        "id": "t3_1u5l7f1",
        "title": "Sunrise inside Sagrada Familia, Barcelona.",
        "author": "MysteriousSlice007",
        "subreddit": "pics",
        "score": 67857,
        "commentCount": 283,
        "upvoteRatio": 0.98,
        "createdAt": "2026-06-14T13:29:03.000Z",
        "editedAt": null,
        "permalink": "/r/pics/comments/1u5l7f1/sunrise_inside_sagrada_familia_barcelona/",
        "url": "https://i.redd.it/54iksnru297h1.jpeg",
        "body": "",
        "domain": "i.redd.it",
        "outboundUrl": "https://i.redd.it/54iksnru297h1.jpeg",
        "postHint": "IMAGE",
        "isSelfPost": false,
        "isNsfw": false,
        "isSpoiler": false,
        "isLocked": false,
        "isStickied": false,
        "isArchived": false,
        "isContestMode": false,
        "isCrosspostable": false,
        "isGildable": false,
        "isScoreHidden": false,
        "isPollIncluded": false,
        "isOriginalContent": false,
        "isVideo": false,
        "isGallery": false,
        "distinguishedAs": null,
        "removedByCategory": null,
        "suggestedCommentSort": null,
        "flair": null,
        "thumbnail": "https://preview.redd.it/54iksnru297h1.jpeg?width=140&height=140&crop=1:1,smart&auto=webp&s=3033afed809dcb3d7223d7184d293f07377276eb",
        "crosspostCount": 14,
        "authorId": "t2_19nu489oi4",
        "authorType": "USER",
        "authorFlair": null,
        "authorIsNsfw": false,
        "authorIsCakeDayNow": false,
        "authorIconUrl": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_4.png",
        "media": {
            "still": {
                "source": {
                    "url": "https://preview.redd.it/54iksnru297h1.jpeg?auto=webp&s=01658c24091d990a4dbc5c69c2260cb22f8130d5",
                    "dimensions": { "width": 1649, "height": 2048 }
                }
            },
            "typeHint": "IMAGE"
        },
        "gallery": null,
        "poll": null,
        "postEventInfo": null,
        "crosspostRoot": null,
        "subredditInfo": {
            "id": "t5_2qh0u",
            "name": "pics",
            "prefixedName": "r/pics",
            "title": "Reddit Pics",
            "type": "PUBLIC",
            "subscribersCount": 33548445,
            "isNsfw": false,
            "isQuarantined": false,
            "isThumbnailsEnabled": true,
            "whitelistStatus": null,
            "primaryColor": "#553200",
            "iconUrl": "https://b.thumbs.redditmedia.com/VZX_KQLnI1DPhlEZ07bIcLzwR1Win808RIt7zm49VIQ.png",
            "bannerUrl": "https://styles.redditmedia.com/t5_2qh0u/styles/bannerBackgroundImage_if1cbgj4mc7b1.jpg?width=4000&s=f6831859646d3127e64749644e05d129279aa2aa",
            "communityDescription": "A place for photographs, pictures, and other images."
        }
    },
    {
        "_type": "comment",
        "_status": "found",
        "id": "t1_orlsyr6",
        "parentId": null,
        "author": "drstoneybaloneyphd",
        "subreddit": "pics",
        "score": 743,
        "createdAt": "2026-06-14T14:29:26.000Z",
        "editedAt": null,
        "permalink": "/r/pics/comments/1u5l7f1/sunrise_inside_sagrada_familia_barcelona/orlsyr6/",
        "body": "This is not sunrise. Definitely late day sun/sunset. They don't open before sunrise and the angle of this photo in the church is likely facing southeast, with the sun shining in from the southwest. ",
        "isScoreHidden": false,
        "isOP": false,
        "authorId": "t2_6860539l",
        "authorKarma": 43247,
        "authorType": "USER",
        "authorIsCakeDayNow": false,
        "authorIconUrl": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_1.png",
        "postId": "t3_1u5l7f1",
        "postTitle": "Sunrise inside Sagrada Familia, Barcelona.",
        "postUrl": "https://i.redd.it/54iksnru297h1.jpeg",
        "postAuthor": "MysteriousSlice007",
        "postScore": 67858,
        "postCommentCount": 283,
        "postFlair": null,
        "postDomain": "i.redd.it",
        "postIsSelfPost": false,
        "postIsNsfw": false,
        "postCreatedAt": "2026-06-14T13:29:03.000Z",
        "subredditSubscribers": 33548445
    }
]
```

On video posts, `media.streaming` holds the HLS, DASH, fallback MP4 and scrubber URLs with dimensions and duration. On gallery posts, `gallery.items` lists every image with caption, size, and URL. On poll posts, `poll.options` lists each option (vote counts appear once Reddit shows them).

### Use Reddit Search Scraper via API

**Python** ([apify-client](https://docs.apify.com/api/client/python)):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")

run = client.actor("parsebird/reddit-search-scraper").call(run_input={
    "query": "notion alternative",
    "contentType": "both",
    "sort": "new",
    "timeFilter": "week",
    "maxResults": 200,
})

for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    text = row["title"] if row["_type"] == "post" else row["body"]
    print(row["_type"], row["subreddit"], row["score"], text[:80])
```

**JavaScript** ([apify-client](https://docs.apify.com/api/client/js)):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });

const run = await client.actor('parsebird/reddit-search-scraper').call({
    query: 'notion alternative',
    contentType: 'both',
    sort: 'new',
    timeFilter: 'week',
    maxResults: 200,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const row of items) {
    const text = row._type === 'post' ? row.title : row.body;
    console.log(row._type, row.subreddit, row.score, text.slice(0, 80));
}
```

### Use cases for Reddit search data

- **Brand and competitor monitoring** — a scheduled search on `new` gives you every fresh mention of your product and its alternatives.
- **Lead generation** — find people asking "can anyone recommend…" in your niche.
- **Market and product research** — read what real users say about features, prices, and pain points.
- **Community discovery** — auto-discovery shows which subreddits talk about your topic, with subscriber counts.
- **Content and trend research** — track top and hot posts on a topic over a week or a month.
- **NLP and AI datasets** — collect labeled posts and comments for sentiment analysis or LLM evaluation.

### How it works

1. The scraper runs your query on Reddit's search for posts, comments, or both — once for all of Reddit, or once per subreddit.
2. It pages through the results, deduplicates them, and applies the exact time window and the NSFW setting.
3. If you gave no subreddits and more results are needed, it finds related communities with Reddit's subreddit search and searches inside each one.
4. It looks up comment details, parent posts, subreddit details, and author details in batches, and saves each result to the dataset until `maxResults` is reached.

### How much does it cost to scrape Reddit?

Reddit Search Scraper uses **pay-per-event** pricing: you pay for each post or comment saved to your dataset. Filtered-out results and empty searches are free.

| Event | Apify plan | Price per event | Price per 1,000 results |
|-------|-----------|----------------|-----------------|
| `result-scraped` | Free | $0.00099 | **$0.99** |
| `result-scraped` | Bronze | $0.00089 | **$0.89** |
| `result-scraped` | Silver | $0.00079 | **$0.79** |
| `result-scraped` | Gold | $0.00079 | **$0.79** |

One event is one unique post or comment. For example, 1,000 Reddit posts cost $0.99 on the Free plan. The Apify Free plan includes monthly platform credits you can use to try it, and you can set a maximum spend per run so the scraper stops at your budget.

### FAQ

**How many results can one search return?**
Reddit returns up to about 250 posts per search query. The scraper gets past that limit by searching each subreddit separately: add subreddits yourself or keep **Auto-discover subreddits** on. In our tests, `notion alternative` returned 237 posts from all-of-Reddit search alone and 1,000 posts with auto-discovery on. Comment search usually returns fewer results than post search, especially for long phrases.

**How does the time filter work for comments?**
Reddit's comment search has no time filter, so the scraper checks each comment's date and skips the ones outside your window. With `sort: new` it stops as soon as it passes the window, which is the most efficient way to monitor recent comments.

**Which search operators work?**
Quoted phrases, `OR`, `AND`, `NOT`, `-word`, parentheses, and `author:`, `title:`, `selftext:`, `self:yes/no`, `flair:`, `url:`, `subreddit:`. The query goes to Reddit as written, so Reddit decides the matching.

**What does parentId mean on comments?**
It is the ID of the comment being replied to. Top-level comments (direct replies to the post) have `parentId: null`, and the post is in `postId`.

**Does it include NSFW content?**
Not by default. Turn on **Include NSFW results** to include posts and communities Reddit marks as 18+. Comment search on Reddit hides most mature content either way.

**Can I schedule it or connect it to other tools?**
Yes. Save your input as a [task](https://docs.apify.com/platform/actors/running/tasks), add a [schedule](https://docs.apify.com/platform/schedules), and send results to Slack, Google Sheets, or a webhook with [integrations](https://docs.apify.com/platform/integrations). AI agents can call it through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) or the [API tab](https://apify.com/parsebird/reddit-search-scraper/api).

**Something doesn't work or you need a feature?**
Open an issue in the [Issues tab](https://apify.com/parsebird/reddit-search-scraper/issues). We read and answer every report.

### Is it legal to scrape Reddit?

This scraper only collects publicly available Reddit posts and comments that anyone can see without logging in. It does not access private communities, private messages, or account data. Results can include personal data such as usernames, which regulations like the GDPR protect. Only collect personal data when you have a legitimate reason, and check Reddit's terms and your local laws if you are unsure. Read more in Apify's post [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

### Other scrapers by ParseBird

- [Reddit Comments Search Scraper](https://apify.com/parsebird/reddit-comments-search-scraper) — comment-focused search with a rolling age filter
- [Threads Search Scraper](https://apify.com/parsebird/threads-search-scraper) — search Threads posts by keyword
- [Bluesky Posts Scraper](https://apify.com/parsebird/bluesky-posts-scraper) — collect Bluesky posts
- [Truth Social Scraper & API](https://apify.com/parsebird/truth-social-scraper) — scrape Truth Social posts and profiles
- [YouTube Search Scraper & API](https://apify.com/parsebird/youtube-search-scraper) — search YouTube videos by keyword

# Changelog

This Actor's version history is a separate document: https://apify.com/parsebird/reddit-search-scraper/changelog.md

# Actor input Schema

## `query` (type: `string`):

Enter keywords to search for. Supports quoted phrases, OR, AND, NOT, -exclusions, parentheses, and field operators like <code>author:</code>, <code>title:</code>, <code>selftext:</code>, <code>flair:</code>, <code>url:</code>, <code>self:yes</code>, <code>subreddit:</code>. Max 700 characters.

## `contentType` (type: `string`):

Choose whether to search posts (titles and bodies), comments, or both. Rows are labeled with <code>\_type</code> so you can split them later.

## `maxResults` (type: `integer`):

Set the most results to save (posts and comments combined). Set to 0 for no limit.

## `sort` (type: `string`):

Choose the result order. 'Hot' and 'Most comments' apply to posts only; comments then use 'Relevance'.

## `timeFilter` (type: `string`):

Keep only results from this time window. Leave on 'All time' for no limit.

## `subreddit` (type: `string`):

Limit the search to one community. Any format works: <code>python</code>, <code>r/python</code>, or a subreddit URL. Leave empty to search all of Reddit.

## `subreddits` (type: `array`):

Search several communities. Each is searched separately, then results are merged without duplicates. Mix formats freely.

## `autoDiscoverSubreddits` (type: `boolean`):

When no subreddits are given and all-of-Reddit search runs out before Max results, find communities related to your query and search inside them too.

## `maxSubreddits` (type: `integer`):

Set how many related subreddits auto-discovery may search (1–50).

## `includeNsfw` (type: `boolean`):

Include posts and communities Reddit marks as NSFW (18+). Off by default.

## `proxyConfiguration` (type: `object`):

Proxy servers used to reach Reddit. Reddit blocks most datacenter IPs, so residential Apify Proxy is the default and recommended.

## Actor input object example

```json
{
  "query": "python web scraping",
  "contentType": "posts",
  "maxResults": 50,
  "sort": "relevance",
  "timeFilter": "",
  "subreddits": [],
  "autoDiscoverSubreddits": true,
  "maxSubreddits": 20,
  "includeNsfw": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "python web scraping",
    "contentType": "posts",
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/reddit-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": "python web scraping",
    "contentType": "posts",
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("parsebird/reddit-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "python web scraping",
  "contentType": "posts",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call parsebird/reddit-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parsebird/reddit-search-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/YDOzTT2mvSWohBSjs/builds/WdifjetmgM76BoZaN/openapi.json
