# Reddit Scraper for Community (`creative_tablecloth/reddit-scraper-for-community`) Actor

Access Reddit community data freely without authentication. Easily extract detailed information from subreddit feeds, including posts, authors, flairs, scores, and community insights—all efficiently and cost-effectively (approx $0.015 for 1,000 results).

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

## Pricing

from $1.60 / 1,000 reddit results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Reddit Scraper for Communities

### Overview

This is an unofficial Reddit API-based scraper that provides seamless, unrestricted access to **Reddit community feeds** (subreddits) without the need for authentication. With its straightforward setup and minimal input requirements, you can easily extract detailed information from subreddits and their posts.

### Key Features

- **No Authentication Needed**: Access subreddit feeds without logging in.
- **Community-Level Scraping**: Extract subreddit metadata (name, subscribers, ID) and live posts.
- **Simple Setup**: Start scraping with just a single required field—the subreddit URL.
- **Cost-Effective**: 1,000 entries for only about $0.015.

### Use Case

This API is designed to extract **posts from subreddit feeds** and, optionally, their comments. It works with any community URL.

- **Example Use Case URL**: https://www.reddit.com/r/worldnews

### Data Extraction Details

The API captures a wide range of data points:

- **Community Info**: Subreddit name, ID, prefixed name, subscriber count.
- **Posts**: Title, body, author info, flair, score, comments count, creation time, outbound link, permalink, media/preview details, and status flags (stickied, locked, NSFW, archived).
- **Comments**: Comment body, author info, upvotes, replies count, creation time, permalink.
- **Media Information**: Thumbnails, preview images, outbound links, video details.
- **Miscellaneous Info**: Crossposts, distinguished status, removal flags, etc.

### Data Output Formats

- JSON
- XML
- CSV
- Excel
- HTML

### Example Applications

- **Brand Monitoring**: Track discussions of your brand or competitors across subreddits.
- **Market Research**: Collect and analyze real audience conversations.
- **Trend Analysis**: Detect emerging topics and public sentiment shifts in real-time.
- **Community Insights**: Explore user engagement patterns within communities.

### Data Output Example

Below is a sample of the JSON output provided by the API, showing one **post** and one **comment**:

````json
[
  {
    "contentType": "post",
    "sourceType": "link",
    "id": "1nm0abc",
    "name": "t3_1nm0abc",
    "subreddit": "worldnews",
    "subredditId": "t5_2qh13",
    "subredditPrefixed": "r/worldnews",
    "subredditSubscribers": 46899778,
    "author": "WorldNewsMods",
    "authorFullname": "t2_glrsi",
    "authorPremium": true,
    "title": "/r/WorldNews Live Thread: Russian Invasion of Ukraine Day 1305 (Thread #1452)",
    "selftext": "",
    "selftextHtml": null,
    "flair": {
      "text": "Russia/Ukraine",
      "richtext": [
        { "e": "text", "t": "Russia/Ukraine" }
      ],
      "cssClass": "russia",
      "backgroundColor": null,
      "textColor": null,
      "type": "richtext"
    },
    "score": 214,
    "ups": 214,
    "upvoteRatio": 0.96,
    "numComments": 22,
    "permalink": "https://reddit.com/r/worldnews/comments/1nm0abc/rworldnews_live_thread_russian_invasion_of/",
    "outboundUrl": "https://www.reddit.com/live/18hpxyz12abcs",
    "domain": "reddit.com",
    "thumbnail": "https://a.thumbs.redditmedia.com/example-thumb.jpg",
    "preview": {
      "source": null,
      "resolutions": []
    },
    "isVideo": false,
    "media": {
      "type": "liveupdate",
      "event_id": "18hpxyz12abcs"
    },
    "stickied": true,
    "pinned": false,
    "over18": false,
    "locked": false,
    "spoiler": false,
    "archived": false,
    "isCrosspostable": false,
    "postHint": null,
    "suggestedSort": "new",
    "distinguished": null,
    "numCrossposts": 0,
    "removedByCategory": null,
    "createdUtc": 1758351000,
    "createdAt": "2025-09-20T06:30:00Z",
    "listingAfter": "t3_1nlyzzz",
    "listingDist": 25
  },
  {
    "contentType": "comment",
    "createdAt": "2025-09-20T06:45:36Z",
    "createdUtc": 1758351936,
    "id": "t1_lo1abcd",
    "parseId": "lo1abcd",
    "parentId": "t3_1nm0abc",
    "postId": "t3_1nm0abc",
    "subreddit": "worldnews",
    "communityName": "r/worldnews",
    "authorId": "t2_4e7f3195",
    "author": "newsspotter",
    "body": "Appreciate the ongoing updates. The live thread makes it easy to keep track of developments.",
    "body_html": "<div class=\"md\"><p>Appreciate the ongoing updates. The live thread makes it easy to keep track of developments.</p></div>",
    "upvotes": 156,
    "noOfreplies": 3,
    "url": "https://reddit.com/r/worldnews/comments/1nm0abc/rworldnews_live_thread_russian_invasion_of/lo1abcd/"
  }
]



# Actor input Schema

## `startUrls` (type: `array`):

The URLs of Reddit community you want to scrape. You can add multiple URLs.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/worldnews"
    }
  ]
}
````

# 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 = {
    "startUrls": [
        {
            "url": "https://www.reddit.com/r/worldnews"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("creative_tablecloth/reddit-scraper-for-community").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 = { "startUrls": [{ "url": "https://www.reddit.com/r/worldnews" }] }

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

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/worldnews"
    }
  ]
}' |
apify call creative_tablecloth/reddit-scraper-for-community --silent --output-dataset

```

## MCP server setup

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

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/rrjKBOwXjz8Hr8dgY/builds/2aVvQK2KxAxWwdbFI/openapi.json
