# Reddit Scraper (no login · no API key) (`fruityp/reddit-scraper`) Actor

Scrape Reddit posts, comments, and keyword-search results from any subreddit — full comment trees with author, score, and timestamps. No login, no API key needed. Export to JSON, CSV, or Excel. Works with your own proxy on the free plan.

- **URL**: https://apify.com/fruityp/reddit-scraper.md
- **Developed by:** [FruityP](https://apify.com/fruityp) (community)
- **Categories:** Social media, Lead generation, AI
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Scraper (no login · no API key)

Scrape Reddit **posts, comments, and keyword-search results** from any subreddit —
with full **comment trees** (author, score, timestamps) and post selftext. **No
login, no API key.** Clean, flat output ready for **JSON / CSV / Excel**.

### What it does

- **Feeds** — pull `new` / `hot` / `rising` / `top` from any list of subreddits.
- **Search** — keyword queries across all of Reddit, or restricted to your subreddits.
- **Comments** — expand comment trees per post (nested replies, with `depth` +
  `parentId`), plus the post's selftext, with caps to keep runs cheap.
- **Clean, flat output** — one record per post and per comment, with author, score,
  comment count, timestamps, and canonical `reddit.com` links.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `subreddits` | string[] | – | Names with or without `r/`. |
| `searchQueries` | string[] | – | Keyword searches. |
| `restrictSearchToSubreddits` | bool | `false` | Run each query inside every listed subreddit instead of all of Reddit. |
| `sort` | enum | `new` | Feed sort: new/hot/rising/top. |
| `searchSort` | enum | `relevance` | relevance/hot/top/new/comments. |
| `time` | enum | `month` | Window for `top` feeds & searches. |
| `maxPostsPerSource` | int | `25` | Posts to fetch per subreddit feed / per search query. |
| `includeComments` | bool | `true` | Fetch selftext + comment trees. |
| `maxCommentsPerPost` | int | `50` | `0` disables comments. |
| `maxCommentPosts` | int | `10` | Only the first N posts get comments expanded (and selftext fetched). |
| `requestDelaySecs` | number | `1.0` | Politeness delay between requests. |
| `proxyConfiguration` | proxy | RESIDENTIAL | See **Proxies** below. |

At least one of `subreddits` / `searchQueries` is required.

#### Example input

```json
{
  "subreddits": ["AskUK", "CasualUK"],
  "searchQueries": ["window cleaner", "carpet cleaning"],
  "sort": "new",
  "maxPostsPerSource": 25,
  "includeComments": true,
  "maxCommentsPerPost": 50,
  "maxCommentPosts": 10,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
````

### Output

Posts and comments are pushed to the default dataset. See
[`sample-output.json`](sample-output.json) for a real captured sample. Shapes:

```jsonc
// post
{
  "type": "post", "id": "abc123", "fullId": "t3_abc123",
  "subreddit": "r/AskUK", "subredditId": "t5_2t4s3",
  "title": "Need a window cleaner", "text": "Anyone recommend one in Leeds?",
  "url": "https://www.reddit.com/r/AskUK/comments/abc123/...",
  "permalink": "https://www.reddit.com/r/AskUK/comments/abc123/...",
  "author": "jane_doe", "authorId": "t2_xyz",
  "createdAt": "2026-06-10T06:13:20Z", "createdUtc": 1781490961,
  "score": 42, "numComments": 16, "domain": "self.AskUK", "over18": false
}
// comment
{
  "type": "comment", "id": "c2", "fullId": "t1_c2",
  "postId": "t3_abc123", "parentId": "t1_c1", "depth": 1,
  "subreddit": "r/AskUK", "body": "+1 for SparkleClean",
  "author": "sue", "authorId": "t2_sue",
  "createdAt": "2026-06-10T06:16:40Z", "score": 3,
  "permalink": "https://www.reddit.com/r/AskUK/comments/abc123/_/c2/"
}
```

### Proxies

Reddit blocks shared cloud IPs, so the actor needs an IP it'll accept:

- **Paid Apify plan:** leave the default `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}` — it just works. The actor rotates the IP per source.
- **Free plan:** Apify residential isn't available, so supply your own under **Proxy
  configuration → Custom proxies**. Any residential proxy provider works:
  ```json
  { "useApifyProxy": false, "proxyUrls": ["http://USER:PASS@gate.provider.com:PORT"] }
  ```
- For higher volume, raise `requestDelaySecs` and use more proxy IPs.

<details>
<summary>Free option: route through your own home/mobile IP (no provider)</summary>

1. Run a local HTTP proxy:
   ```bash
   pip install proxy.py
   python -m proxy --hostname 127.0.0.1 --port 8899 --basic-auth user:pass
   ```
2. Expose it with a **TCP** tunnel — e.g. pinggy.io (cardless):
   `ssh -p 443 -R0:localhost:8899 tcp@a.pinggy.io` → prints `tcp://HOST:PORT`
   (or `ngrok tcp 8899`).
3. Set **Proxy configuration → Custom proxies** to
   `{ "useApifyProxy": false, "proxyUrls": ["http://user:pass@HOST:PORT"] }`.

Single IP — fine for low volume, not scale. Keep the proxy behind auth and only
open the tunnel while running.

</details>

### Reliability

- Built-in rate limiting with automatic **back-off and retry** on throttling /
  transient errors (honours `Retry-After`).
- A genuinely failed fetch **raises** rather than silently reporting 0 results.
- If one subreddit/query fails, it's logged and the run continues with the rest.

