Did you know you can get structured JSON from Reddit without any API key, OAuth tokens, or rate limit headaches?
The Trick
Append .json to any Reddit URL:
https://www.reddit.com/r/webdev.json
https://www.reddit.com/r/python/top.json?t=week&limit=25
https://www.reddit.com/r/datascience/search.json?q=web+scraping&sort=new
https://www.reddit.com/user/spez/about.json
Code Example
async function getRedditPosts(subreddit, sort = "hot", limit = 25) {
const url = `https://www.reddit.com/r/${subreddit}/${sort}.json?limit=${limit}`;
const res = await fetch(url, {
headers: { "User-Agent": "MyApp/1.0" }
});
const data = await res.json();
return data.data.children.map(post => ({
title: post.data.title,
author: post.data.author,
score: post.data.score,
comments: post.data.num_comments,
url: post.data.url,
created: new Date(post.data.created_utc * 1000).toISOString()
}));
}
const posts = await getRedditPosts("startup", "top");
console.log(posts);
Data You Can Extract
- Posts: title, score, comments, author, awards, flair
- Comments: text, score, author, replies (nested)
- Users: karma, account age, recent posts
- Search: across all subreddits or within one
- Sorting: hot, new, top (hour/day/week/month/year/all)
Important: Add User-Agent
Reddit blocks requests without a User-Agent header. Always include one:
headers: { "User-Agent": "YourAppName/1.0" }
Why Not the Official API?
Reddit's official API now requires OAuth and has strict rate limits (100 requests/minute). The JSON endpoint works without any authentication and is how old.reddit.com loads data.
Use Cases
- Market research — what does r/SaaS discuss most?
- Competitor monitoring — track mentions of your brand
- Content ideas — find top posts in your niche
- Sentiment analysis — how does a community feel about a topic?
- Lead generation — find people asking for help you can provide
More Free APIs
Need Reddit data extracted at scale? $20 flat rate. I'll deliver structured JSON/CSV with posts, comments, user profiles from any subreddit. Email: Spinov001@gmail.com | All services →
Top comments (0)