Description: Enable agents to interact with Reddit.
Author: Arcade
Code: GitHub
Auth: User authorization via the Reddit auth provider
The Arcade Reddit toolkit provides a pre-built set of tools for interacting with Reddit. These tools make it easy to build agents and AI apps that can:
- Submit text posts
- Comment on posts
- Reply to comments
- Get posts (title and other metadata) in a subreddit
- Get content (body) of posts
- Get top-level comments of a post
- Determine if a subreddit exists or is private
- Get rules of a subreddit
- Get the authenticated user’s username
- Get posts by the authenticated user
Install
pip install arcade_reddit
pip installing the toolkit is not needed if you’re using the tools hosted on Arcade Cloud.
Available Tools
These tools are currently available in the Arcade Reddit toolkit.
Tool Name | Description |
---|---|
SubmitTextPost | Submit a text-based post to Reddit. |
CommentOnPost | Comment on a Reddit post. |
ReplyToComment | Reply to a Reddit comment. |
GetPostsInSubreddit | Gets posts titles, links, and other metadata in the specified subreddit |
GetContentOfPost | Get content (body) of a Reddit post. |
GetContentOfMultiplePosts | Get content (body) of multiple Reddit posts. |
GetTopLevelCommentsOfPost | Get the first page of top-level comments of a Reddit post. |
CheckSubredditAccess | Check whether a user has access to a subreddit, including whether it exists |
GetSubredditRules | Get the rules of a subreddit |
GetMyUsername | Get the authenticated user's username |
GetMyPosts | Get posts created by the authenticated user |
If you need to perform an action that’s not listed here, you can get in touch with us to request a new tool, or create your own tools with the Reddit auth provider.
SubmitTextPost
Submit a text-based post to a subreddit
Parameters
subreddit
(string, required) The name of the subreddit to which the post will be submitted.title
(string, required) The title of the submission.body
(string, optional) The body of the post in markdown format. Should never be the same as the title.nsfw
(boolean, optional) Indicates if the submission is NSFW. Default isFalse
.spoiler
(boolean, optional) Indicates if the post is marked as a spoiler. Default isFalse
.send_replies
(boolean, optional) If true, sends replies to the user’s inbox. Default isTrue
.
CommentOnPost
Comment on a Reddit post.
Parameters
post_identifier
(string, required) The identifier of the Reddit post. The identifier may be a Reddit URL, a permalink, a fullname, or a post id.text
(string, required) The body of the comment in markdown format.
ReplyToComment
Reply to a Reddit comment
Parameters
comment_identifier
(string, required) The identifier of the Reddit comment to reply to. The identifier may be a comment ID, a Reddit URL to the comment, a permalink to the comment, or the fullname of the comment.text
(string, required) The body of the reply in markdown format.
GetPostsInSubreddit
Gets posts titles, links, and other metadata in the specified subreddit.
The time_range is required if the listing type is ‘top’ or ‘controversial’.
Parameters
subreddit
(string, required) The name of the subreddit to fetch posts from.listing
(enum (SubredditListingType), optional) The type of listing to fetch. For simple listings such as ‘hot’, ‘new’, or ‘rising’, the time_range parameter is ignored. For time-based listings such as ‘top’ or ‘controversial’, the ‘time_range’ parameter is required. Default is ‘hot’.limit
(integer, optional) The maximum number of posts to fetch. Default is 10, max is 100.cursor
(str, optional) The pagination token from a previous call.time_range
(enum (RedditTimeFilter), optional) The time range for filtering posts. Must be provided if the listing type is ‘top’ or ‘controversial’. Otherwise, it is ignored. Defaults to ‘today’.
GetContentOfPost
Get the content (body) of a Reddit post by its identifier.
Parameters
post_identifier
(string, required) The identifier of the Reddit post. The identifier may be a Reddit URL, a permalink, a fullname, or a post id.
GetContentOfMultiplePosts
Get the content (body) of multiple Reddit posts by their identifiers in a single request
Parameters
post_identifiers
(list of strings, required) A list of identifiers of the Reddit posts. The identifiers may be Reddit URLs, permalinks, fullnames, or post ids.
GetTopLevelCommentsOfPost
Get the first page of top-level comments of a Reddit post.
Parameters
post_identifier
(string, required) The identifier of the Reddit post. The identifier may be a Reddit URL, a permalink, a fullname, or a post id.
CheckSubredditAccess
Checks whether the specified subreddit exists and also if it is accessible to the authenticated user.
Parameters
subreddit
(string, required) The name of the subreddit to check.
GetSubredditRules
Gets the rules of the specified subreddit
Parameters
subreddit
(string, required) The name of the subreddit for which to fetch rules.
GetMyUsername
Gets the username of the authenticated user.
GetMyPosts
Get posts that were created by the authenticated user sorted by newest first
Parameters
limit
(integer, optional) The maximum number of posts to fetch. Default is 10, max is 100.include_body
(boolean, optional) Whether to include the body of the posts in the response. Default isTrue
.cursor
(str, optional) The pagination token from a previous call.
Auth
The Arcade Reddit toolkit uses the Reddit auth provider to connect to users’ Reddit accounts.
With the hosted Arcade Engine, there’s nothing to configure. Your users will see Arcade
as the name of the application that’s requesting permission.
With a self-hosted installation of Arcade, you need to configure the Reddit auth provider with your own Reddit app credentials.
Reference
SubredditListingType
The type of listing to fetch.
HOT
(string: “hot”): The hottest posts in the subreddit.NEW
(string: “new”): The newest posts in the subreddit.RISING
(string: “rising”): The posts that are trending up in the subreddit.TOP
(string: “top”): The top posts in the subreddit (time-based).CONTROVERSIAL
(string: “controversial”): The posts that are currently controversial in the subreddit (time-based).
RedditTimeFilter
The time range for filtering posts.
NOW
(string: “NOW”)TODAY
(string: “TODAY”)THIS_WEEK
(string: “THIS_WEEK”)THIS_MONTH
(string: “THIS_MONTH”)THIS_YEAR
(string: “THIS_YEAR”)ALL_TIME
(string: “ALL_TIME”)