Support needed? Reach out! ๐Ÿ“ง

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.

1

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.

2

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.

3

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!

javascript-logo JavaScript
Reddit Keyword Search
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

name (string) Keyword to search REQUIRED
sort Type of posts to fetch REQUIRED
period Time filter REQUIRED
cursor (string) REQUIRED
token (string) Private token assigned to each client to access the APIs. REQUIRED

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.

JSON
Reddit Keyword Search
dataobject2 fields
postsarray1 item ยท schema from #0 1 item
kindstring"t3"
dataobject108 fields
approved_at_utcnullnull
subredditstring"wallstreetbets"
selftextstring""
author_fullnamestring"t2_194rzccd"
savedbooleanfalse
mod_reason_titlenullnull
gildednumber0
clickedbooleanfalse
titlestring"Nvidia earnings be like"
link_flair_richtextarray1 item ยท schema from #0 1 item
estring"text"
tstring"Meme"
subreddit_name_prefixedstring"r/wallstreetbets"
hiddenbooleanfalse
pwlsnumber6
link_flair_css_classstring""
downsnumber0
thumbnail_heightnumber140
top_awarded_typenullnull
hide_scorebooleanfalse
namestring"t3_1reruk1"
quarantinebooleanfalse
link_flair_text_colorstring"dark"
upvote_rationumber0.97
author_flair_background_colornullnull
upsnumber27691
total_awards_receivednumber0
media_embedobject0 fields
empty
thumbnail_widthnumber140
author_flair_template_idnullnull
is_original_contentbooleanfalse
user_reportsarray0 items
empty
secure_medianullnull
is_reddit_media_domainbooleantrue
is_metabooleanfalse
categorynullnull
secure_media_embedobject0 fields
empty
link_flair_textstring"Meme"
can_mod_postbooleanfalse
scorenumber27691
approved_bynullnull
is_created_from_ads_uibooleanfalse
author_premiumbooleanfalse
thumbnailstring"https://preview.redd.it/tpjafiy2uplg1.png?width=140&height=140&ampโ€ฆ"
editedbooleanfalse
author_flair_css_classnullnull
author_flair_richtextarray0 items
empty
gildingsobject0 fields
empty
post_hintstring"image"
content_categoriesnullnull
is_selfbooleanfalse
subreddit_typestring"public"
creatednumber1772057949
link_flair_typestring"richtext"
wlsnumber6
removed_by_categorynullnull
banned_bynullnull
author_flair_typestring"text"
domainstring"i.redd.it"
allow_live_commentsbooleanfalse
selftext_htmlnullnull
likesnullnull
suggested_sortstring"confidence"
banned_at_utcnullnull
url_overridden_by_deststring"https://i.redd.it/tpjafiy2uplg1.png"
view_countnullnull
archivedbooleanfalse
no_followbooleanfalse
is_crosspostablebooleanfalse
pinnedbooleanfalse
over_18booleanfalse
previewobject2 fields
imagesarray1 item ยท schema from #0 1 item
sourceobject3 fields
urlstring"https://preview.redd.it/tpjafiy2uplg1.png?auto=webp&s=3bb6b473c715โ€ฆ"
widthnumber1080
heightnumber1609
resolutionsarray6 items ยท schema from #0 6 items
urlstring"https://preview.redd.it/tpjafiy2uplg1.png?width=108&crop=smart&ampโ€ฆ"
widthnumber108
heightnumber160
variantsobject0 fields
empty
idstring"tpjafiy2uplg1"
enabledbooleantrue
all_awardingsarray0 items
empty
awardersarray0 items
empty
media_onlybooleanfalse
link_flair_template_idstring"d798a224-b973-11ef-a7e7-d606063d31a6"
can_gildbooleanfalse
spoilerbooleanfalse
lockedbooleanfalse
author_flair_textnullnull
treatment_tagsarray0 items
empty
visitedbooleanfalse
removed_bynullnull
mod_notenullnull
distinguishednullnull
subreddit_idstring"t5_2th52"
author_is_blockedbooleanfalse
mod_reason_bynullnull
num_reportsnullnull
removal_reasonnullnull
link_flair_background_colorstring"#20b3df"
idstring"1reruk1"
is_robot_indexablebooleantrue
report_reasonsnullnull
authorstring"cyberr_c28z"
discussion_typenullnull
num_commentsnumber527
send_repliesbooleantrue
contest_modebooleanfalse
mod_reportsarray0 items
empty
author_patreon_flairbooleanfalse
author_flair_text_colornullnull
permalinkstring"/r/wallstreetbets/comments/1reruk1/nvidia_earnings_be_like/"
stickiedbooleanfalse
urlstring"https://i.redd.it/tpjafiy2uplg1.png"
subreddit_subscribersnumber19824678
created_utcnumber1772057949
num_crosspostsnumber0
medianullnull
is_videobooleanfalse
nextCursorstring"t3_1rhsobj"

Response Codes

Status codes this endpoint can return, so you can handle errors before they surprise you in production.

200SuccessSuccessful Response
422Client ErrorValidation Error
491Client ErrorToken not found
492Client ErrorEmail not verified
493Client ErrorSubscription expired
495Client ErrorAll daily units used
500Server ErrorSomething went wrong

API Pricing

2 units Cost per successful call to this endpoint.

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.

deco-icon

Cross-Subreddit

Search matching posts across every public subreddit at once.

deco-icon

Upvote & Comments

Get upvote counts and comment totals for each matching post.

deco-icon

Source Subreddit

See which community each matching post came from directly.