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

Search Reddit by keyword and export posts, comments, communities, users and media as structured data. No Reddit login or OAuth approval required.

- **URL**: https://apify.com/apple\_yang/reddit-search-scraper-api.md
- **Developed by:** [APISmith](https://apify.com/apple_yang) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 post scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

Search Reddit by keyword and export posts, comments, subreddits, users, and media as structured data — no Reddit login, no OAuth app approval, and no proxy pool to maintain.

Paste one or more search terms, choose the content types you care about, and run. Every result is written to an Apify dataset as a normalized record: full post text in markdown and HTML, vote and comment counts, author and community IDs, direct media links, and the keyword that produced it. Download the dataset as JSON, CSV, or Excel, or pull it through the API into your own workflow.

Runs stop the moment `maxItems` is reached, so a 100-result run never requests more than 100 results — and you are charged per stored result, not per request or per page.

### What you get

For each keyword you submit, the Actor searches the content types you enabled and returns one normalized row per result:

- **Posts** — title, full body (markdown and HTML), author, community, upvotes, upvote ratio, comment count, media links, timestamps.
- **Comments** — comment text, author, parent thread, community, score, timestamps.
- **Subreddits** — name, `r/name`, URL, title, and description.
- **Users** — username, user ID, profile URL, display name, and about text.
- **Media** — images, videos, and GIFs, returned as post rows with `imageUrls` / `videoUrls` populated.

Every row also carries `searchKeyword` and `searchType`, so multi-keyword runs stay traceable back to the exact term and content type that produced each item.

### ✨ Key features

- **Search five content types in one run.** Enable any combination of posts, comments, communities, users, and media; each enabled type is searched for every keyword.
- **Predictable, capped runs.** Set `maxItems` and the run stops as soon as the limit is reached — nothing beyond it is ever requested.
- **Structured output ready for automation.** Use the same results in spreadsheets, databases, APIs, or AI workflows without manually cleaning the page.
- **No login or API key from you.** Access is handled by the Actor itself; you never supply a Reddit credential, and the results never carry one.
- **Clean data built in.** Duplicate items are removed automatically, NSFW content can be excluded, and placeholder nodes (ads, recommendations, deleted posts) are dropped before they reach the dataset.
- **Batch-friendly.** Submit many keywords in one run instead of starting a separate run for every term.

### 🚀 Quick start

1. Open the Actor in Apify Console.
2. Paste the smallest valid input:

```json
{
    "searches": ["byd"],
    "searchPosts": true
}
```

3. Click **Start**.
4. Open the **Dataset** tab when the run finishes.
5. Export the results or call the dataset API.

That's it — no browser session, no login, no manual export step. The default input searches posts for the keyword `byd` and stops at 100 results.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `searches` | string\[] | — (required) | One or more Reddit keywords. Each term is searched independently. |
| `searchPosts` | boolean | `true` | Search for matching posts. |
| `searchComments` | boolean | `false` | Search for matching comments. |
| `searchCommunities` | boolean | `false` | Search for matching subreddits. |
| `searchUsers` | boolean | `false` | Search for matching users. |
| `searchMedia` | boolean | `false` | Search for matching images, videos, and GIFs. |
| `sort` | string | `RELEVANCE` | `RELEVANCE`, `HOT`, `TOP`, `NEW`, or `COMMENTS`. Applies to posts, comments, and media; ignored for communities and users. |
| `time` | string | `all` | `all`, `hour`, `day`, `week`, `month`, or `year`. Applies to posts and media only. |
| `maxItems` | integer | `100` | Stop after this many results (1–100,000). |
| `includeNSFW` | boolean | `false` | Include adult content. When off, NSFW items are filtered out before storage. |
| `safeSearch` | boolean | `false` | Enable strict safe search. |

When several search types are enabled, all of them run for every keyword. If no search type is enabled, post search is used as a fallback.

#### Common input recipes

**Search one topic across posts and comments:**

```json
{
    "searches": ["byd"],
    "searchPosts": true,
    "searchComments": true
}
```

**Monitor several brand keywords this week:**

```json
{
    "searches": ["byd", "dolphin", "seal"],
    "searchPosts": true,
    "searchComments": true,
    "time": "week"
}
```

**Collect the top posts of the month for a keyword:**

```json
{
    "searches": ["electric vehicle"],
    "sort": "TOP",
    "time": "month",
    "maxItems": 200
}
```

**Collect only media:**

```json
{
    "searches": ["byd"],
    "searchMedia": true,
    "searchPosts": false
}
```

### Output

Each dataset item is a normalized record. Field names follow the conventions used by the most popular Reddit scrapers on Apify Store, so existing pipelines keep working after switching.

Example item from a real run for the keyword `byd`:

```json
{
    "dataType": "post",
    "id": "t3_1v3zahb",
    "url": "https://www.reddit.com/r/BYDAU/comments/1v3zahb/has_byd_ruined_other_brands_for_you/",
    "title": "Has BYD ruined other brands for you?",
    "body": "Currently in an Audi Q7 for reasons I couldn't be bothered explaining...",
    "communityName": "BYDAU",
    "parsedCommunityName": "r/BYDAU",
    "username": "Dear_Marketing_4932",
    "upVotes": 111,
    "numberOfComments": 120,
    "upVoteRatio": 0.79,
    "createdAt": "2026-07-23T01:16:22.717Z",
    "imageUrls": [],
    "videoUrls": [],
    "searchKeyword": "byd",
    "searchType": "post"
}
```

#### Field reference

| Group | Field | Type | Description |
| --- | --- | --- | --- |
| Common | `dataType` | string | `post`, `comment`, `community`, or `user`. |
| Common | `id` / `parsedId` | string | Full id (`t3_1v3zahb`) and the id without its type prefix (`1v3zahb`). |
| Common | `url` | string | Permalink to the item. |
| Common | `createdAt` / `scrapedAt` | string | When the item was posted and when it was collected (ISO 8601). |
| Common | `searchKeyword` / `searchType` | string | The keyword and search type that produced this row. |
| Post | `title` | string | Post title. |
| Post | `body` / `html` | string | Post content as markdown and as HTML. |
| Post | `username` / `userId` | string | Author name and id. |
| Post | `communityName` / `parsedCommunityName` | string | Subreddit name (`BYDAU`) and prefixed name (`r/BYDAU`). |
| Post | `numberOfComments` | integer | Comment count. |
| Post | `upVotes` | integer | Post score. |
| Post | `upVoteRatio` | float | Ratio of upvotes to all votes. |
| Post | `authorFlair` | string | null | Author flair text, or `null`. |
| Post | `isVideo` / `isAd` / `over18` | boolean | Content flags. |
| Post | `imageUrls` / `videoUrls` | string\[] | Media links found on the item. |
| Comment | `body` / `html` | string | Comment text. |
| Comment | `title` | string | Parent thread title. |
| Comment | `communityName` | string | Subreddit the comment appeared in. |
| Comment | `upVotes` | integer | Comment score. |
| Community | `communityName` / `parsedCommunityName` | string | Subreddit name (`BYDAU`) and prefixed name (`r/BYDAU`). |
| Community | `body` | string | Subreddit description. |
| User | `username` / `userId` | string | Username and user id. |
| User | `body` | string | About text. |

A full example produced from a real run is in [`sample-output.json`](./sample-output.json).

**How the data is cleaned before it reaches you:**

- **Deduplication** — the same item appearing more than once (across pages or keywords) is stored only once per run.
- **NSFW filtering** — when `includeNSFW` is off, `over18` items are removed before storage.
- **Placeholder nodes** — ads, recommendation tiles, and deleted content that carry no usable data are dropped silently.

### 💰 Pricing

- **Charged per stored result.** One stored item = one charged result. A run that finds nothing stores nothing.
- **Bounded by `maxItems`.** The run stops as soon as the limit is reached, so a run for 100 results requests at most 100 results.
- **Failed searches stop early.** Permanent failures — invalid credentials, exhausted quota, permission errors — stop the run immediately with a clear message instead of continuing to burn quota. Transient failures are retried automatically.
- **Free plan note.** Runs on the Apify free plan (the monthly platform credit) return at most the first page — up to 7 results per run — then stop. Paid plans (Starter / Scale / Business) are not capped.
- See the **Pricing** tab on the Actor page for the current rate per result.

### 🔌 API and automation

The Actor is built for automation. Run it manually in Apify Console, schedule recurring runs, call it through the API, or connect its dataset to your workflow. Results are readable via the dataset API and exportable as JSON, CSV, Excel, XML, or HTML.

#### JavaScript (Apify SDK)

```javascript
import { Actor } from 'apify';

await Actor.init();

const input = {
    searches: ['byd', 'electric vehicle'],
    searchPosts: true,
    searchComments: true,
    sort: 'TOP',
    time: 'month',
    maxItems: 100,
};

const run = await Actor.call('reddit-search-scraper-api', input);
const dataset = await Actor.openDataset(run.defaultDatasetId);
const { items } = await dataset.getData();
console.log(items);
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('reddit-search-scraper-api').call(run_input={
    'searches': ['byd'],
    'searchPosts': True,
    'maxItems': 100,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

#### cURL

```bash
curl "https://api.apify.com/v2/acts/reddit-search-scraper-api/run-sync-get-dataset-items?timeout=120" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searches":["byd"],"searchPosts":true,"maxItems":100}'
```

#### Use with AI agents

The output is structured text plus metadata, so it drops straight into downstream AI work: feed post bodies and comments into summarization, sentiment analysis, or RAG pipelines, or let an agent query the dataset through the Apify MCP / API integration.

### Use cases

- **Brand monitoring** — schedule daily or weekly runs for your brand and product terms, and collect new posts and comments in one dataset, tagged by keyword.
- **Competitor and market research** — gather what people say about competitors, features, or campaigns, and compare communities over time.
- **Trend and content research** — find the top discussions in a niche this month with `sort: "TOP"` and `time: "month"`, then use the titles and bodies for content planning.
- **Community discovery** — search subreddits by topic to find active communities for outreach or placement.
- **AI and data pipelines** — feed the extracted text, metadata, and media references into classification, summarization, or retrieval workflows.

### FAQ

**Can I scrape Reddit without logging in?**
Yes. The Actor accesses Reddit's public content on your behalf. No login, OAuth approval, or API key is needed.

**Can I search multiple keywords in one run?**
Yes. Pass an array to `searches`; each keyword is searched independently, and every row records which keyword produced it.

**Which content types can I search?**
Posts, comments, communities, users, and media — any combination in a single run. Enable the ones you need with the `search*` fields.

**How am I charged?**
Per stored result. The run stops at `maxItems`, so you never pay for results that were not requested. A run that finds nothing stores nothing.

**Why did I get fewer results than `maxItems`?**
A few reasons: duplicates are removed, NSFW items are filtered when `includeNSFW` is off, placeholder nodes (ads, recommendations, deleted content) are dropped, Reddit caps search depth at roughly 1,000 items per query, and free-plan runs return at most 7 results. Any of these can lower the final count.

**Can I include adult content?**
Yes — set `includeNSFW` to `true`. It is off by default.

**Can I schedule this scraper?**
Yes. Use Apify's scheduled runs (Tasks) to run it daily or weekly, then read the dataset via the API.

**Do I need a proxy?**
No. Network access is handled by the Actor; there is nothing to configure on your side.

### Limitations and responsible use

- **Public content only.** Private, login-gated, age-restricted, or otherwise restricted content cannot be accessed. Reddit may also temporarily restrict access to some otherwise-public content.
- **Platform search depth.** Reddit caps listing and search depth at roughly 1,000 items per query. This is a platform limit rather than a scraper limit.
- **Sort and time filters** are ignored for communities and users; `time` applies only to posts and media, and `COMMENTS` sorting applies only to posts.
- **Media rows are posts.** Media search returns image/video/GIF results as post rows with `imageUrls` / `videoUrls` populated rather than a separate `media` row type.
- **Media link coverage.** Media links are read from the media, gallery, and thumbnail fields. Items hosted on external domains may not appear in `imageUrls` or `videoUrls`.
- **Comment / community / user mapping.** These record types are mapped from payloads that vary by source. The mapper is defensive and preserves every field it recognizes; a field that is not mapped yet can be requested as an improvement.
- **Free plan cap.** Free-plan runs return at most 7 results (first page only). Paid plans are not capped.

Results come from Reddit's public content, retrieved on your behalf while the run executes. Only publicly visible content is collected. No login, credentials, or personal data are used or stored, and access credentials belong to the Actor itself — they are never accepted through the input.

Use this Actor only for data you are permitted to access and process. You are responsible for complying with Reddit's terms, applicable privacy laws, copyright, and anti-spam regulations, and with Apify's terms of service. Do not use the output for surveillance of individuals or any purpose that violates others' rights.

### Support

For help, contact **support@apismith.online** or open an issue on the Actor page.

When reporting a problem, include your Apify Run ID, the (non-sensitive) input you used, and any status or error message. Never share your Apify token, cookies, session IDs, or API keys.

# Actor input Schema

## `searches` (type: `array`):

One or more Reddit keywords to search. Each term is scraped independently. At least one term is required.

## `searchPosts` (type: `boolean`):

Search for matching posts.

## `searchComments` (type: `boolean`):

Search for matching comments.

## `searchCommunities` (type: `boolean`):

Search for matching subreddits.

## `searchUsers` (type: `boolean`):

Search for matching users.

## `searchMedia` (type: `boolean`):

Search for matching images, videos and GIFs.

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

Result ordering. Ignored for communities and users. COMMENTS (sort by comment count) applies to posts only.

## `time` (type: `string`):

Filter by posting time. Only applies to posts and media.

## `maxItems` (type: `integer`):

Maximum number of results to store. The run stops as soon as the limit is reached, so nothing beyond it is requested. Note: runs on the free Apify plan return at most 7 results regardless of the value set here. Upgrade to a paid Apify plan to collect more.

## `includeNSFW` (type: `boolean`):

Include adult or sensitive content. When disabled, NSFW items are filtered out before they are stored.

## `safeSearch` (type: `boolean`):

Enable strict safe search.

## Actor input object example

```json
{
  "searches": [
    "byd",
    "electric vehicle"
  ],
  "searchPosts": true,
  "searchComments": false,
  "searchCommunities": false,
  "searchUsers": false,
  "searchMedia": false,
  "sort": "RELEVANCE",
  "time": "all",
  "maxItems": 100,
  "includeNSFW": false,
  "safeSearch": false
}
```

# Actor output Schema

## `results` (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 = {
    "searches": [
        "byd"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("apple_yang/reddit-search-scraper-api").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 = { "searches": ["byd"] }

# Run the Actor and wait for it to finish
run = client.actor("apple_yang/reddit-search-scraper-api").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 '{
  "searches": [
    "byd"
  ]
}' |
apify call apple_yang/reddit-search-scraper-api --silent --output-dataset

```

## MCP server setup

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

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/Jf8AmaGA7eCMABkIL/builds/IakhyPcxzDcRKM6SJ/openapi.json
