home / skills / openclaw / skills / search-reddit

search-reddit skill

/skills/arkaydeus/search-reddit

This skill searches Reddit in real time using OpenAI web_search, enriching results with engagement and top comments for timely discussions.

npx playbooks add skill openclaw/skills --skill search-reddit

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

Files (5)
SKILL.md
2.1 KB
---
name: search-reddit
description: Search Reddit in real time using OpenAI web_search with enrichment (engagement + top comments). Use when you need recent Reddit threads, subreddit-filtered results, or quick link lists.
---

# Search Reddit

Real-time Reddit search powered by OpenAI web_search with post enrichment (score, comments, and top comment excerpts).

## Setup

Set your OpenAI API key:

```bash
clawdbot config set skills.entries.search-reddit.apiKey "sk-YOUR-KEY"
```

Or use environment variable:
```bash
export OPENAI_API_KEY="sk-YOUR-KEY"
```

You can also set a shared key:
```bash
clawdbot config set skills.entries.openai.apiKey "sk-YOUR-KEY"
```

## Commands

### Basic Search
```bash
node {baseDir}/scripts/search.js "Claude Code tips"
```

### Filter by Time
```bash
node {baseDir}/scripts/search.js --days 7 "AI news"
```

### Filter by Subreddit
```bash
node {baseDir}/scripts/search.js --subreddits machinelearning,openai "agents"
node {baseDir}/scripts/search.js --exclude bots "real discussions"
```

### Output Options
```bash
node {baseDir}/scripts/search.js --json "topic"        # JSON results
node {baseDir}/scripts/search.js --compact "topic"     # Minimal output
node {baseDir}/scripts/search.js --links-only "topic"  # Only Reddit links
```

## Example Usage in Chat

**User:** "Search Reddit for what people are saying about Claude Code"
**Action:** Run search with query "Claude Code"

**User:** "Find posts in r/OpenAI from the last week"
**Action:** Run search with --subreddits openai --days 7

**User:** "Get Reddit links about Kimi K2.5"
**Action:** Run search with --links-only "Kimi K2.5"

## How It Works

Uses OpenAI Responses API (`/v1/responses`) with the `web_search` tool:
- Allowed domain: `reddit.com`
- Enriches each thread by fetching Reddit JSON (`/r/.../comments/.../.json`)
- Updates the date from `created_utc` and filters to last N days
- Computes engagement and top comment excerpts

## Environment Variables

- `OPENAI_API_KEY` - OpenAI API key (required)
- `SEARCH_REDDIT_MODEL` - Model override (default: gpt-5.2)
- `SEARCH_REDDIT_DAYS` - Default days to search (default: 30)

Overview

This skill provides real-time Reddit search powered by OpenAI web_search with automatic enrichment of results including engagement metrics and top-comment excerpts. It returns filtered, timestamped threads and can produce compact lists, JSON output, or links-only responses for quick consumption. Use it to find recent conversations, surface high-engagement posts, and gather direct Reddit links fast.

How this skill works

The skill issues web_search requests restricted to reddit.com and then fetches each thread's Reddit JSON to enrich results with created_utc, score, comment counts, and top comment snippets. It applies time filters (last N days) and can restrict or exclude specific subreddits. Output modes include full enriched entries, compact summaries, JSON, or links-only lists.

When to use it

  • You need the latest Reddit discussions on a topic or breaking community conversations.
  • You want results filtered to a timeframe (e.g., last 7 days) or specific subreddits.
  • You need link lists of relevant Reddit threads for research, reporting, or archival.
  • You want quick assessment of engagement and top comment context for each thread.
  • You need machine-readable JSON for downstream processing or automation.

Best practices

  • Set an OpenAI API key via environment variable or shared config before running searches.
  • Use subreddit filters to reduce noise when your query is broad.
  • Start with a moderate days window (7–30) to balance recency and coverage.
  • Use --links-only for rapid link collection and --json for automated workflows.
  • Combine compact output with manual review for sensitive or moderated topics.

Example use cases

  • Research what Redditors are saying about a new AI tool across r/MachineLearning and r/OpenAI.
  • Compile recent user reports and top comments about a software bug for triage.
  • Generate a quick list of threads to include as links in a newsletter or report.
  • Monitor community reaction to a product announcement by filtering to the last 24–72 hours.
  • Pull JSON-formatted thread data for archival or integration into a monitoring dashboard.

FAQ

What credentials are required to run searches?

An OpenAI API key is required and can be provided via OPENAI_API_KEY or a configured shared key.

Can I limit results to specific subreddits or exclude some?

Yes. You can include --subreddits to restrict results or --exclude to omit specified subreddits.