Reference · Tools

Reddit

Interact with the Reddit API to manage posts, comments, user profiles, subreddits, and user data

Action Communication v1

The Reddit node manages posts, comments and profiles as the connected account, and reads public subreddit and user data. A typical build is monitoring a subreddit for mentions of your product and routing them to a channel for a human to answer.

Node type
Action
Parameters
48
Outputs
Output, Error
Credentials
Reddit OAuth2

Reddit

Manage posts, comments, profiles, subreddits, and user data on Reddit.

Overview

Reddit is a social news and discussion platform. This tool provides operations for posts (create, delete, get, getAll, search), post comments (create, delete, getAll, reply), profile details (identity, friends, blocked users, karma, preferences, saved, trophies), subreddit information (get about/rules, getAll/search/trending), and user data (about, comments, gilded, overview, submitted). Authenticated operations use OAuth2 via oauth.reddit.com; public operations (subreddit, user) use www.reddit.com.

Category: Communication
Tool Name: reddit
Version: 1

Appearance: Icon: si-reddit | Color: #FF4500

Node Type

Action — processes input items and produces output

This node is not listed in the node panel — it is placed as part of another node’s pattern.

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Reddit OAuth2 credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Postpost
Post CommentpostComment
Profileprofile
Subredditsubreddit
Useruser

Operations

OperationValueDescription
Post: CreatecreateSubmit a post to a subreddit
Post: DeletedeleteDelete a post from a subreddit
Post: GetgetGet a post from a subreddit
Post: Get ManygetAllGet many posts from a subreddit
Post: SearchsearchSearch posts in a subreddit or in all of Reddit
Post Comment: CreatecreateCreate a top-level comment in a post
Post Comment: DeletedeleteRemove a comment from a post
Post Comment: Get ManygetAllRetrieve many comments in a post
Post Comment: ReplyreplyWrite a reply to a comment in a post
Profile: GetgetGet details about the authenticated user profile
Subreddit: GetgetRetrieve background information about a subreddit
Subreddit: Get ManygetAllRetrieve information about many subreddits
User: GetgetGet information about a user

Parameters

Post: Create

ParameterTypeRequiredDefaultDescription
SubredditstringYesSubreddit to create the post in (without r/ prefix). Supports expressions.
KindoptionsNoselfThe kind of post to create.
Options: self (Text Post), link (Link Post), image (Image Post)
TitlestringYesTitle of the post, up to 300 characters long. Supports expressions.
TextstringYesText of the post. Markdown supported. (shown when Kind is self)
URLstringYesURL of the post. (shown when Kind is link, image)
ResubmitbooleanNofalseWhether the URL will be posted even if it was already posted to the subreddit before. (shown when Kind is link, image)

Post: Delete

ParameterTypeRequiredDefaultDescription
Post IDstringYesID of the post to delete. Found in the post URL: /r/[subreddit_name]/comments/[post_id]/[post_title].

Post: Get

ParameterTypeRequiredDefaultDescription
SubredditstringYesThe name of subreddit to retrieve the post from.
Post IDstringYesID of the post to retrieve. Found in the post URL: /r/[subreddit_name]/comments/[post_id]/[post_title].

Post: Get Many

ParameterTypeRequiredDefaultDescription
SubredditstringYesThe name of subreddit to retrieve the posts from.
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo100Max number of results to return. (shown when Return All is false)
FilterscollectionNo{}Optional filter narrowing which listing is read.
— CategoryoptionsNotopCategory of the posts to retrieve.
Options: top, hot, new, rising

Post: Search

ParameterTypeRequiredDefaultDescription
LocationoptionsNosubredditLocation where to search for posts.
Options: allReddit (search all of Reddit), subreddit (search one specific subreddit)
SubredditstringYesThe name of subreddit to search in. (shown when Location is subreddit)
KeywordstringYesThe keyword for the search. Supports expressions.
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo100Max number of results to return. (shown when Return All is false)
Additional FieldscollectionNo{}Optional settings applied to the search.
— SortoptionsNorelevanceThe category to sort results by.
Options: comments, hot, new, relevance, top

Post Comment: Create

