# Reddit Subreddits V2 — Info, Rules, Wiki, Leaderboard (16) (`red_crawler/reddit-subreddits-v2`) Actor

Full subreddit toolkit: ID, rules, access info, type, channels, flairs, emojis, style/widgets, highlights, status, wiki + 5 bearer ops (access eligibility, settings, post requirements, top posters, top commenters).

- **URL**: https://apify.com/red\_crawler/reddit-subreddits-v2.md
- **Developed by:** [Red Crawler](https://apify.com/red_crawler) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN 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 Subreddits V2

![Endpoints](https://img.shields.io/badge/endpoints-16-blue) ![Auth](https://img.shields.io/badge/Reddit_account-11_no_/_5_yes-yellow) ![Proxy](https://img.shields.io/badge/proxy-only_for_bearer_endpoints-yellow) ![Pricing](https://img.shields.io/badge/pricing-pay_per_result-orange)

Sixteen self-contained subreddit lookups — ID, rules, access state, type / topic, chat channels, flairs, custom emojis, theme & widgets, highlighted posts, status, wiki, **plus the 5 bearer-only endpoints** the Android app uses (access eligibility, full mod-side settings, post requirements, top-poster leaderboard, top-commenter leaderboard).

The first 11 endpoints are **anonymous — no Reddit account, no OAuth, no proxy required.** The 5 bearer endpoints reuse a Reddit account you've already saved in the **Reddit Vault** actor (or you can paste a Token V2 + matching proxy directly).

Pick an endpoint, fill the matching section, hit Start.

---

### What you can fetch

Every endpoint accepts a subreddit in any of these formats — paste whichever you have:

- bare name — `AskReddit`
- prefixed — `r/AskReddit`
- subreddit URL — `https://www.reddit.com/r/AskReddit`
- old-Reddit URL — `https://old.reddit.com/r/AskReddit`

#### Public endpoints (no Reddit account needed)

##### 1. ID — resolve subreddit name to its `t5_` ID

The simplest endpoint. Takes a subreddit name and returns Reddit's internal `t5_...` ID.

**Returns:** `id` (`t5_...`), `name`, `prefixedName` (`r/...`).

**Use it when:** you need a subreddit ID to seed another endpoint that takes IDs (e.g., the Recommended Media feed in **Reddit Feeds V2**, or any of Reddit's bulk-by-ID lookups).

##### 2. Rules — community rules list

Returns the subreddit's published rules — the list shown in the sidebar / community page.

**Returns:** array of rules, each with `priority`, `name` (short name), `description`, `violationReason`, `kind` (link / comment / all), `createdAt`.

**Use it when:** moderation tooling, rule-based content classification, building a "before you post" UX, or compliance / content-policy auditing.

##### 3. Access Info — public / restricted / private + age gate

Tells you whether the subreddit is public, restricted, or private — and whether content is age-gated (NSFW).

**Returns:** `isContributorRequired` (restricted-mode flag), `isNsfw` (over-18 flag), `isQuarantined`, `subscribersCount`, `permissions` (what an anonymous viewer can do).

**Use it when:** filtering content collection (skip private / quarantined subs), bulk-checking accessibility before scraping, NSFW-policy enforcement.

##### 4. Type — community type & topic settings

Returns Reddit's type-classification settings for the subreddit — what kind of community it is, what posts it allows, what topic it's tagged under.

**Returns:** `type` (public / restricted / private / employees_only), `topic` (Reddit's interest-topic tag), `allowedPostTypes` (text / link / image / video / poll / gallery), `language`, `country`, `originalContentTagEnabled`.

**Use it when:** community taxonomy, building targeting rules ("only image-allowed gaming subs in EN"), audience research.

##### 5. Channels — chat channels enabled flag

Returns whether the subreddit has Reddit chat channels enabled.

**Returns:** `chatChannelsEnabled` flag plus channel metadata if any.

**Use it when:** mapping which subreddits have an active Reddit Chat surface, community-engagement audits.

##### 6. Flairs — searchable flairs (post + user)

Returns the full list of post flairs and user flairs the subreddit has configured.

**Returns:** two arrays — `postFlairs` (with `id`, `text`, `cssClass`, `backgroundColor`, `textColor`, `richtext`, `mod-only` flag) and `userFlairs` (same shape).

**Use it when:** flair-aware scraping (filter posts by flair), building a flair picker for a posting actor, content classification using subreddit-defined tags.

##### 7. Emojis — custom emoji list (snoomoji + community)

Returns the subreddit's custom emoji set — the community-uploaded emojis used in flairs and comments.

**Returns:** array of emojis, each with `name`, `url` (image URL), `mod-only` flag, `userFlairAllowed` flag, `postFlairAllowed` flag, `createdAt`.

**Use it when:** rendering subreddit content with proper emoji assets, building emoji catalogs for a UI, monitoring custom-emoji adoption.

##### 8. Style & Widgets — colors, banners, sidebar widgets

The full visual identity payload — theme colors, banner / icon imagery, and the sidebar widgets Reddit shows on the community page (rules block, mod list, custom widgets, calendar, button widgets, image widgets, etc.).

**Returns:** `style` (banner image, icon, mobile banner, primary color, banner background color), plus `widgets` (id-keyed map of every widget on the sidebar with its kind and content).

**Use it when:** asset extraction, building a community-aware UI, embedding subreddit branding in a downstream app, design-research / community-aesthetics analysis.

##### 9. Highlights — highlighted posts on community page

Returns the posts the subreddit's mods have highlighted / pinned to the community page (the "Pinned" section at the top).

**Returns:** array of post records — same field shape as Reddit Feeds V2 (`id`, `postTitle`, `score`, `commentCount`, `createdAt`, `url`, `flair`, etc.).

**Note:** Many subreddits have no highlighted posts. An empty list is the normal result when the mods haven't pinned anything.

**Use it when:** featured-content discovery, finding the rules / mod-announcement pinned posts, monitoring community campaigns.

##### 10. Status — community status flags

Returns the lifecycle / visibility state of the subreddit — whether it is currently active, archived, locked, deleted, banned, or quarantined.

**Returns:** `isActive`, `isArchived`, `isLocked`, `isDeleted`, `isBanned`, `isQuarantined`, plus the human-readable reason / message Reddit displays for unavailable communities.

**Use it when:** screening dead / banned / archived subs out of a target list before launching a scrape, monitoring health of communities you depend on, dashboards that show which subs went down.

##### 11. Wiki — wiki page content

Reads the markdown content of any wiki page on the subreddit. Defaults to the wiki index, but you can pick from a dropdown of the most common pages.

**Inputs:**
- **Subreddit** — same input as everywhere else
- **Wiki page** — one of `index` (default), `config/sidebar`, `config/description`, `config/submit_text`, `faq`, `rules`, `wiki`

**Returns:** `content` (the page's markdown body), `revisionDate`, `revisionAuthor`, `mayRevise` (whether the current viewer can edit — always false for anonymous reads), `pageName`.

**Use it when:** scraping FAQ / sidebar / rules-as-prose, archiving wiki history, building a chat-bot grounded on a community's wiki.

**Note on `wiki` vs `index`:** these are usually the same page. `index` is the canonical name; `wiki` is what some communities use as the entry point.

#### Bearer-required endpoints (need a Reddit account)

These five endpoints hit GraphQL queries Reddit only serves to authenticated users. Fill the **Reddit credentials** section at the bottom of the input form (see [Credentials](#credentials) below).

##### 12. Access Eligibility — gating + age / quarantine state

Reddit's Android-app gating call: tells you, *for the signed-in user*, whether they can access this subreddit and what gate (age verification, quarantine ack, NSFW opt-in, contributor requirement) is currently blocking them.

**Returns:** `eligibility` (allowed / blocked), `gate` (e.g. `age_verification`, `quarantined`, `nsfw_opt_in`, `contributors_only`), `acknowledgmentRequired`, `messageHtml` (the modal text Reddit would show in-app).

**Use it when:** building a sign-in / browse flow that has to handle the same gates the Reddit app shows; pre-checking before a scraper authenticated as a user tries to read content; dashboards that surface "this account can / can't reach sub X".

##### 13. Settings — full mod-side settings

Returns the full Settings payload Reddit returns to a user with mod permissions on the subreddit — the exact fields the mod tools page edits. Many fields are also visible to non-mods (read-only); a non-mod call still returns the public subset.

**Returns:** `name`, `description`, `publicDescription`, `submitText`, `submitTextLabel`, `submitLinkLabel`, `language`, `country`, `subredditType`, `wikiEditMode`, `wikiEditAge`, `wikiEditKarma`, `spoilerEnabled`, `allOriginalContent`, `originalContentTagEnabled`, `welcomeMessageEnabled`, `welcomeMessageText`, plus content-control flags (`isCommentScoreHideMinsEnabled`, `commentScoreHideMins`, `suggestedCommentSort`, etc.).

**Use it when:** building mod tooling, exporting / migrating a community config, snapshot-diffing your settings over time, auditing a subreddit you own.

##### 14. Post Requirements — title / body rules + allowed types

Returns the per-subreddit **posting rules** Reddit enforces server-side — what title length is allowed, which body types (text / link / image / video) are accepted, whether flair is required, banned domains, banned words, repost windows.

**Returns:** `titleRequired`, `titleBlacklistedRegex`, `titleRegex`, `bodyRequired`, `bodyBlacklistedRegex`, `bodyRegex`, `bodyRestrictionPolicy`, `bodyTextMinLength`, `bodyTextMaxLength`, `linkRequired`, `linkRestrictionPolicy`, `domainBlacklist`, `domainWhitelist`, `flairRequired`, `repostAge`, `linkRepostProtection`, `imageRepostProtection`.

**Use it when:** validating user-supplied post content *before* you submit through any of the posting actors (saves you a failed submission), building a "post-prep" UI, audit-trailing why a community auto-removes posts.

##### 15. Top Posters — community leaderboard, top posters

Returns the leaderboard Reddit's Android app shows in "Top Contributors → Posters". Reddit splits these contributors into tiers (gold / silver / bronze plus an honorable-mentions tail).

**Inputs (optional):**
- **Max users** — `1` to `1000` (default `100`). Higher values use more API calls (paginated 25 / page server-side).

**Returns:** `tiers` (top tier blocks with their slot caps and contributors), `users` (flat list of all returned contributors with `username`, `avatar`, `score`, `rank`, `tierName`), `count`, `has_more`.

**Use it when:** finding the most active posters in a community, sourcing power-users for outreach, ranking communities by contributor concentration.

##### 16. Top Commenters — community leaderboard, top commenters

Same payload shape as Top Posters but for the commenters leaderboard.

**Inputs (optional):**
- **Max users** — `1` to `1000` (default `100`).

**Returns:** identical to Top Posters but ranking is by comment activity.

**Use it when:** finding most active commenters for engagement / community-management work, analyzing whether a sub's culture is post-driven or discussion-driven.

---

### Credentials

The 5 bearer-required endpoints (Access Eligibility, Settings, Post Requirements, Top Posters, Top Commenters) need a Reddit Token V2 cookie + the proxy that minted it. The first 11 endpoints ignore credentials entirely — leave the section blank for those.

#### Credential lifetime

| Credential | Lifetime | When to refresh |
|---|---|---|
| **Token V2** (`token_v2` cookie) | ~24 hours | Daily — or save it once in the [Reddit Vault](https://apify.com/red_crawler/reddit-vault) and let the vault auto-refresh. |

> **How to extract Token V2 from your browser:** open Reddit in Chrome / Brave / Edge / Firefox, then **DevTools → Application → Cookies → `https://www.reddit.com`**. Filter by `token_v2` and copy the **Value** column.
>
> ![Token V2 cookie in DevTools](https://docs.redcrawler.com/img/credentials/token-v2-cookie.jpg)

You have two options:

#### Option A — Use a saved account (recommended)

1. Run the **Reddit Vault** actor once to store a Reddit account under a name you choose (e.g. `main`, `mod-account`, `burner1`). The vault encrypts the Token V2 + matching proxy and stores them keyed by name.
2. In this actor, set **Credential source = Use saved account (vault)** and put the same name in **Saved account name**.
3. Done — Token V2 + proxy load automatically. Refresh the vault entry whenever the Token V2 expires (~24 h lifetime).

#### Option B — Paste Token V2 + proxy directly

For one-off runs without setting up the vault:

1. Set **Credential source = Paste Token V2 + proxy**.
2. Paste your Reddit `token_v2` cookie value (`eyJ...`) into **Token V2**.
3. Paste the matching proxy in `ip:port:user:pass` format into **Proxy**.

**Critical:** Reddit IP-binds Token V2 cookies. The proxy MUST be the exact same IP that originally minted the Token V2 — otherwise Reddit returns 401 on every bearer call. Both fields are stored encrypted by Apify.

---

### How to run

1. **Pick an endpoint** in the "What to fetch" dropdown at the top.
2. **Open the matching section** below it and fill the subreddit (and any extra fields, like Wiki page name or leaderboard Max users).
3. **If your endpoint is bearer-required** (12–16), fill the Reddit credentials section at the bottom.
4. **Click Start.**

Each endpoint section is independent — fields outside your chosen section are ignored, so you can leave them as-is between runs. Default subreddit is `AskReddit` and the default endpoint is `Rules`, so the actor runs out of the box.

---

### Output

Results are pushed to the actor's default dataset. View them as a table or download as JSON / CSV / Excel / XML.

- **ID / Access Info / Type / Channels / Style & Widgets / Status / Wiki / Access Eligibility / Settings / Post Requirements** push **one record** per run.
- **Rules / Flairs / Emojis** push **one record per item** (one row per rule, flair, emoji).
- **Highlights** pushes **one record per highlighted post**.
- **Top Posters / Top Commenters** push **one record** containing the full leaderboard payload (`tiers`, `users`, `count`, `has_more`).

The most useful columns are placed first (`endpoint`, `subreddit`, `subreddit_id`, `id`, `name`, etc.) so the dataset Table view is readable without horizontal scrolling.

---

### Common edge cases

- **Subreddit doesn't exist / banned** — Reddit returns no data; the actor pushes an error record. The Status endpoint surfaces the `isBanned` / `isDeleted` flags explicitly.
- **Private subreddits** — anonymous lookups can't see content of private subs. Access Info will tell you `isContributorRequired = true`; most other public endpoints will be empty. Bearer endpoints work if your account is an approved contributor.
- **Quarantined subreddits** — usually accessible read-only; Access Info / Status surface the `isQuarantined` flag, and Access Eligibility (bearer) tells you if your account has acknowledged the quarantine.
- **Empty wiki pages** — many subreddits have no wiki; the call returns empty content. This is normal.
- **No flairs / emojis / highlights** — some subreddits configure none of these. An empty list is the expected response, not a failure.
- **Bearer expired** — Reddit Token V2 cookies live ~24 h. If you get an `error_kind: bearer_expired` response, refresh the Token V2 in your vault entry (or paste a fresh one in manual mode) and re-run.
- **Settings on a sub you don't moderate** — call still succeeds but returns only the public-visible subset (name, description, language, country, etc.); mod-only fields are absent.
- **Subreddit name with mixed case** — Reddit is case-insensitive on subreddit names, but for cleanliness the actor uses whatever you paste. Both `AskReddit` and `askreddit` work.

---

### Why this actor is fast

- **Speed — 1–3 seconds per call, end-to-end** (single-page leaderboards 2–4 s; full 1000-user leaderboards 10–20 s due to server-side pagination at 25 / page). Pure GraphQL to Reddit. No browser to boot, no Playwright / Selenium / Puppeteer overhead. Competing browser-based scrapers typically take 15–60 seconds per call.
- **Reliability — zero browser flakiness.** No headless-Chromium crashes. No JS-render timeouts. No captcha pages. No surprise mid-run failures from a browser quirk.
- **Footprint — under 100 MB RAM per run.** Most browser-based scrapers need 1–4 GB. We're a thin async dispatcher — Reddit auth, proxy rotation, retry, and GraphQL handling all happen off-actor on our backend.

---

### Pricing

Pay-per-result. You're only charged for records actually pushed to the dataset — failed runs cost nothing. See the actor's pricing tab for the current per-result rate.

---

### Need a different shape of data?

- For **subreddit posts / feeds** (the actual posts, not the metadata), see **Reddit Feeds V2** → Subreddit Feed.
- For **search** (finding posts or subreddits by keyword), see **Reddit Search V2**.
- For **single-post + comments**, see **Reddit Scraper V2**.
- For **user lookups**, see **Reddit Users V2**.
- For **bulk subreddit lookups** (up to 1500 subreddit IDs in one call), see **Reddit Bulk Scrape V2** (`subreddit_info_by_ids` mode).
- For **storing a Reddit account once and reusing it across actors**, see **Reddit Vault**.
- For **moderation actions** on a subreddit you own (create, join / leave, post requirements, list your subscriptions), see the V1 moderation actors.

# Actor input Schema

## `endpoint` (type: `string`):

Choose which subreddit lookup to run.
## `id_subreddit` (type: `string`):

Subreddit name (without r/).
## `rules_subreddit` (type: `string`):

Subreddit name (without r/).
## `access_info_subreddit` (type: `string`):

Subreddit name (without r/).
## `type_subreddit` (type: `string`):

Subreddit name (without r/).
## `channels_subreddit` (type: `string`):

Subreddit name (without r/).
## `flairs_subreddit` (type: `string`):

Subreddit name (without r/).
## `emojis_subreddit` (type: `string`):

Subreddit name (without r/).
## `style_subreddit` (type: `string`):

Subreddit name (without r/).
## `highlights_subreddit` (type: `string`):

Subreddit name (without r/).
## `status_subreddit` (type: `string`):

Subreddit name (without r/).
## `access_eligibility_subreddit` (type: `string`):

Subreddit name (without r/).
## `settings_subreddit` (type: `string`):

Subreddit name (without r/).
## `post_requirements_subreddit` (type: `string`):

Subreddit name (without r/).
## `wiki_subreddit` (type: `string`):

Subreddit name (without r/).
## `wiki_page` (type: `string`):

Wiki page name. Common pages: index, config/sidebar, config/description, faq, rules. Use the dropdown for typical pages or enter any custom page slug.
## `leaderboard_posters_subreddit` (type: `string`):

Subreddit name (without r/).
## `leaderboard_posters_max_users` (type: `integer`):

Maximum number of users to fetch (1-1000). Higher values use more API calls.
## `leaderboard_commenters_subreddit` (type: `string`):

Subreddit name (without r/).
## `leaderboard_commenters_max_users` (type: `integer`):

Maximum number of users to fetch (1-1000). Higher values use more API calls.
## `credentialSource` (type: `string`):

Only used when the chosen endpoint requires a bearer (Access Eligibility, Settings, Post Requirements, Top Posters, Top Commenters). For all other endpoints leave the default — credentials are ignored. **Use saved account (vault)** loads your stored Token V2 + proxy from the **reddit-vault** actor — only the 'Saved account name' field is used. **Paste Token V2 + proxy** uses the values you paste below.
## `accountName` (type: `string`):

The name you used in the **reddit-vault** actor when you stored this account. Your Token V2 + proxy load automatically from the vault. Ignored when 'Credential source' = manual.
## `bearer` (type: `string`):

Your Reddit `token_v2` cookie value (`eyJ...`). Lifetime ~24 h. Encrypted at rest by Apify. Ignored when 'Credential source' = vault.
## `proxy` (type: `string`):

Proxy in `ip:port:user:pass` format. MUST be the same IP that originally minted the Token V2. Ignored when 'Credential source' = vault.

## Actor input object example

```json
{
  "endpoint": "rules",
  "id_subreddit": "AskReddit",
  "rules_subreddit": "AskReddit",
  "access_info_subreddit": "AskReddit",
  "type_subreddit": "AskReddit",
  "channels_subreddit": "AskReddit",
  "flairs_subreddit": "AskReddit",
  "emojis_subreddit": "AskReddit",
  "style_subreddit": "AskReddit",
  "highlights_subreddit": "AskReddit",
  "status_subreddit": "AskReddit",
  "access_eligibility_subreddit": "AskReddit",
  "settings_subreddit": "AskReddit",
  "post_requirements_subreddit": "AskReddit",
  "wiki_subreddit": "AskReddit",
  "wiki_page": "index",
  "leaderboard_posters_subreddit": "AskReddit",
  "leaderboard_posters_max_users": 100,
  "leaderboard_commenters_subreddit": "AskReddit",
  "leaderboard_commenters_max_users": 100,
  "credentialSource": "vault"
}
````

# 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 = {
    "endpoint": "rules",
    "id_subreddit": "AskReddit",
    "rules_subreddit": "AskReddit",
    "access_info_subreddit": "AskReddit",
    "type_subreddit": "AskReddit",
    "channels_subreddit": "AskReddit",
    "flairs_subreddit": "AskReddit",
    "emojis_subreddit": "AskReddit",
    "style_subreddit": "AskReddit",
    "highlights_subreddit": "AskReddit",
    "status_subreddit": "AskReddit",
    "access_eligibility_subreddit": "AskReddit",
    "settings_subreddit": "AskReddit",
    "post_requirements_subreddit": "AskReddit",
    "wiki_subreddit": "AskReddit",
    "leaderboard_posters_subreddit": "AskReddit",
    "leaderboard_commenters_subreddit": "AskReddit"
};

// Run the Actor and wait for it to finish
const run = await client.actor("red_crawler/reddit-subreddits-v2").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 = {
    "endpoint": "rules",
    "id_subreddit": "AskReddit",
    "rules_subreddit": "AskReddit",
    "access_info_subreddit": "AskReddit",
    "type_subreddit": "AskReddit",
    "channels_subreddit": "AskReddit",
    "flairs_subreddit": "AskReddit",
    "emojis_subreddit": "AskReddit",
    "style_subreddit": "AskReddit",
    "highlights_subreddit": "AskReddit",
    "status_subreddit": "AskReddit",
    "access_eligibility_subreddit": "AskReddit",
    "settings_subreddit": "AskReddit",
    "post_requirements_subreddit": "AskReddit",
    "wiki_subreddit": "AskReddit",
    "leaderboard_posters_subreddit": "AskReddit",
    "leaderboard_commenters_subreddit": "AskReddit",
}

# Run the Actor and wait for it to finish
run = client.actor("red_crawler/reddit-subreddits-v2").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 '{
  "endpoint": "rules",
  "id_subreddit": "AskReddit",
  "rules_subreddit": "AskReddit",
  "access_info_subreddit": "AskReddit",
  "type_subreddit": "AskReddit",
  "channels_subreddit": "AskReddit",
  "flairs_subreddit": "AskReddit",
  "emojis_subreddit": "AskReddit",
  "style_subreddit": "AskReddit",
  "highlights_subreddit": "AskReddit",
  "status_subreddit": "AskReddit",
  "access_eligibility_subreddit": "AskReddit",
  "settings_subreddit": "AskReddit",
  "post_requirements_subreddit": "AskReddit",
  "wiki_subreddit": "AskReddit",
  "leaderboard_posters_subreddit": "AskReddit",
  "leaderboard_commenters_subreddit": "AskReddit"
}' |
apify call red_crawler/reddit-subreddits-v2 --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Subreddits V2 — Info, Rules, Wiki, Leaderboard (16)",
        "description": "Full subreddit toolkit: ID, rules, access info, type, channels, flairs, emojis, style/widgets, highlights, status, wiki + 5 bearer ops (access eligibility, settings, post requirements, top posters, top commenters).",
        "version": "0.4",
        "x-build-id": "yd4CWkhrzuub7yAPX"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/red_crawler~reddit-subreddits-v2/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-red_crawler-reddit-subreddits-v2",
                "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/red_crawler~reddit-subreddits-v2/runs": {
            "post": {
                "operationId": "runs-sync-red_crawler-reddit-subreddits-v2",
                "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/red_crawler~reddit-subreddits-v2/run-sync": {
            "post": {
                "operationId": "run-sync-red_crawler-reddit-subreddits-v2",
                "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": [
                    "endpoint"
                ],
                "properties": {
                    "endpoint": {
                        "title": "What to fetch",
                        "enum": [
                            "id",
                            "rules",
                            "access_info",
                            "type",
                            "channels",
                            "flairs",
                            "emojis",
                            "style",
                            "highlights",
                            "status",
                            "access_eligibility",
                            "settings",
                            "post_requirements",
                            "wiki",
                            "leaderboard_posters",
                            "leaderboard_commenters"
                        ],
                        "type": "string",
                        "description": "Choose which subreddit lookup to run.",
                        "default": "rules"
                    },
                    "id_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "rules_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "access_info_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "type_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "channels_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "flairs_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "emojis_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "style_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "highlights_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "status_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "access_eligibility_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "settings_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "post_requirements_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "wiki_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "wiki_page": {
                        "title": "Wiki page",
                        "enum": [
                            "index",
                            "config/sidebar",
                            "config/description",
                            "config/submit_text",
                            "faq",
                            "rules",
                            "wiki"
                        ],
                        "type": "string",
                        "description": "Wiki page name. Common pages: index, config/sidebar, config/description, faq, rules. Use the dropdown for typical pages or enter any custom page slug.",
                        "default": "index"
                    },
                    "leaderboard_posters_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "leaderboard_posters_max_users": {
                        "title": "Max users",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of users to fetch (1-1000). Higher values use more API calls.",
                        "default": 100
                    },
                    "leaderboard_commenters_subreddit": {
                        "title": "Subreddit",
                        "type": "string",
                        "description": "Subreddit name (without r/)."
                    },
                    "leaderboard_commenters_max_users": {
                        "title": "Max users",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of users to fetch (1-1000). Higher values use more API calls.",
                        "default": 100
                    },
                    "credentialSource": {
                        "title": "Credential source",
                        "enum": [
                            "vault",
                            "manual"
                        ],
                        "type": "string",
                        "description": "Only used when the chosen endpoint requires a bearer (Access Eligibility, Settings, Post Requirements, Top Posters, Top Commenters). For all other endpoints leave the default — credentials are ignored. **Use saved account (vault)** loads your stored Token V2 + proxy from the **reddit-vault** actor — only the 'Saved account name' field is used. **Paste Token V2 + proxy** uses the values you paste below.",
                        "default": "vault"
                    },
                    "accountName": {
                        "title": "Saved account name (used when source = vault)",
                        "pattern": "^[A-Za-z0-9_-]{1,32}$",
                        "maxLength": 32,
                        "type": "string",
                        "description": "The name you used in the **reddit-vault** actor when you stored this account. Your Token V2 + proxy load automatically from the vault. Ignored when 'Credential source' = manual."
                    },
                    "bearer": {
                        "title": "Token V2 (used when source = manual)",
                        "type": "string",
                        "description": "Your Reddit `token_v2` cookie value (`eyJ...`). Lifetime ~24 h. Encrypted at rest by Apify. Ignored when 'Credential source' = vault."
                    },
                    "proxy": {
                        "title": "Proxy (used when source = manual)",
                        "type": "string",
                        "description": "Proxy in `ip:port:user:pass` format. MUST be the same IP that originally minted the Token V2. Ignored when 'Credential source' = vault."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
