How to Scrape Reddit Keyword Search Posts
This tutorial shows how to use Reddit Keyword Search Posts API to scrape and crawl structured Reddit data in real-time.
Search Reddit across all communities with our keyword API and extract matching posts, subreddit sources, upvote counts, and comment totals to map trending topics and audience sentiment.
Access Reddit Data in 3 Steps
Start crawling Reddit keyword 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 keyword search data via our REST API!
| 1 | const root = 'https://ensembledata.com/apis' |
| 2 | const endpoint = '/reddit/keyword/search' |
| 3 | const params = { |
| 4 | "name": "bitcoin", |
| 5 | "sort": "relevance", |
| 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.
dataobject2 fields
postsarray1 item ยท schema from #0 1 item
dataobject108 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
Fetch Reddit keyword search results at scale and use them to map trending conversations, identify key communities, and understand audience sentiment.
Cross-Subreddit
Search matching posts across every public subreddit at once.
Upvote & Comments
Get upvote counts and comment totals for each matching post.
Source Subreddit
See which community each matching post came from directly.