ParameterTypeRequiredDefaultDescription
Post IDstringYesID of the post to write the comment to. Found in the post URL: /r/[subreddit_name]/comments/[post_id]/[post_title].
Comment TextstringYesText of the comment. Markdown supported. Supports expressions.

Post Comment: Delete

ParameterTypeRequiredDefaultDescription
Comment IDstringYesID of the comment to remove. Found in the comment URL: /r/[subreddit_name]/comments/[post_id]/[post_title]/[comment_id].

Post Comment: Get Many

ParameterTypeRequiredDefaultDescription
SubredditstringYesThe name of subreddit where the post is.
Post IDstringYesID of the post to get all comments from. Found in the post URL: /r/[subreddit_name]/comments/[post_id]/[post_title].
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo100Max number of results to return. (shown when Return All is false)

Post Comment: Reply

ParameterTypeRequiredDefaultDescription
Comment IDstringYesID of the comment to reply to. Found in the comment URL: www.reddit.com/r/[subreddit_name]/comments/[post_id]/[post_title]/[comment_id].
Reply TextstringYesText of the reply. Markdown supported. Supports expressions.

Profile: Get

ParameterTypeRequiredDefaultDescription
DetailsoptionsYesidentityDetails of the authenticated account to retrieve.
Options: blockedUsers, friends, identity, karma (subreddit karma), prefs (Preferences), saved (the account’s saved posts), trophies
Return AllbooleanNofalseWhether to return all results or only up to a given limit. (shown when Details is saved)
LimitnumberNo100Max number of results to return. (shown when Details is saved and Return All is false)

Subreddit: Get

ParameterTypeRequiredDefaultDescription
ContentoptionsYesaboutSubreddit content to retrieve.
Options: about, rules
SubredditstringYesThe name of subreddit to retrieve the content from.

Subreddit: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo100Max number of results to return. (shown when Return All is false)
FilterscollectionNo{}Optional filter choosing which set of subreddits is returned.
— KeywordstringNoThe keyword for the subreddit search.
— TrendingbooleanNofalseWhether to fetch currently trending subreddits in all of Reddit.

User: Get

ParameterTypeRequiredDefaultDescription
UsernamestringYesReddit username of the user to retrieve. Supports expressions.
DetailsoptionsYesaboutDetails of the user to retrieve.
Options: about, comments, gilded, overview, submitted
Return AllbooleanNofalseWhether to return all results or only up to a given limit. (shown when Details is comments, gilded, overview, submitted)
LimitnumberNo100Max number of results to return. (shown when Details is comments, gilded, overview, submitted and Return All is false)

All Operations

ParameterTypeRequiredDefaultDescription
Reddit AccountcredentialNoConnect your Reddit account via OAuth2.
Max ConcurrencynumberNo5Maximum number of items to process concurrently. Reddit rate limits to 60 requests/minute for OAuth2.

Output Data

The Reddit response is merged onto the item JSON at the top level, so downstream nodes read its fields directly ({{ $json.id }}). The rest of the incoming item JSON passes through unchanged and binary data is forwarded. Operations that return a single record produce one output item per input item; operations that return a listing fan out, emitting one output item per record — and when the listing comes back empty, that input item produces no output item at all.

OperationWhat lands on the output item
post / createOne item carrying the submitted post’s data.
post / deleteOne item carrying success: true.
post / getOne item carrying the post record.
post / getAllFans out — one item per post in the listing.
post / searchFans out — one item per matching post.
postComment / create, replyOne item carrying the new comment’s data.
postComment / deleteOne item carrying success: true.
postComment / getAllFans out — one item per comment on the post.
profile / getDepends on Details: identity and prefs produce one item; friends, blockedUsers, karma, trophies and saved fan out one item per record.
subreddit / getabout produces one item with the subreddit record; rules fans out one item per rule in the returned list.
subreddit / getAllFans out — one item per subreddit. With Trending on, the only field added is name.
user / getabout produces one item with the user record; comments, gilded, overview and submitted fan out one item per record.

Failed items are routed to the Error port in errorPort mode, carrying an _error object.

Usage Examples

  • Create a text post in r/test
  • Search Reddit for posts about Node.js
  • Get all comments on a specific post
  • Reply to a comment on Reddit
  • Get my Reddit profile identity
  • List trending subreddits
  • Get information about a Reddit user

