Development · Tip
Reddit Subreddit JSON Endpoint Trick
Access raw JSON data from any public subreddit by appending .json
Reddit exposes built-in JSON endpoints for public feeds simply by adding '.json' to the end of a subreddit or post URL. This allows developers and data analysts to quickly extract titles, vote counts, and comments without registering an API key or setting up OAuth credentials. It works well for lightweight scraping and quick analysis, though requests remain subject to Reddit's standard CDN rate limits.
How it works
To get structured JSON data from any public subreddit without an API key:
1. Append `.json` to any subreddit URL (e.g., `https://www.reddit.com/r/TaylorSwift/.json` or `https://www.reddit.com/r/TaylorSwift/.json?limit=100`).
2. In R, fetch and parse the JSON into a clean data frame with:
```R
library(httr)
library(jsonlite)
url <- "https://www.reddit.com/r/TaylorSwift/.json?limit=100"
r <- GET(url)
x <- fromJSON(rawToChar(r$content), flatten = TRUE)
df <- x$data$children
```
3. The resulting data frame contains fields such as `data.title`, `data.ups`, `data.selftext`, `data.author_fullname`, and media preview links.
Note: Unauthenticated requests from cloud IPs or high frequencies may be rate-limited or blocked by Reddit's CDN.
What it's for
- Scrape recent posts from a subreddit into an R or Python data frame without registering an app
- Monitor community sentiment and post engagement for ad-hoc data analysis
- Inspect the underlying structured data schema of a Reddit post or listing
Key points
- Append '.json' to the end of any public subreddit or post URL
- Supports URL query parameters such as '?limit=100' to control batch size
- Returns standard Reddit listing JSON containing post metadata, upvotes, and author details
- Parse directly with HTTP clients and JSON parsers in R (httr/jsonlite) or Python (requests)
Pricing
Free built-in functionality on Reddit
Details
- Type
- Tip
- Category
- Development
- Topic
- Web Scraping
- Open source
- No
- Platforms
- API, Web
- For
- Data analysts, programmers, and researchers needing quick access to Reddit data.
- Alternative to
- PRAW (Python Reddit API Wrapper), Reddit Official API
- Tags
- reddit, scraping, json, api, data analysis, r
Why it was saved
- @softwarewithnick: Allows scraping post titles, upvotes, comment counts, author names, and image URLs directly into Python or R data frames without registering an API key.
Related
Turn websites and documents into clean, LLM-ready markdown or structured data.
Turn any website into a structured REST API using natural language
Cloud platform and marketplace for web scraping, automation, and AI data extraction.
Open-source Python library and API for prompt-based web scraping using LLMs
AI Chrome extension for scraping web data using natural language chat prompts.
Feature and cost breakdown across cloud browser sandbox providers for scraping
Updated