How to Scrape Reddit Post Comments
This tutorial shows how to use Reddit Post Comments API to scrape and crawl structured Reddit data in real-time.
Extract full Reddit comment trees through our API and capture top-level replies, nested threads, upvote scores, and author data for deep sentiment analysis and community research.
Access Reddit Data in 3 Steps
Start crawling Reddit post comments 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 post comments data via our REST API!
| 1 | const root = 'https://ensembledata.com/apis' |
| 2 | const endpoint = '/reddit/post/comments' |
| 3 | const params = { |
| 4 | "permalink": "/r/SkincareAddiction/comments/8pv3gg/ba_finished_my_5_month_course_of_accutane_just_in/", |
| 5 | "token": "YOUR-TOKEN-HERE" |
| 6 | } |
| 7 | |
| 8 | const queryString = new URLSearchParams(params).toString(); |
| 9 | const url = `${root}${endpoint}?${queryString}`; |
| 10 | |
| 11 | await fetch(url) |
| 12 | .then(response => response.json()) |
| 13 | .then(data => console.log(data)) |
| 14 | .catch(error => console.error(error)); |
| 15 |
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.
dataobject1 field
commentsarray1 item · schema from #0 1 item
dataobject70 fields
awardersarray0 items
repliesobject2 fields
dataobject6 fields
childrenarray4 items · schema from #0 4 items
dataobject70 fields
awardersarray0 items
repliesobject2 fields
dataobject6 fields
childrenarray1 item · schema from #0 1 item
dataobject70 fields
awardersarray0 items
repliesobject2 fields
dataobject6 fields
childrenarray1 item · schema from #0 1 item
dataobject70 fields
awardersarray0 items
repliesobject2 fields
dataobject6 fields
childrenarray1 item · schema from #0 1 item
dataobject70 fields
awardersarray0 items
repliesobject2 fields
dataobject6 fields
childrenarray1 item · schema from #0 1 item
dataobject6 fields
childrenarray1 item · schema from #0 1 item
user_reportsarray0 items
all_awardingsarray0 items
author_flair_richtextarray0 items
gildingsobject0 fields
treatment_tagsarray0 items
mod_reportsarray0 items
user_reportsarray0 items
all_awardingsarray0 items
author_flair_richtextarray0 items
gildingsobject0 fields
treatment_tagsarray0 items
mod_reportsarray0 items
user_reportsarray0 items
all_awardingsarray0 items
author_flair_richtextarray0 items
gildingsobject0 fields
treatment_tagsarray0 items
mod_reportsarray0 items
user_reportsarray0 items
all_awardingsarray0 items
author_flair_richtextarray0 items
gildingsobject0 fields
treatment_tagsarray0 items
mod_reportsarray0 items
user_reportsarray0 items
all_awardingsarray0 items
author_flair_richtextarray0 items
gildingsobject0 fields
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
Pull Reddit comments in bulk including threads, nested replies, and upvotes and use them to inform content strategy, product research, or community feedback analysis.
Full Comment Tree
Get top-level and nested replies for any Reddit post at once.
Upvote Scores
See upvote scores per comment to gauge community sentiment.
Author Data
Get author info returned alongside every comment retrieved.