Example Configuration

Submit a markdown text post to a subreddit:

{
  "type": "reddit",
  "parameters": {
    "resource": "post",
    "operation": "create",
    "subreddit": "test",
    "kind": "self",
    "title": "{{ $json.title }}",
    "text": "This is the content of my text post with **markdown** support!"
  }
}

Submit a link post, allowing the same URL to be posted again:

{
  "type": "reddit",
  "parameters": {
    "resource": "post",
    "operation": "create",
    "subreddit": "technology",
    "kind": "link",
    "title": "{{ $json.headline }}",
    "url": "{{ $json.url }}",
    "resubmit": true
  }
}

Read the top posts of a subreddit, one output item per post:

{
  "type": "reddit",
  "parameters": {
    "resource": "post",
    "operation": "getAll",
    "subreddit": "programming",
    "returnAll": false,
    "limit": 10,
    "filters": {
      "category": "top"
    }
  }
}

Search one subreddit for a keyword and sort the results by newest:

{
  "type": "reddit",
  "parameters": {
    "resource": "post",
    "operation": "search",
    "location": "subreddit",
    "subreddit": "MachineLearning",
    "keyword": "{{ $json.keyword }}",
    "returnAll": false,
    "limit": 20,
    "additionalFields": {
      "sort": "new"
    }
  }
}

Add a top-level comment to a post:

{
  "type": "reddit",
  "parameters": {
    "resource": "postComment",
    "operation": "create",
    "postId": "{{ $json.postId }}",
    "commentText": "Great post! Thanks for sharing this **interesting** content."
  }
}

Reply to an existing comment:

{
  "type": "reddit",
  "parameters": {
    "resource": "postComment",
    "operation": "reply",
    "commentId": "{{ $json.commentId }}",
    "replyText": "I completely agree with your point about this topic."
  }
}

Retrieve the signed-in account’s saved posts:

{
  "type": "reddit",
  "parameters": {
    "resource": "profile",
    "operation": "get",
    "details": "saved",
    "returnAll": false,
    "limit": 50
  }
}

Get a subreddit’s background information:

{
  "type": "reddit",
  "parameters": {
    "resource": "subreddit",
    "operation": "get",
    "subreddit": "programming",
    "content": "about"
  }
}

List the subreddits trending right now:

{
  "type": "reddit",
  "parameters": {
    "resource": "subreddit",
    "operation": "getAll",
    "returnAll": false,
    "limit": 25,
    "filters": {
      "trending": true
    }
  }
}

Pull a user’s recent comments:

{
  "type": "reddit",
  "parameters": {
    "resource": "user",
    "operation": "get",
    "username": "{{ $json.username }}",
    "details": "comments",
    "returnAll": false,
    "limit": 100
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Reddit tool for managing posts, comments, profiles, subreddits, and user data via the Reddit API.

Notes

  • Post, Post Comment and Profile need the connected account. Those three resources act as the authenticated Reddit user; Subreddit and User read public data.
  • Trending wins over Keyword. In Subreddit: Get Many, turning Trending on ignores any Keyword you also set. Leave both off to list subreddits generally.
  • Empty listings emit nothing. An input item whose listing returns no records produces no output item, so a downstream node may receive fewer items than it was sent — or none.
  • Friends and Karma raise an error when empty. Profile: Get with Details set to friends or karma reports a failure rather than an empty result when the account has nothing to return, so it lands on the Error port in errorPort mode.
  • Keep Max Concurrency modest. Reddit rate limits OAuth2 traffic, and the node’s default of 5 concurrent items is chosen to stay under it.

Frequently asked questions

Which operations act as my account?

Post, Post Comment and Profile act as the authenticated Reddit user. Subreddit and User read public data, so they do not post anything on your behalf.

Why is my keyword being ignored on Subreddit: Get Many?

Trending wins over Keyword. With Trending on, any keyword you also set is ignored — leave both off to list subreddits generally.

What happens when a listing is empty?

Empty listings emit nothing rather than producing an empty item, so downstream nodes simply do not run for that query.

Which credential does it need?

A Reddit OAuth2 credential for the account the write operations should act as.

Build with the Reddit node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Reddit OAuth2 credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.