> For the complete documentation index, see [llms.txt](https://docs.membercounter.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.membercounter.app/counters-reference/reddit.md).

# Reddit

Retrieve the title of a subreddit along with the total number of members and the count of members currently online.

The Reddit counter reads one subreddit and returns its member count, how many members are online, or the subreddit title.

**Availability:** every bot, including the free public bot. It needs no API key and no extra configuration.

<figure><img src="https://1582170640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lu2S5r7lKtu4IK5ucu9%2Fuploads%2Fgit-blob-b5de264c55bea10ae5c582188314cbf9a136daa7%2Fcounter-reddit-options.png?alt=media" alt="Reddit options"><figcaption><p>The Reddit counter options in the template editor</p></figcaption></figure>

## Options

| Option             | What it does                                                                            | Notes                                                                                                                                                             |
| ------------------ | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Display**        | Picks what the counter outputs: **Members**, **Members online** or **Subreddit title**. | Starts on **Members**. Does not accept a nested counter.                                                                                                          |
| **Subreddit name** | The subreddit to look up.                                                               | Type the bare name, for example `memes`. It also accepts a [nested counter](/using-the-dashboard/nested-counters.md), which has to return a valid subreddit name. |

{% hint style="warning" %}
**Subreddit name** takes the bare name and nothing else. `memes` works; `r/memes` and `https://www.reddit.com/r/memes` do not.
{% endhint %}

## What it returns

| **Display**         | Value                                                                                   |
| ------------------- | --------------------------------------------------------------------------------------- |
| **Members**         | How many members the subreddit has.                                                     |
| **Members online**  | How many members Reddit reports as active right now.                                    |
| **Subreddit title** | The title of the subreddit, the line under its name on Reddit. It is not the `r/` name. |

## Formatting

**Members** and **Members online** are numbers, so the **Format settings** panel applies. **Subreddit title** is text, and formatting does nothing to it. See [Formatting counters](/using-the-dashboard/customizing-counters.md).

## Refresh and caching

The bot keeps each subreddit's data for 15 minutes, so a channel can show a value up to 15 minutes old. More in [How counters update](/using-the-dashboard/how-counters-update.md).

## Examples

{% tabs %}
{% tab title="Members" %}
**Display** = **Members**, **Subreddit name** = `memes`, **Use compact notation** = **Yes**.

A subreddit with 1,200,000 members shows as `1.2M`.
{% endtab %}

{% tab title="Members online" %}
**Display** = **Members online**, **Subreddit name** = `AskReddit`.
{% endtab %}
{% endtabs %}

<figure><img src="https://1582170640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lu2S5r7lKtu4IK5ucu9%2Fuploads%2Fgit-blob-7069ae2ad7fa1d0b50696fea6d8d3ecbc3f69b07%2Fcounter-reddit-example-members.png?alt=media" alt="A voice channel showing a subreddit member count"><figcaption><p>A voice channel driven by a Reddit counter</p></figcaption></figure>

## Errors

| Message                                                | What to do                                                                         |
| ------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| `A subreddit must be provided for the Reddit counter.` | Fill in **Subreddit name**, or check that the nested counter in it returns a name. |

A subreddit that is private, banned or misspelled fails with a generic error instead. Check the spelling first, then see [Troubleshooting](/using-the-dashboard/troubleshooting.md).

<details>

<summary>Technical details</summary>

* Evaluator: `packages/services/src/DataSource/DataSourceEvaluator/evaluators/reddit.ts`.
* One `GET https://www.reddit.com/r/<subreddit>/about.json` per lookup, with a 5 second timeout. The value of **Subreddit name** is put straight into that address.
* The three values come from `data.subscribers`, `data.active_user_count` and `data.title` of that response. One request fills all three, so they always move together.
* Cached in Redis for 15 minutes under the key `1:9:<subreddit>`. The key holds no server id, so every server watching the same subreddit shares one fetch.
* Only successful lookups are cached. A failing counter retries on every channel update.
* The update job runs every 10 minutes on the public bot and every 5 minutes on every other bot, on its own clock. In the worst case the text on the channel is about 25 minutes behind Reddit, 20 minutes on a 5 minute bot.
* An unset **Display** evaluates as **Members**.
* `A subreddit must be provided for the Reddit counter.` (`REDDIT_MISSING_SUBREDDIT`): **Subreddit name** is empty, or the nested counter in it returned nothing.
* In Discord the same error reads `A subreddit must be provided for the Reddit coutner.`; the typo is in the bot's en-US string, the dashboard string is correct.
* A private, banned, quarantined or misspelled subreddit, and Reddit rate limiting the bot, make the response fail validation. There is no error name for that case, so the dashboard shows a generic failure and no value is cached.
* `The evaluation took too long and timed out.` (`EVALUATION_TIMEOUT`): one counter in the template took more than 60 seconds.
* No environment variables. The evaluator never checks `isPremium`, so the counter also runs on a self-hosted bot with an empty `.env`.

</details>
