How to Scrape Reddit Subreddit Posts
This tutorial shows how to use Reddit Subreddit Posts API to scrape and crawl structured Reddit data in real-time.
Target any subreddit with our posts API and extract top, new, or hot posts along with upvote ratios, comment counts, and flair data for focused niche research and community intelligence.
Access Reddit Data in 3 Steps
Start crawling Reddit subreddit search data. Follow these steps to extract social media data in minutes.
Create Your Account
Go to our registration page and make an account. It's free, no credit card, and you get credits right away to play around with.
Verify Your Email Address
You'll get a verification email, click the link in it. Once that's done, you can grab your API token from the dashboard.
Make Your First API Call
Copy the code snippet below, swap in your API key, and run it. You'll get Reddit data back as JSON within a few seconds.
Code Sample
Here's a JavaScript example to get you going. Swap out the token and you're good, works the same way in any language that can make HTTP requests. Start collecting subreddit search data via our REST API!
| 1 | const root = 'https://ensembledata.com/apis' |
| 2 | const endpoint = '/reddit/subreddit/posts' |
| 3 | const params = { |
| 4 | "name": "SkincareAddiction", |
| 5 | "sort": "new", |
| 6 | "period": "hour", |
| 7 | "cursor": "", |
| 8 | "token": "YOUR-TOKEN-HERE" |
| 9 | } |
| 10 | |
| 11 | const queryString = new URLSearchParams(params).toString(); |
| 12 | const url = `${root}${endpoint}?${queryString}`; |
| 13 | |
| 14 | await fetch(url) |
| 15 | .then(response => response.json()) |
| 16 | .then(data => console.log(data)) |
| 17 | .catch(error => console.error(error)); |
| 18 |
Parameters
Example Response
Explore the fields returned by this endpoint. Click a row to expand nested objects and arrays, hover a value to copy it, or use "Expand all" to see everything at once.
dataarray1 item ยท schema from #0 1 item
dataobject107 fields
link_flair_richtextarray1 item ยท schema from #0 1 item
media_embedobject0 fields
user_reportsarray0 items
secure_media_embedobject0 fields
author_flair_richtextarray0 items
gildingsobject0 fields
previewobject2 fields
imagesarray1 item ยท schema from #0 1 item
sourceobject3 fields
resolutionsarray6 items ยท schema from #0 6 items
variantsobject0 fields
all_awardingsarray0 items
awardersarray0 items
treatment_tagsarray0 items
mod_reportsarray0 items
Response Codes
Status codes this endpoint can return, so you can handle errors before they surprise you in production.
API Pricing
Fetch Reddit Data at Scale
Collect subreddit posts at scale for competitive research, niche trend analysis, or building datasets from specific Reddit communities.
Subreddit Feeds
Pull top, new, or hot posts from any specific subreddit.
Flair Data
Filter posts by category using returned flair information.
Upvote Ratios
See upvote ratios and comment counts for every post returned.