For AI agents: a documentation index is available at /llms.txt
Skip to main content

Scrape Reddit posts

Extract post titles, scores, comment counts, and links from any subreddit.

Prerequisites

Steps

Reddit's feed is fully JavaScript-rendered and detects automated requests, so a plain HTTP fetch returns no useful data. If you only need basic post data, Reddit's JSON API (reddit.com/r/{subreddit}.json) is simpler and doesn't require a browser. Use the browser approach when you need data the API doesn't expose, want to avoid API rate limits, or are scraping user profiles and comment threads.

The examples below target r/programming and route through stealth mode and a residential proxy to bypass Reddit's fingerprinting and rate limiting.

Selector stability

Reddit updates its markup periodically. If shreddit-post stops returning results or attributes come back null, inspect the live page with browser DevTools to find the current element and attribute names.

Use the Browserless MCP server to scrape posts from Reddit from any MCP-compatible AI agent (Claude Desktop, Cursor, Windsurf, ChatGPT, etc.).

1. Connect the MCP server

Send this prompt to your AI agent to install the Browserless MCP server:

Go to https://github.com/browserless/browserless-mcp/blob/main/install.md
and follow the instructions to install the Browserless MCP server
for my client.

2. Scrape Reddit

Use browserless_smartscraper. It handles Reddit's dynamic content and bot protection automatically.

Use the browserless_smartscraper tool to scrape the top posts
from https://www.reddit.com/r/programming
and return the results as markdown

Next steps