Get the FREE Ultimate OpenClaw Setup Guide →

reddit

Scanned
npx machina-cli add skill ReScienceLab/opc-skills/reddit --openclaw
Files (1)
SKILL.md
2.0 KB

Reddit Skill

Get posts, comments, subreddit info, and user profiles from Reddit via the public JSON API.

Prerequisites

No API key required! Reddit's public JSON API works without authentication.

Quick Check:

cd <skill_directory>
python3 scripts/get_posts.py python --limit 3

Commands

All commands run from the skill directory.

Subreddit Posts

python3 scripts/get_posts.py python --limit 20           # Hot posts (default)
python3 scripts/get_posts.py python --sort new --limit 20
python3 scripts/get_posts.py python --sort top --time week
python3 scripts/get_posts.py python --sort top --time all --limit 10

Search Posts

python3 scripts/search_posts.py "AI agent" --limit 20
python3 scripts/search_posts.py "MCP server" --subreddit ClaudeAI --limit 10
python3 scripts/search_posts.py "async python" --sort top --time year

Subreddit Info

python3 scripts/get_subreddit.py python
python3 scripts/get_subreddit.py ClaudeAI

Post & Comments

python3 scripts/get_post.py abc123                       # Get post by ID
python3 scripts/get_post.py abc123 --comments 50         # With more comments

User Profile

python3 scripts/get_user.py spez
python3 scripts/get_user.py spez --posts 10              # Include recent posts

Sort Options

SortDescriptionTime Options
hotTrending posts (default)-
newLatest posts-
topHighest votedhour, day, week, month, year, all
risingGaining traction-
controversialMixed voteshour, day, week, month, year, all

API Info

Source

git clone https://github.com/ReScienceLab/opc-skills/blob/main/skills/reddit/SKILL.mdView on GitHub

Overview

Reddit Skill lets you search and retrieve content from Reddit using the public JSON API. It can fetch posts, comments, subreddit information, and user profiles without authentication, making it easy to surface Reddit data in apps or assistants. Use it when a user mentions Reddit, a subreddit, or r/ links.

How This Skill Works

The skill uses Reddit's public endpoints and .json responses. Use provided scripts like get_posts.py, get_subreddit.py, get_post.py, search_posts.py, and get_user.py to pull data; no API key is required, but respect the 100 requests/minute rate limit. Outputs are returned in JSON for easy parsing.

When to Use It

  • When a user mentions Reddit, a subreddit, or r/ links
  • When you need hot, new, or top posts from a specific subreddit
  • When you want to search Reddit posts by keywords
  • When you need subreddit information or a user profile
  • When you need a post and its comments or a user's recent posts

Quick Start

  1. Step 1: cd <skill_directory>
  2. Step 2: python3 scripts/get_posts.py python --limit 3
  3. Step 3: Parse and display the returned JSON (titles, authors, upvotes)

Best Practices

  • Specify subreddit and sort options to minimize irrelevant results
  • Respect the public API rate limit (up to 100 requests per minute)
  • Use .json endpoints or the provided scripts to fetch structured data
  • Limit results with --limit to keep responses concise and fast
  • Validate and gracefully handle missing fields in post/comment data

Example Use Cases

  • Fetch hot posts from the python subreddit: python3 scripts/get_posts.py python --limit 20
  • Search for posts containing AI agent: python3 scripts/search_posts.py AI agent --limit 20
  • Get info about a subreddit: python3 scripts/get_subreddit.py ClaudeAI
  • Retrieve a post and its top 50 comments: python3 scripts/get_post.py abc123 --comments 50
  • View a user profile with recent posts: python3 scripts/get_user.py spez --posts 10

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers