# Reddit Subreddit Scraper (`crw/reddit-subreddit-scraper`) Actor

Scrape posts from any Reddit subreddit by sort order (hot, new, top, rising, best). Collects title, body, score, upvote ratio, author, and more. No login required.

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

## Pricing

from $1.99 / 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 Subreddit Scraper

Scrape posts from any Reddit subreddit — no login, no API key, no manual scrolling.

Pick a subreddit and a sort order. Get back a clean dataset with post titles, body text, vote counts, upvote ratios, authors, and timestamps. Everything you'd see browsing the feed, delivered as structured data.

---

### Who is this for?

**Market researchers & brand analysts**
Monitor what communities are discussing around your product, competitor, or industry. Reddit subreddits are where niche opinions concentrate — surface them without spending hours reading threads.

**Growth hackers & community builders**
Track trending posts in specific subreddits before they peak. Understand what content resonates in your niche by sorting by hot, top, or rising.

**Data scientists & AI teams**
Build training datasets, sentiment analysis pipelines, or trend models on authentic long-form user content. Pull from any subreddit with full body text included.

**Developers & automation engineers**
Plug subreddit data directly into your pipeline via the Apify API, webhooks, or SDK. Full JSON output, exportable as CSV or Excel.

---

### What you get

Every post comes with:

| Field | Example |
|-------|---------|
| `title` | AI Companies Are Trying to Seize Control of Elections |
| `body` | Full post text (text posts only) |
| `url` | Direct link to the post |
| `subredditName` | `technology` |
| `subredditId` | `t5_2qh16` |
| `authorName` | `Plastic_Ninja_9014` |
| `authorId` | `t2_98wao505` |
| `createdAt` | `2026-06-23T19:14:14.077000+0000` |
| `score` | 5994 |
| `commentCount` | 271 |
| `upvoteRatio` | 0.969 |
| `postType` | `link` / `image` / `video` / `text` |
| `domain` | `yahoo.com` (link posts only) |
| `images` | `["https://i.redd.it/...", "https://preview.redd.it/...?s=..."]` (image/gallery posts only) |
| `nsfw` | `false` |
| `spoiler` | `false` |

#### Sample record

