reddit-fetch
Qué hace
Esta skill obtiene contenido de Reddit usando una sesión de navegador, ya que Reddit suele bloquear el acceso automatizado. Es para personas que investigan un tema que se debate en Reddit.
Cuándo usarla
- ✓Cuando quieres que tu agente lea un hilo o un subreddit de Reddit para investigar.
- ✓Cuando un enlace de Reddit devuelve un error de bloqueo o 403.
- ✓Cuando quieres saber qué piensan los usuarios de Reddit sobre un producto o un tema.
Link de la skill
https://github.com/ykdojo/claude-code-tips/blob/main/skills/reddit-fetch/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Lee este hilo de Reddit y dime qué opina la gente sobre el nuevo portátil.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La skill primero llega a Reddit a través de una redirección de un buscador, lo que permite que la sesión del navegador cargue los datos de Reddit. Después lee las publicaciones y los comentarios a partir de esos datos.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
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.
mcp__playwright__browser_navigatetohttps://html.duckduckgo.com/html/?q=site:reddit.com/r/SUBREDDIT+YOUR+QUERY- Grab the first result's full href - it's a DDG redirect that includes a
ruttoken (https://duckduckgo.com/l/?uddg=...&rut=...). The token is required; navigating to the bare/l/?uddg=without it 400s.() => document.querySelector('.result__a')?.href browser_navigateto that full redirect href. It lands on a realwww.reddit.compage (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.
browser_navigateto e.g.https://www.reddit.com/r/SUBREDDIT/search.json?q=QUERY&restrict_sr=on&sort=new&t=week&limit=25browser_evaluate, always wrapped in try/catch (returndocument.body.innerText.slice(0,200)on failure so you can see a challenge page if the session lapsed - just re-do the hop):() => { 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); } }- For a thread, navigate to
.../comments/POST_ID.json?limit=30&sort=topand parsedata[0](post) anddata[1].data.children(comments).
JSON shapes (same for browser and curl)
# 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[].datahastitle,score,num_comments,author,id. - Threads:
[0].data.children[0].datais the post;[1].data.children[](filterkind == "t1") are comments withauthor,score,body, and nestedrepliesof 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
shredditDOM - it returns more comments than.json?limit=:() => ({ 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 /
.jsonURL 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.
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.jso
Preguntas frecuentes
¿Por qué hace falta un paso con el buscador?
Reddit bloquea el acceso automatizado directo, así que llegar a través de un resultado de búsqueda permite que la sesión del navegador cargue los datos.
¿Qué herramienta usa?
Usa un navegador Playwright para cargar las páginas de Reddit y sus datos.
¿Siempre funciona?
No siempre. Las reglas de bloqueo de Reddit cambian, así que el método puede no funcionar en todos los casos.
Detalles
Descripción original del autor
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.
repo: ykdojo/claude-code-tips
Popularidad
- Estrellas en GitHub
- 10 mil
- Posición en el ranking
- #11904
- Licencia
- —
- Actualizada
- 25/9/2026
Comentarios
- …
Más skills de este repositorio
gha
10 milAyuda a tu agente a descubrir por qué falló un flujo de trabajo de GitHub Actions y si el mismo trabajo sigue fallando.
half-clone
10 milAyuda a tu agente a copiar la segunda mitad de un chat largo en una sesión nueva, gastando menos tokens y conservando tu trabajo reciente.
handoff
10 milAyuda a tu agente a redactar un documento de traspaso para que un chat nuevo retome tu proyecto con objetivos, avances y próximos pasos claros.
hn-summarize
10 milAyuda a tu agente a resumir las historias más destacadas de Hacker News, o una historia y sus comentarios, usando los datos oficiales de Hacker News.
Skills parecidas
graincrawl
394 milPermite que tu agente busque tus notas y transcripciones guardadas de reuniones de Granola, revise qué tan recientes son y las cuente en un periodo.
notcrawl
394 milPermite que tu agente busque en una copia guardada de tu espacio de Notion, consulte páginas y bases de datos y exporte páginas a archivos Markdown.
knowledge-entities
394 milAyuda a tu agente a identificar personas, empresas y proyectos, y después a redactar páginas de perfil con fuentes en tu bóveda de Knowledge.