How to Scrape Reddit Data in 2026: Public JSON API vs Scrapers
Reddit is one of the richest sources of real-time opinions, trends, and discussions on the internet. Here's how to extract that data programmatically in 2026. Method 1: Reddit's Public JSON API Reddit exposes a JSON version of almost every page. Just append .json to any URL: curl "https://www.reddit.com/r/programming/hot.json?limit=10" \ -H "User-Agent: MyBot/1.0" This returns posts with title, score, author, URL, created timestamp, and comment count. import requests headers = { " User-Agent " : " DataCollector/1.0 " } url = " https://www.reddit.com/r/webdev/hot.json?limit=25 " response = requests . get ( url , headers = headers ) data = response . json () for post in data [ " data " ][ " children " ]: p = post [ " data " ] print ( f ' { p [ " score " ] : > 5 } | { p [ " title " ][ : 60 ] } ' ) Pros: No API key needed Works for any public subreddit Returns structured JSON Cons: Aggressive rate limiting (1 request per 2 seconds recommended) No search across multiple subreddits at once B
Continue reading on Dev.to Python
Opens in a new tab




