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

Search Reddit and extract structured data across all content types — posts, comments, communities, media, and people. No login required. Filter by time range and sort order. Perfect for market research, sentiment analysis, community discovery, and AI training datasets.

- **URL**: https://apify.com/crw/reddit-search-scraper.md
- **Developed by:** [CRW](https://apify.com/crw) (community)
- **Categories:** Automation, Social media, News
- **Stats:** 3 total users, 2 monthly users, 96.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Reddit Search Scraper

Search Reddit and extract structured data across all content types — posts, comments, communities, media, and people. No login, no cookies, no manual scrolling.

**→ Enter a keyword and select a Search Type in the Input tab, then click Start.**

***

### What you get

Each result includes a `dataType` field that identifies the content type. Here's what each type looks like:

#### Posts (`searchType: "posts"`)

```json
{
  "dataType": "post",
  "id": "t3_1u8s0g1",
  "title": "So.. did Iran win this conflict?",
  "url": "https://www.reddit.com/r/NoStupidQuestions/comments/1u8s0g1/so_did_iran_win_this_conflict/",
  "subredditName": "NoStupidQuestions",
  "subredditId": "t5_2w844",
  "authorName": "MarsupialThink4064",
  "authorId": "t2_8mxlchoh",
  "nsfw": false,
  "spoiler": false,
  "createdAt": "2026-06-18T00:52:28.818000+0000",
  "voteCount": 7656,
  "commentCount": 2520,
  "thumbnailUrl": null,
  "body": "After Iran and the US exchanged fire...",
  "upvoteRatio": 0.88,
  "contentType": "text",
  "images": null
}
```

#### Comments (`searchType: "comments"`)

```json
{
  "dataType": "comment",
  "id": "t1_np7f7jd",
  "postId": "t3_1oywew6",
  "postTitle": "20 years worth of spent nuclear fuel from a nuclear reactor",
  "postUrl": "https://www.reddit.com/r/Damnthatsinteresting/comments/1oywew6/...",
  "subredditName": "Damnthatsinteresting",
  "subredditId": "t5_2xxyj",
  "authorName": "FlatusSurprise",
  "body": "It's called a closed cycle fuel system and Japan has been doing it for decades...",
  "createdAt": "2025-11-16T20:35:43.105000+0000"
}
```

#### Communities (`searchType: "communities"`)

```json
{
  "dataType": "community",
  "id": "t5_2rzk9",
  "name": "PERSIAN",
  "url": "https://www.reddit.com/r/PERSIAN/",
  "description": "A community to discuss all things related to Iran and its people, culture, cuisine & history.",
  "nsfw": false,
  "weeklyVisitors": 25220,
  "weeklyPosts": 1090,
  "iconUrl": null
}
```

#### Media (`searchType: "media"`)

```json
{
  "dataType": "post",
  "id": "t3_1ud1rtp",
  "title": "What if USA had landed troops in Iran?",
  "url": "https://www.reddit.com/r/AlternateHistoryHub/comments/1ud1rtp/...",
  "subredditName": "AlternateHistoryHub",
  "subredditId": "t5_3c881",
  "authorName": "Acceptable-Tackle301",
  "authorId": "t2_25eeqwi7m9",
  "nsfw": false,
  "spoiler": false,
  "contentType": "image",
  "thumbnailUrl": "https://preview.redd.it/what-if-usa-had-landed-troops-in-iran-v0-esxarl5vdx8h1.jpg?...",
  "images": [
    "https://preview.redd.it/what-if-usa-had-landed-troops-in-iran-v0-esxarl5vdx8h1.jpg?..."
  ]
}
```

#### People (`searchType: "people"`)

```json
{
  "dataType": "people",
  "id": "t2_1q5x7lnnrw",
  "name": "IndiaTodayGlobal",
  "url": "https://www.reddit.com/user/IndiaTodayGlobal/",
  "karma": 419118,
  "iconUrl": "https://styles.redditmedia.com/t5_eji7t4/styles/profileIcon_d8395d1jx13f1.jpg"
}
```

***

### Input

| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| `query` | Yes | — | Search keyword (e.g. `"apify scraper"`, `"chatgpt alternatives"`) |
| `searchType` | No | `posts` | `posts` / `comments` / `communities` / `media` / `people` |
| `maxResults` | No | `100` | Number of results to collect — 1 to 500 |
| `timeFilter` | No | `all` | `all` / `year` / `month` / `week` / `day` / `hour` — applies to posts and media |
| `sortOrder` | No | `relevance` | `relevance` / `hot` / `top` / `new` / `comments` — applies to posts and media |

Results are exported as **JSON**, **CSV**, or **Excel** from your Apify dataset.

***

### Output fields by type

#### Posts & Media

| Field | Description |
|-------|-------------|
| `dataType` | `"post"` |
| `id` | Post ID (e.g. `t3_1u8s0g1`) |
| `title` | Post title |
| `url` | Direct link to the post |
| `subredditName` | Subreddit name |
| `subredditId` | Subreddit ID |
| `authorName` | Author username |
| `authorId` | Author ID |
| `nsfw` | Whether the post is NSFW |
| `spoiler` | Whether the post is marked as a spoiler |
| `createdAt` | ISO 8601 timestamp |
| `voteCount` | Net upvotes (posts only) |
| `commentCount` | Number of comments (posts only) |
| `upvoteRatio` | Upvote ratio 0–1 (posts only) |
| `contentType` | `text` / `image` / `video` / `multi_media` / `link` |
| `body` | Full post text (text posts only; `null` for others) |
| `thumbnailUrl` | Thumbnail image URL |
| `images` | Image URLs (image and gallery posts only) |

#### Comments

| Field | Description |
|-------|-------------|
| `dataType` | `"comment"` |
| `id` | Comment ID (e.g. `t1_owbt1zt`) |
| `postId` | Parent post ID |
| `postTitle` | Parent post title |
| `postUrl` | Link to the parent post |
| `subredditName` | Subreddit name |
| `subredditId` | Subreddit ID |
| `authorName` | Comment author username |
| `body` | Comment text |
| `createdAt` | ISO 8601 timestamp |

#### Communities

| Field | Description |
|-------|-------------|
| `dataType` | `"community"` |
| `id` | Subreddit ID (e.g. `t5_2rzk9`) |
| `name` | Subreddit name |
| `url` | Subreddit URL |
| `description` | Community description |
| `nsfw` | Whether the community is NSFW |
| `weeklyVisitors` | Weekly visitor count |
| `weeklyPosts` | Weekly post count |
| `iconUrl` | Community icon image URL |

#### People

| Field | Description |
|-------|-------------|
| `dataType` | `"people"` |
| `id` | User ID (e.g. `t2_12gbdz`) |
| `name` | Username |
| `url` | Profile URL |
| `karma` | Total karma |
| `iconUrl` | Avatar image URL |

***

### Use cases

- **Brand & market research** — find what people say about a product across posts, comments, and communities
- **Trend monitoring** — track rising discussions with `sortOrder: "new"` or `timeFilter: "day"`
- **Community discovery** — use `searchType: "communities"` to find relevant subreddits for a topic
- **Training data** — collect authentic text from posts and comments for NLP and sentiment models
- **Influencer research** — use `searchType: "people"` to find active voices around a topic

***

### For developers

#### JavaScript / TypeScript

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('crw/reddit-search-scraper').call({
  query: 'web scraping tools',
  searchType: 'posts',
  maxResults: 200,
  timeFilter: 'month',
  sortOrder: 'top',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_API_TOKEN')

run = client.actor('crw/reddit-search-scraper').call(run_input={
    'query': 'web scraping tools',
    'searchType': 'comments',
    'maxResults': 200,
    'timeFilter': 'month',
})

for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item)
```

***

### Limitations

- Up to 500 results per run
- `body` is only populated for text posts — image, video, and link posts return `null`
- `timeFilter` and `sortOrder` apply to `posts` and `media` only; ignored for other search types
- `voteCount`, `commentCount`, and `upvoteRatio` are not available for `media` results

***

### You Might Also Need

**[Reddit Subreddit Scraper](https://apify.com/crw/reddit-subreddit-scraper)**

Already know which community you care about? Instead of searching across all of Reddit, this actor pulls the full post feed of a specific subreddit — sorted by hot, new, top, or rising.

# Actor input Schema

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

The search query (e.g., 'apify scraper', 'web scraping python')

## `searchType` (type: `string`):

What to search for — posts, comments, communities, media, or people

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

Maximum number of results to collect (min 1, max 500)

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

Filter results by time range (applies to posts and media)

## `sortOrder` (type: `string`):

Sort order for results (applies to posts and media)

## Actor input object example

```json
{
  "query": "apify",
  "searchType": "posts",
  "maxResults": 100,
  "timeFilter": "all",
  "sortOrder": "relevance"
}
```

# Actor output Schema

## `api` (type: `string`):

REST API endpoint to download the dataset programmatically.

# 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": "apify"
};

// Run the Actor and wait for it to finish
const run = await client.actor("crw/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": "apify" }

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": "apify"
}' |
apify call crw/reddit-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crw/reddit-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/hTZDUpHjUZRWwe7mx/builds/e6AK1cLFDyQOyhLmR/openapi.json