```json
{
  "id": "t3_1udqjnw",
  "title": "AI Companies Are Trying to Seize Control of Elections",
  "url": "https://www.reddit.com/r/technology/comments/1udqjnw/ai_companies_are_trying_to_seize_control_of/",
  "subredditName": "technology",
  "subredditId": "t5_2qh16",
  "authorName": "Plastic_Ninja_9014",
  "authorId": "t2_98wao505",
  "createdAt": "2026-06-23T19:14:14.077000+0000",
  "score": 5994,
  "commentCount": 271,
  "upvoteRatio": 0.9689058862653808,
  "postType": "link",
  "domain": "yahoo.com",
  "nsfw": false,
  "spoiler": false,
  "body": null,
  "images": null
}
````

**Gallery post example** (`images` field):

```json
{
  "id": "t3_1ue13b6",
  "title": "Weird teeth thingy",
  "postType": "gallery",
  "images": [
    "https://preview.redd.it/weird-teeth-thingy-v0-s8eyzzka559h1.jpg?width=640&crop=smart&auto=webp&s=a90f41a96964c13703f10677c5664e7c87278e76",
    "https://preview.redd.it/weird-teeth-thingy-v0-jo0crzka559h1.jpg?width=640&crop=smart&auto=webp&s=a89fcfcb0c553730d0cdf2ecb48adaaa60cf06ec",
    "https://preview.redd.it/weird-teeth-thingy-v0-5wxg70la559h1.jpg?width=640&crop=smart&auto=webp&s=5ba689fa79a613d789aa02179683bd3910dfadcd"
  ]
}
```

***

### Getting started

#### 1. Set your input

| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| `subreddit` | Yes | — | Subreddit name (e.g. `technology`, `worldnews`, `r/science`) |
| `sort` | No | `hot` | Feed sort order: `hot` / `new` / `top` / `rising` / `best` |
| `timeFilter` | No | `day` | Time range for `top` sort only: `hour` / `day` / `week` / `month` / `year` / `all` |
| `maxResults` | No | `100` | Number of posts to collect (10–500) |

#### 2. Run it

Click **Start** in the Apify console, or use the API:

```json
{
  "subreddit": "technology",
  "sort": "top",
  "timeFilter": "week",
  "maxResults": 100
}
```

#### 3. Get your data

Results land in your Apify dataset as each batch completes. Export as **JSON**, **CSV**, or **Excel** — or stream directly into your app via the Apify API.

***

### For developers

#### JavaScript / TypeScript

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

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

const run = await client.actor('YOUR_ACTOR_ID').call({
  subreddit: 'technology',
  sort: 'top',
  timeFilter: 'week',
  maxResults: 200,
});

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('YOUR_ACTOR_ID').call(run_input={
    'subreddit': 'technology',
    'sort': 'top',
    'timeFilter': 'week',
    'maxResults': 200,
})

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

***

### Limitations

- **Volume:** 10 to 500 posts per run.
- **Body text:** Only available on text posts. Link, image, and video posts return `null` for `body`.
- **Images:** Only available on `image` and `gallery` posts. Other post types return `null` for `images`. `image` posts return a direct `i.redd.it` URL with no expiry. `gallery` posts return `preview.redd.it` URLs signed with a CDN token — these are valid for approximately **7 days** from the time of scraping.
- **`timeFilter`:** Only applies when `sort` is set to `top`. Ignored for all other sort orders.

***

### You Might Also Need

If you're collecting posts from a specific subreddit, you might also want to **search Reddit by keyword** across all communities — not just one.

#### 🔍 [Reddit Post Scraper](https://apify.com/crw/reddit-post-scraper)

> Keyword-based Reddit search across all subreddits.

This actor scrapes a single subreddit feed. The **Reddit Post Scraper** takes a different angle:

| | Reddit Subreddit Scraper | Reddit Post Scraper |
|---|---|---|
| **Input** | Subreddit name | Search keyword |
| **Coverage** | One community | All of Reddit |
| **Best for** | Monitoring a specific community | Finding posts about a topic across subreddits |
| **Sort** | hot / new / top / rising / best | relevance / hot / top / new / comments |

→ **[Try Reddit Post Scraper](https://apify.com/crw/reddit-post-scraper)**

# Actor input Schema

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

Subreddit name to scrape (e.g. <code>whatisit</code>, <code>worldnews</code>, <code>r/science</code>). The <code>r/</code> prefix is optional.

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

Feed sort order.

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

Time range for posts. Only applies when <strong>Sort order</strong> is set to <code>top</code>. Ignored for all other sort orders.

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

Maximum number of posts to collect. Between 1 and 500.

## Actor input object example

```json
{
  "subreddit": "whatisit",
  "sort": "hot",
  "timeFilter": "day",
  "maxResults": 100
}
```

# 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 = {
    "subreddit": "whatisit"
};

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

# Run the Actor and wait for it to finish
run = client.actor("crw/reddit-subreddit-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 '{
  "subreddit": "whatisit"
}' |
apify call crw/reddit-subreddit-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Subreddit Scraper",
        "description": "Scrape posts from any Reddit subreddit by sort order (hot, new, top, rising, best). Collects title, body, score, upvote ratio, author, and more. No login required.",
        "version": "0.0",
        "x-build-id": "EwkAtxDTvfcCrW4vh"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crw~reddit-subreddit-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crw-reddit-subreddit-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-subreddit-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crw-reddit-subreddit-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-subreddit-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crw-reddit-subreddit-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": [
                    "subreddit"
                ],
                "properties": {
                    "subreddit": {
                        "title": "Subreddit",
                        "minLength": 1,
                        "type": "string",
                        "description": "Subreddit name to scrape (e.g. <code>whatisit</code>, <code>worldnews</code>, <code>r/science</code>). The <code>r/</code> prefix is optional."
                    },
                    "sort": {
                        "title": "Sort order",
                        "enum": [
                            "hot",
                            "new",
                            "top",
                            "rising",
                            "best"
                        ],
                        "type": "string",
                        "description": "Feed sort order.",
                        "default": "hot"
                    },
                    "timeFilter": {
                        "title": "Time filter",
                        "enum": [
                            "hour",
                            "day",
                            "week",
                            "month",
                            "year",
                            "all"
                        ],
                        "type": "string",
                        "description": "Time range for posts. Only applies when <strong>Sort order</strong> is set to <code>top</code>. Ignored for all other sort orders.",
                        "default": "day"
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 10,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of posts to collect. Between 1 and 500.",
                        "default": 100
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
