# 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:** 2 total users, 1 monthly users, 94.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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Search Scraper",
        "description": "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.",
        "version": "0.0",
        "x-build-id": "e6AK1cLFDyQOyhLmR"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crw~reddit-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crw-reddit-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/crw~reddit-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crw-reddit-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/crw~reddit-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crw-reddit-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "query"
                ],
                "properties": {
                    "query": {
                        "title": "Search Query",
                        "minLength": 1,
                        "type": "string",
                        "description": "The search query (e.g., 'apify scraper', 'web scraping python')"
                    },
                    "searchType": {
                        "title": "Search Type",
                        "enum": [
                            "posts",
                            "comments",
                            "communities",
                            "media",
                            "people"
                        ],
                        "type": "string",
                        "description": "What to search for — posts, comments, communities, media, or people",
                        "default": "posts"
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of results to collect (min 1, max 500)",
                        "default": 100
                    },
                    "timeFilter": {
                        "title": "Time Filter",
                        "enum": [
                            "all",
                            "year",
                            "month",
                            "week",
                            "day",
                            "hour"
                        ],
                        "type": "string",
                        "description": "Filter results by time range (applies to posts and media)",
                        "default": "all"
                    },
                    "sortOrder": {
                        "title": "Sort Order",
                        "enum": [
                            "relevance",
                            "hot",
                            "top",
                            "new",
                            "comments"
                        ],
                        "type": "string",
                        "description": "Sort order for results (applies to posts and media)",
                        "default": "relevance"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
