home / skills / openclaw / skills / reddit

reddit skill

This skill lets you browse, search, post, and moderate Reddit with optional OAuth, streamlining content management and community moderation.

npx playbooks add skill openclaw/skills --skill reddit

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
2.8 KB
---
name: reddit
description: Browse, search, post, and moderate Reddit. Read-only works without auth; posting/moderation requires OAuth setup.
metadata: {"clawdbot":{"emoji":"📣","requires":{"bins":["node"]}}}
---

# Reddit

Browse, search, post to, and moderate subreddits. Read-only actions work without auth; posting/moderation requires OAuth setup.

## Setup (for posting/moderation)

1. Go to https://www.reddit.com/prefs/apps
2. Click "create another app..."
3. Select "script" type
4. Set redirect URI to `http://localhost:8080`
5. Note your client ID (under app name) and client secret
6. Set environment variables:
   ```bash
   export REDDIT_CLIENT_ID="your_client_id"
   export REDDIT_CLIENT_SECRET="your_client_secret"
   export REDDIT_USERNAME="your_username"
   export REDDIT_PASSWORD="your_password"
   ```

## Read Posts (no auth required)

```bash
# Hot posts from a subreddit
node {baseDir}/scripts/reddit.mjs posts wallstreetbets

# New posts
node {baseDir}/scripts/reddit.mjs posts wallstreetbets --sort new

# Top posts (day/week/month/year/all)
node {baseDir}/scripts/reddit.mjs posts wallstreetbets --sort top --time week

# Limit results
node {baseDir}/scripts/reddit.mjs posts wallstreetbets --limit 5
```

## Search Posts

```bash
# Search within a subreddit
node {baseDir}/scripts/reddit.mjs search wallstreetbets "YOLO"

# Search all of Reddit
node {baseDir}/scripts/reddit.mjs search all "stock picks"
```

## Get Comments on a Post

```bash
# By post ID or full URL
node {baseDir}/scripts/reddit.mjs comments POST_ID
node {baseDir}/scripts/reddit.mjs comments "https://reddit.com/r/subreddit/comments/abc123/..."
```

## Submit a Post (requires auth)

```bash
# Text post
node {baseDir}/scripts/reddit.mjs submit yoursubreddit --title "Weekly Discussion" --text "What's on your mind?"

# Link post
node {baseDir}/scripts/reddit.mjs submit yoursubreddit --title "Great article" --url "https://example.com/article"
```

## Reply to a Post/Comment (requires auth)

```bash
node {baseDir}/scripts/reddit.mjs reply THING_ID "Your reply text here"
```

## Moderation (requires auth + mod permissions)

```bash
# Remove a post/comment
node {baseDir}/scripts/reddit.mjs mod remove THING_ID

# Approve a post/comment
node {baseDir}/scripts/reddit.mjs mod approve THING_ID

# Sticky a post
node {baseDir}/scripts/reddit.mjs mod sticky POST_ID

# Unsticky
node {baseDir}/scripts/reddit.mjs mod unsticky POST_ID

# Lock comments
node {baseDir}/scripts/reddit.mjs mod lock POST_ID

# View modqueue
node {baseDir}/scripts/reddit.mjs mod queue yoursubreddit
```

## Notes

- Read actions use Reddit's public JSON API (no auth needed)
- Post/mod actions require OAuth - run `login` command once to authorize
- Token stored at `~/.reddit-token.json` (auto-refreshes)
- Rate limits: ~60 requests/minute for OAuth, ~10/minute for unauthenticated

Overview

This skill lets you browse, search, post, and moderate Reddit from scripts or an agent. Read-only operations work without authentication; posting, replying, and moderation require OAuth credentials and a one-time login. It supports fetching posts, comments, searching subreddits or all of Reddit, and common moderation actions.

How this skill works

Read-only endpoints use Reddit's public JSON API so you can fetch hot/new/top posts and comments without credentials. For posting and moderation the skill uses Reddit OAuth: you create a script app, set client ID/secret and user credentials as environment variables, then run the login flow once to obtain a refreshable token. Rate limits differ for authenticated and unauthenticated requests.

When to use it

  • Fetch hot/new/top posts or comments for monitoring or analysis without signing in
  • Search within a subreddit or across Reddit for mentions, signals, or links
  • Automate posting or replying when you have OAuth credentials and want scheduled or programmatic submissions
  • Perform moderation tasks (remove/approve/sticky/lock) for subreddits where you have mod permissions
  • Archive or backup collections of posts and comments for research or compliance

Best practices

  • Use read-only mode for high-volume monitoring to avoid OAuth complexity
  • Set REDDIT_CLIENT_ID, REDDIT_CLIENT_SECRET, REDDIT_USERNAME, and REDDIT_PASSWORD in environment variables for posting/mod actions
  • Run the login flow once to create a stored token that auto-refreshes (stored at ~/.reddit-token.json)
  • Respect rate limits: roughly 60 req/min with OAuth and ~10 req/min unauthenticated
  • Limit queries with --limit and time filters to reduce bandwidth and avoid throttling

Example use cases

  • Collect the top posts in a subreddit for the past week as part of a weekly report
  • Search all of Reddit for mentions of a product or brand and pull matching post URLs and scores
  • Submit a scheduled announcement or link post to a community using OAuth credentials
  • Automatically reply to flagged comments or run moderation commands (remove/approve/lock) in a mod workflow
  • Pull full comment threads by post ID or URL for sentiment analysis or archival

FAQ

Do I need an account to read posts?

No. Read-only actions use Reddit's public JSON API and work without authentication.

How do I enable posting and moderation?

Create a script app on reddit.com/prefs/apps, set the redirect URI to http://localhost:8080, export client ID/secret and account credentials as environment variables, then run the login command once to authorize and store the token.