home / skills / resciencelab / opc-skills / reddit

reddit skill

/skills/reddit

This skill retrieves posts, comments, subreddit data, and user profiles from Reddit using the public JSON API to inform research and content discovery.

npx playbooks add skill resciencelab/opc-skills --skill reddit

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

Files (9)
SKILL.md
2.0 KB
---
name: reddit
description: Search and retrieve content from Reddit. Get posts, comments, subreddit info, and user profiles via the public JSON API. Use when user mentions Reddit, a subreddit, or r/ links.
---

# 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**:
```bash
cd <skill_directory>
python3 scripts/get_posts.py python --limit 3
```

## Commands

All commands run from the skill directory.

### Subreddit Posts
```bash
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
```bash
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
```bash
python3 scripts/get_subreddit.py python
python3 scripts/get_subreddit.py ClaudeAI
```

### Post & Comments
```bash
python3 scripts/get_post.py abc123                       # Get post by ID
python3 scripts/get_post.py abc123 --comments 50         # With more comments
```

### User Profile
```bash
python3 scripts/get_user.py spez
python3 scripts/get_user.py spez --posts 10              # Include recent posts
```

## Sort Options

| Sort | Description | Time Options |
|------|-------------|--------------|
| `hot` | Trending posts (default) | - |
| `new` | Latest posts | - |
| `top` | Highest voted | hour, day, week, month, year, all |
| `rising` | Gaining traction | - |
| `controversial` | Mixed votes | hour, day, week, month, year, all |

## API Info
- **Method**: Public JSON API (no auth needed)
- **Trick**: Append `.json` to any Reddit URL
- **Rate Limit**: 100 requests/minute
- **Docs**: https://www.reddit.com/dev/api

Overview

This skill lets you search and retrieve content from Reddit using the public JSON API without requiring an API key. It fetches subreddit details, posts, comments, and user profiles and supports common Reddit sorting and time filters. Use it to quickly surface discussion, evidence, or community sentiment for research, content, or moderation tasks.

How this skill works

The skill appends .json to Reddit URLs and issues unauthenticated HTTP requests to fetch structured JSON for subreddits, posts, comments, and user profiles. It supports sorting (hot, new, top, rising, controversial) and time ranges for top/controversial queries, plus keyword and subreddit-scoped searches. Rate limits are respected (about 100 requests/minute) and responses are parsed into concise results for downstream use.

When to use it

  • You need recent posts or trending discussions from a subreddit (e.g., r/python).
  • You want to search Reddit for keyword mentions or community reactions.
  • You need post details and comments for research, moderation, or content sourcing.
  • You want basic user profile info and recent activity without OAuth.
  • You need to gather community sentiment or examples for SEO and content planning.

Best practices

  • Respect rate limits: batch requests and add delays to avoid hitting 100 req/min.
  • Use sorting and time filters to narrow results (e.g., top + week for evergreen content).
  • Limit comment depth and pagination to keep responses compact and fast.
  • Sanitize and deduplicate results when aggregating from multiple subreddits or searches.
  • Cache frequent queries to reduce requests and improve responsiveness.

Example use cases

  • Fetch hot posts from a niche subreddit to find topics for new articles or videos.
  • Search Reddit for user experiences about a product or feature to inform UX decisions.
  • Retrieve a post and its top comments to use as source material for a report or quote.
  • Collect subreddit stats and descriptions for competitor or community analysis.
  • Pull recent posts from a user to review activity patterns or contributions.

FAQ

Do I need an API key or OAuth credentials?

No. The skill uses Reddit's public JSON endpoints, which are accessible without authentication for basic reads.

How do I control sorting and time ranges?

Use the sort parameter (hot, new, top, rising, controversial) and, for top/controversial, specify a time range like hour, day, week, month, year, or all.

What are common rate limits and how should I handle them?

Plan for roughly 100 requests per minute. Batch requests, implement backoff, and cache results to avoid throttling.