# reddit-fetch

This skill pulls posts and comments off Reddit through its JSON API when automated access gets blocked. Handy for research threads your agent can't reach.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 10273
- Author: ykdojo
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ykdojo/claude-code-tips/tree/HEAD/skills/reddit-fetch/SKILL.md
- Updated: 2026-09-25
- HTML: https://affpapa.org/en/nevibecode/skills/reddit-fetch

## What it does

Append `.json` to any Reddit URL and you get structured data — in theory. In practice Reddit blocks bots: `curl` returns 403 nearly every time regardless of User-Agent, and a fresh Playwright navigation to `reddit.com` lands on a network-security challenge. The skill's trick is arriving through a DuckDuckGo result redirect, which plants a Reddit session cookie and opens direct `.json` access for the rest of the browser session.

One hop per session. Search `html.duckduckgo.com` for `site:reddit.com/r/SUBREDDIT`, then grab the first result's full href — it carries a `rut` token, and the bare redirect URL without it returns 400. Navigating to that href lands on a real Reddit page and sets the cookie. After that, go straight to `search.json`, `hot.json` or `comments/POST_ID.json` and parse the body. Wrap the parse in try/catch: a lapsed session serves the challenge page instead of JSON, and you redo the hop.

Reddit throttles hard even once you're through, so fire requests one at a time with `sleep 2` or `sleep 3` between them. Zero-byte responses mean waiting 3–5 seconds; a 429 means backing off 10–15 seconds. If Playwright complains that the browser is already in use, `pkill -f ms-playwright-mcp` clears the stale profile. There's a fallback too — open the thread in a browser and read it off the rendered page.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ykdojo/claude-code-tips --skill reddit-fetch -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/reddit-fetch/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/reddit-fetch/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ykdojo/claude-code-tips --skill reddit-fetch -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/reddit-fetch/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ykdojo/claude-code-tips --skill reddit-fetch -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/reddit-fetch/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ykdojo/claude-code-tips reddit-fetch
```

2. **Manually: put the files in place**
- File: `.github/skills/reddit-fetch/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ykdojo/claude-code-tips --skill reddit-fetch -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ykdojo/claude-code-tips --path skills/reddit-fetch
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/reddit-fetch/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add ykdojo/claude-code-tips --skill reddit-fetch -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ykdojo/claude-code-tips/tree/HEAD/skills/reddit-fetch/SKILL.md

## When to use it
- pull a subreddit's newest posts from the past week
- collect a thread's comments including nested replies
- get around 403 errors when an agent hits reddit.com
- find discussions on a topic inside one subreddit
- read a thread when a plain browser visit hits a challenge page

## Example prompts
- Find this week's newest posts in r/programming and list titles with comment counts
- Fetch the comments on this Reddit thread, sort by score, trim long ones to 300 characters
- Reddit is returning 403 — go through DuckDuckGo and retry the fetch

## Similar
- [agent-browser](https://affpapa.org/en/nevibecode/skills/vercel-labs-agent-browser.md) — skill · 1200000 installs
- [webapp-testing](https://affpapa.org/en/nevibecode/skills/webapp-testing.md) — skill · 186758 installs
- [computer-use](https://affpapa.org/en/nevibecode/skills/computer-use.md) — skill · 239600 installs
- [browser-use](https://affpapa.org/en/nevibecode/skills/browser-use.md) — skill · 98200 installs
- [playwright-cli](https://affpapa.org/en/nevibecode/skills/playwright-cli.md) — skill · 195700 installs
- [last30days](https://affpapa.org/en/nevibecode/skills/last30days.md) — skill · 53000 installs

From the same set: [ykdojo/claude-code-tips](https://affpapa.org/en/nevibecode/by/ykdojo/claude-code-tips.md) — 4 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