### Legal / ethics

Collects **public** Reddit data only. Respect Reddit's Terms, rate limits, and
applicable law; don't use it to harvest personal data for spam. Deleted/removed
content (`[deleted]` / `[removed]`) is dropped automatically.

# Actor input Schema

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

Subreddit names to pull feeds from (with or without the r/ prefix).

## `searchQueries` (type: `array`):

Keyword searches. Run across all of Reddit, or restricted to the subreddits above (see 'Restrict search to subreddits').

## `restrictSearchToSubreddits` (type: `boolean`):

If on, each search query is run inside every listed subreddit instead of across all of Reddit.

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

Sort order for subreddit feeds.

## `searchSort` (type: `string`):

Sort order for search queries.

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

Time window for 'Top' feeds and searches.

## `maxPostsPerSource` (type: `integer`):

Posts to fetch per subreddit feed / per search query.

## `includeComments` (type: `boolean`):

Also fetch comment trees for the scraped posts.

## `maxCommentsPerPost` (type: `integer`):

Cap comments captured per post (0 disables comment scraping).

## `maxCommentPosts` (type: `integer`):

Only the first N posts get their comment trees fetched (keeps runs cheap).

## `requestDelaySecs` (type: `number`):

Politeness delay between Reddit requests.

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

On a paid plan, keep the default residential proxy. On the free plan, select Custom proxies and paste your own proxy URL(s).

## Actor input object example

```json
{
  "subreddits": [
    "AskUK",
    "CasualUK"
  ],
  "searchQueries": [
    "window cleaner",
    "carpet cleaning"
  ],
  "restrictSearchToSubreddits": false,
  "sort": "new",
  "searchSort": "relevance",
  "time": "month",
  "maxPostsPerSource": 25,
  "includeComments": true,
  "maxCommentsPerPost": 50,
  "maxCommentPosts": 10,
  "requestDelaySecs": 1,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped posts and comments (default dataset).

# 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 = {
    "subreddits": [
        "AskUK",
        "CasualUK"
    ],
    "searchQueries": [
        "window cleaner",
        "carpet cleaning"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fruityp/reddit-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 = {
    "subreddits": [
        "AskUK",
        "CasualUK",
    ],
    "searchQueries": [
        "window cleaner",
        "carpet cleaning",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("fruityp/reddit-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 '{
  "subreddits": [
    "AskUK",
    "CasualUK"
  ],
  "searchQueries": [
    "window cleaner",
    "carpet cleaning"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call fruityp/reddit-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Scraper (no login · no API key)",
        "description": "Scrape Reddit posts, comments, and keyword-search results from any subreddit — full comment trees with author, score, and timestamps. No login, no API key needed. Export to JSON, CSV, or Excel. Works with your own proxy on the free plan.",
        "version": "0.1",
        "x-build-id": "SrvkM4Du5NTXXfENv"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/fruityp~reddit-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-fruityp-reddit-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/fruityp~reddit-scraper/runs": {
            "post": {
                "operationId": "runs-sync-fruityp-reddit-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/fruityp~reddit-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-fruityp-reddit-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",
                "properties": {
                    "subreddits": {
                        "title": "Subreddits",
                        "type": "array",
                        "description": "Subreddit names to pull feeds from (with or without the r/ prefix).",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "searchQueries": {
                        "title": "Search queries",
                        "type": "array",
                        "description": "Keyword searches. Run across all of Reddit, or restricted to the subreddits above (see 'Restrict search to subreddits').",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "restrictSearchToSubreddits": {
                        "title": "Restrict search to subreddits",
                        "type": "boolean",
                        "description": "If on, each search query is run inside every listed subreddit instead of across all of Reddit.",
                        "default": false
                    },
                    "sort": {
                        "title": "Feed sort",
                        "enum": [
                            "new",
                            "hot",
                            "rising",
                            "top"
                        ],
                        "type": "string",
                        "description": "Sort order for subreddit feeds.",
                        "default": "new"
                    },
                    "searchSort": {
                        "title": "Search sort",
                        "enum": [
                            "relevance",
                            "hot",
                            "top",
                            "new",
                            "comments"
                        ],
                        "type": "string",
                        "description": "Sort order for search queries.",
                        "default": "relevance"
                    },
                    "time": {
                        "title": "Time range",
                        "enum": [
                            "hour",
                            "day",
                            "week",
                            "month",
                            "year",
                            "all"
                        ],
                        "type": "string",
                        "description": "Time window for 'Top' feeds and searches.",
                        "default": "month"
                    },
                    "maxPostsPerSource": {
                        "title": "Max posts per source",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Posts to fetch per subreddit feed / per search query.",
                        "default": 25
                    },
                    "includeComments": {
                        "title": "Include comments",
                        "type": "boolean",
                        "description": "Also fetch comment trees for the scraped posts.",
                        "default": true
                    },
                    "maxCommentsPerPost": {
                        "title": "Max comments per post",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Cap comments captured per post (0 disables comment scraping).",
                        "default": 50
                    },
                    "maxCommentPosts": {
                        "title": "Max posts to expand comments for",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only the first N posts get their comment trees fetched (keeps runs cheap).",
                        "default": 10
                    },
                    "requestDelaySecs": {
                        "title": "Delay between requests (s)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Politeness delay between Reddit requests.",
                        "default": 1
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "On a paid plan, keep the default residential proxy. On the free plan, select Custom proxies and paste your own proxy URL(s).",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
