Reddit Fetch logo

Reddit Fetch

CommunityPopular
ykdojo
reddit-fetch

Fetch content from Reddit via its JSON API using a browser session (DuckDuckGo-hop unlock). Use when accessing Reddit URLs, researching topics on Reddit, or when Reddit returns 403/blocked errors.

Overview

Publisherykdojo
Repositoryclaude-code-tips
Skill namereddit-fetch
Stars
10.1K
Forks
815
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by ykdojo on GitHub. Read the source before you install it.

Installation

Install the Reddit Fetch AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ykdojo/claude-code-tips.git /tmp/claude-code-tips
mkdir -p .claude/skills
cp -r /tmp/claude-code-tips/skills/reddit-fetch .claude/skills/reddit-fetch
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Reddit Fetch in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Reddit Fetch on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Reddit Fetch is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Reddit Fetch

Reddit's public JSON API works by appending .json to any Reddit URL — but Reddit now hard-blocks automated access. curl 403s essentially every time (host AND container, regardless of User-Agent), and even a cold Playwright navigation to reddit.com hits a "You've been blocked by network security" challenge page. The reliable method is to arrive at Reddit through a DuckDuckGo result redirect: that sets a Reddit session cookie which unlocks direct .json access for the rest of the browser session.

Primary method: the DuckDuckGo-hop unlock

Step 1 - the DDG hop. Do this once per session before any .json fetch.

  1. mcp__playwright__browser_navigate to https://html.duckduckgo.com/html/?q=site:reddit.com/r/SUBREDDIT+YOUR+QUERY
  2. Grab the first result's full href - it's a DDG redirect that includes a rut token (https://duckduckgo.com/l/?uddg=...&rut=...). The token is required; navigating to the bare /l/?uddg= without it 400s.
    js
    () => document.querySelector('.result__a')?.href
  3. browser_navigate to that full redirect href. It lands on a real www.reddit.com page (title = the post/subreddit title, not "Blocked") and sets the session cookie. The result doesn't have to be the exact thread you want - landing on any real Reddit page sets the cookie.

If Playwright errors with Browser is already in use, a stale instance is holding the profile - pkill -f ms-playwright-mcp (or the profile dir named in the error) and retry.

Step 2 - direct .json now works. For the rest of the session, navigate Playwright straight to any .json URL and JSON.parse(document.body.innerText). Use www.reddit.com (not old.reddit.com) for browser navigation. Full recency sorting (sort=new&t=week) is available.

  1. browser_navigate to e.g. https://www.reddit.com/r/SUBREDDIT/search.json?q=QUERY&restrict_sr=on&sort=new&t=week&limit=25
  2. browser_evaluate, always wrapped in try/catch (return document.body.innerText.slice(0,200) on failure so you can see a challenge page if the session lapsed - just re-do the hop):
    js
    () => {
      try {
        const data = JSON.parse(document.body.innerText);
        return data.data.children.map(c => ({
          t: c.data.title, s: c.data.score, n: c.data.num_comments, id: c.data.id
        }));
      } catch (e) { return document.body.innerText.slice(0, 200); }
    }
  3. For a thread, navigate to .../comments/POST_ID.json?limit=30&sort=top and parse data[0] (post) and data[1].data.children (comments).

JSON shapes (same for browser and curl)

text
# Listing - swap hot for new/top/rising; for top add &t=day|week|month|year|all
/r/SUBREDDIT/hot.json?limit=15
# Post + comments - JSON array where [0]=post, [1]=comment tree
/r/SUBREDDIT/comments/POST_ID.json?limit=20
# Search within a subreddit
/r/SUBREDDIT/search.json?q=QUERY&restrict_sr=on&sort=new&limit=15
  • Listings: .data.children[].data has title, score, num_comments, author, id.
  • Threads: [0].data.children[0].data is the post; [1].data.children[] (filter kind == "t1") are comments with author, score, body, and nested replies of the same shape.
  • Truncate long comment bodies (e.g. body.slice(0, 300) in JS, .body[:300] in jq 1.7+) to keep output readable.

Fallbacks

  • More comments per thread: load the rendered thread page (after the hop) and scrape the shreddit DOM - it returns more comments than .json?limit=:
    js
    () => ({
      title: document.querySelector('shreddit-post')?.getAttribute('post-title'),
      comments: [...document.querySelectorAll('shreddit-comment')].map(c => ({
        author: c.getAttribute('author'),
        score:  c.getAttribute('score'),
        text:   c.querySelector('.md')?.innerText
      }))
    })
  • No Playwright at all: use Claude for Chrome to open the thread / .json URL and read it off the page.
  • curl (last resort, expect 403): direct curl with a browser User-Agent used to work and is faster when it does, but it now gets 403'd essentially always - changing the UA doesn't help. Only worth a single quick try if you're already shelling out and a browser isn't available; on 403, go straight to the DDG hop.
    bash
    UA="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
    curl -s -L -o /tmp/reddit_result.txt -w "%{http_code}" -H "User-Agent: $UA" \
      'https://old.reddit.com/r/SUBREDDIT/hot.json?limit=15'
    jq -r '.data.children[] | .data | "\(.title)\n   \(.score) pts | \(.num_comments) comments | u/\(.author) | id: \(.id)\n"' /tmp/reddit_result.txt
    Fetch to a temp file (-o) then parse; -w "%{http_code}" prints the status; -L follows redirects; single-quote the URL so the shell doesn't eat &.

Rate limiting

Reddit rate-limits aggressively even once you're unblocked:

  • Don't fire parallel requests - run them sequentially with sleep 2/sleep 3 (or brief pauses between navigations). Fetch one listing, parse it, then fetch threads one at a time.
  • Empty response (0 bytes): wait 3-5s and retry. HTTP 429: back off 10-15s. A challenge page mid-session means the cookie lapsed - re-do the DDG hop.

Frequently asked questions

What does the Reddit Fetch AI skill do?

Fetch content from Reddit via its JSON API using a browser session (DuckDuckGo-hop unlock). Use when accessing Reddit URLs, researching topics on Reddit, or when Reddit returns 403/blocked errors.

Why use Reddit Fetch on TypingMind?

Because you install it once and use it with any model. Reddit Fetch is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Reddit Fetch in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ykdojo/claude-code-tips/tree/main/skills/reddit-fetch. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Reddit Fetch?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Reddit Fetch?

As many as you like. As long as a model supports skills, you can use Reddit Fetch with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Reddit Fetch AI skill free?

It is published on GitHub by ykdojo. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