
Pull posts, comments, subreddit info, and user profiles from Reddit’s public JSON API for research without OAuth setup.
Overview
Reddit is an agent skill most often used in Idea (also Validate, Grow) that retrieves public Reddit posts, comments, and subreddit data via the JSON API and bundled Python scripts.
Install
npx skills add https://github.com/resciencelab/opc-skills --skill redditWhat is this skill?
- Read-only public Reddit JSON API with a fixed User-Agent—no credentials for browsing
- CLI scripts such as get_post with configurable comment depth and optional JSON output
- Covers posts, comments, subreddit info, and user profiles per skill manifest
- Python helpers (`reddit_api`, `api_get`) centralize HTTP for agent-driven queries
- MIT-licensed opc-skills package with `./scripts/` command entrypoints
Adoption & trust: 2.6k installs on skills.sh; 920 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need real subreddit threads and comments for positioning but manual copying or vague web search misses structure and comment depth.
Who is it for?
Indie builders doing audience research, competitive thread mining, or content ideation from named subreddits and post IDs.
Skip if: Posting, moderation, private subreddits requiring auth, or high-volume scraping that violates Reddit rate limits and policies.
When should I use this skill?
User asks to search Reddit, fetch a post by ID, read comments, or inspect subreddit or user public profiles.
What do I get? / Deliverables
You get scripted, repeatable fetches of posts and comments (optionally as JSON) to feed audience notes, validation evidence, or content calendars.
- Post and comment summaries or JSON payloads
- Subreddit or profile snippets suitable for research notes
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf on Idea because Reddit retrieval is most valuable early for audience language and community pain before you lock scope. Audience subphase fits listening to subreddits and threads where potential users already discuss problems and alternatives.
Where it fits
Pull complaint threads about incumbent tools before you define differentiators.
Mine exact phrases from comments to sharpen landing page headlines.
Retrieve top posts in a niche subreddit to outline an FAQ or blog series.
How it compares
Integration skill with CLI scripts—not an MCP server and not a hosted Reddit analytics dashboard.
Common Questions / FAQ
Who is reddit for?
Solo builders and small teams who want agent-driven Reddit reads for research, validation quotes, or growth content without building OAuth first.
When should I use reddit?
During Idea audience and competitor listening, Validate scope checks against real threads, or Grow content planning when you need fresh post and comment payloads.
Is reddit safe to install?
Scripts use public read endpoints and network calls; review the Security Audits panel on this Prism page and audit `./scripts/` before running in CI or with secrets on disk.
SKILL.md
READMESKILL.md - Reddit
{ "name": "reddit", "version": "1.0.0", "description": "Search and retrieve content from Reddit. Get posts, comments, subreddit info, and user profiles via the public JSON API.", "author": { "name": "ReScienceLab" }, "homepage": "https://github.com/ReScienceLab/opc-skills/tree/main/skills/reddit", "repository": "https://github.com/ReScienceLab/opc-skills", "license": "MIT", "keywords": [ "reddit", "subreddit", "r/" ], "skills": [ "./SKILL.md" ], "commands": [ "./scripts/" ] } #!/usr/bin/env python3 """ Reddit API - No credentials needed for public read-only access. Just need a proper User-Agent header. """ USER_AGENT = "DailyTasks-Reddit-Skill/1.0 (by /u/droid-assistant)" def get_user_agent() -> str: """Get User-Agent for Reddit API requests""" return USER_AGENT #!/usr/bin/env python3 """ Get a post with comments Usage: python3 scripts/get_post.py POST_ID --comments 20 """ import argparse import json from reddit_api import api_get, clean_post, print_post, print_comments_list def main(): parser = argparse.ArgumentParser(description="Get Reddit post with comments") parser.add_argument("post_id", help="Post ID (e.g., abc123)") parser.add_argument("--comments", "-c", type=int, default=20, help="Max comments") parser.add_argument("--json", "-j", action="store_true", help="Output as JSON") args = parser.parse_args() # Reddit returns [post_listing, comments_listing] data = api_get(f"comments/{args.post_id}", {"limit": args.comments}) if not isinstance(data, list) or len(data) < 2: print(f"Post not found: {args.post_id}") return if args.json: print(json.dumps(data, indent=2)) return # First element is post listing post_listing = data[0].get("data", {}).get("children", []) if post_listing: post = clean_post(post_listing[0]) print_post(post) # Second element is comments listing comments_listing = data[1].get("data", {}).get("children", []) if comments_listing: print(f"---") print_comments_list(comments_listing[:args.comments]) if __name__ == "__main__": main() #!/usr/bin/env python3 """ Get posts from a subreddit Usage: python3 scripts/get_posts.py python --sort hot --limit 20 """ import argparse from reddit_api import api_get, print_posts_list, print_pagination def main(): parser = argparse.ArgumentParser(description="Get subreddit posts") parser.add_argument("subreddit", help="Subreddit name (without r/)") parser.add_argument("--sort", "-s", choices=["hot", "new", "top", "rising", "controversial"], default="hot", help="Sort method (default: hot)") parser.add_argument("--time", "-t", choices=["hour", "day", "week", "month", "year", "all"], help="Time filter for top/controversial") parser.add_argument("--limit", "-l", type=int, default=25, help="Max posts (max 100)") parser.add_argument("--after", "-a", help="Pagination cursor") args = parser.parse_args() path = f"r/{args.subreddit}/{args.sort}" params = { "limit": min(args.limit, 100), "after": args.after, } if args.time and args.sort in ["top", "controversial"]: params["t"] = args.time data = api_get(path, params) listing = data.get("data", {}) posts = listing.get("children", []) label = f"r/{args.subreddit}/{args.sort}" if args.time: label += f"/{args.time}" print_posts_list(posts, label) print_pagination(listing) if __name__ == "__main__": main() #!/usr/bin/env python3 """ Get subreddit info Usage: python3 scripts/get_subreddit.py python """ import argparse import json from reddit_api import api_get, clean_subreddit, print_subreddit def main(): parser = argparse.ArgumentParser(description="Get subreddit info") parser.add_argument("subreddit", help="Subreddit name (without r/)") parser.add_argument("--j