Files
sim/apps/docs/content/docs/en/tools/reddit.mdx
Waleed 6cb3977dd9 fix(visibility): updated visibility for non-sensitive tool params from user only to user or llm (#3095)
* fix(visibility): updated visibility for non-sensitive tool params from user only to user or llm

* update docs

* updated docs script
2026-01-31 11:31:08 -08:00

349 lines
14 KiB
Plaintext

---
title: Reddit
description: Access Reddit data and content
---
import { BlockInfoCard } from "@/components/ui/block-info-card"
<BlockInfoCard
type="reddit"
color="#FF5700"
/>
{/* MANUAL-CONTENT-START:intro */}
[Reddit](https://www.reddit.com/) is a social platform where users share and discuss content in topic-based communities called subreddits.
In Sim, you can use the Reddit integration to:
- **Get Posts**: Retrieve posts from any subreddit, with options to sort (Hot, New, Top, Rising) and filter Top posts by time (Day, Week, Month, Year, All Time).
- **Get Comments**: Fetch comments from a specific post, with options to sort and set the number of comments.
These operations let your agents access and analyze Reddit content as part of your automated workflows.
{/* MANUAL-CONTENT-END */}
## Usage Instructions
Integrate Reddit into workflows. Read posts, comments, and search content. Submit posts, vote, reply, edit, and manage your Reddit account.
## Tools
### `reddit_get_posts`
Fetch posts from a subreddit with different sorting options
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `subreddit` | string | Yes | The subreddit to fetch posts from \(e.g., "technology", "news"\) |
| `sort` | string | No | Sort method for posts \(e.g., "hot", "new", "top", "rising"\). Default: "hot" |
| `limit` | number | No | Maximum number of posts to return \(e.g., 25\). Default: 10, max: 100 |
| `time` | string | No | Time filter for "top" sorted posts: "day", "week", "month", "year", or "all" \(default: "day"\) |
| `after` | string | No | Fullname of a thing to fetch items after \(for pagination\) |
| `before` | string | No | Fullname of a thing to fetch items before \(for pagination\) |
| `count` | number | No | A count of items already seen in the listing \(used for numbering\) |
| `show` | string | No | Show items that would normally be filtered \(e.g., "all"\) |
| `sr_detail` | boolean | No | Expand subreddit details in the response |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `subreddit` | string | Name of the subreddit where posts were fetched from |
| `posts` | array | Array of posts with title, author, URL, score, comments count, and metadata |
| ↳ `id` | string | Post ID |
| ↳ `title` | string | Post title |
| ↳ `author` | string | Author username |
| ↳ `url` | string | Post URL |
| ↳ `permalink` | string | Reddit permalink |
| ↳ `score` | number | Post score \(upvotes - downvotes\) |
| ↳ `num_comments` | number | Number of comments |
| ↳ `created_utc` | number | Creation timestamp \(UTC\) |
| ↳ `is_self` | boolean | Whether this is a text post |
| ↳ `selftext` | string | Text content for self posts |
| ↳ `thumbnail` | string | Thumbnail URL |
| ↳ `subreddit` | string | Subreddit name |
### `reddit_get_comments`
Fetch comments from a specific Reddit post
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `postId` | string | Yes | The ID of the Reddit post to fetch comments from \(e.g., "abc123"\) |
| `subreddit` | string | Yes | The subreddit where the post is located \(e.g., "technology", "programming"\) |
| `sort` | string | No | Sort method for comments: "confidence", "top", "new", "controversial", "old", "random", "qa" \(default: "confidence"\) |
| `limit` | number | No | Maximum number of comments to return \(e.g., 25\). Default: 50, max: 100 |
| `depth` | number | No | Maximum depth of subtrees in the thread \(controls nested comment levels\) |
| `context` | number | No | Number of parent comments to include |
| `showedits` | boolean | No | Show edit information for comments |
| `showmore` | boolean | No | Include "load more comments" elements in the response |
| `showtitle` | boolean | No | Include submission title in the response |
| `threaded` | boolean | No | Return comments in threaded/nested format |
| `truncate` | number | No | Integer to truncate comment depth |
| `after` | string | No | Fullname of a thing to fetch items after \(for pagination\) |
| `before` | string | No | Fullname of a thing to fetch items before \(for pagination\) |
| `count` | number | No | A count of items already seen in the listing \(used for numbering\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `post` | object | Post information including ID, title, author, content, and metadata |
| ↳ `id` | string | Post ID |
| ↳ `title` | string | Post title |
| ↳ `author` | string | Post author |
| ↳ `selftext` | string | Post text content |
| ↳ `score` | number | Post score |
| ↳ `created_utc` | number | Creation timestamp |
| ↳ `permalink` | string | Reddit permalink |
| `comments` | array | Nested comments with author, body, score, timestamps, and replies |
| ↳ `id` | string | Comment ID |
| ↳ `author` | string | Comment author |
| ↳ `body` | string | Comment text |
| ↳ `score` | number | Comment score |
| ↳ `created_utc` | number | Creation timestamp |
| ↳ `permalink` | string | Comment permalink |
| ↳ `replies` | array | Nested reply comments |
### `reddit_get_controversial`
Fetch controversial posts from a subreddit
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `subreddit` | string | Yes | The subreddit to fetch posts from \(e.g., "technology", "news"\) |
| `time` | string | No | Time filter for controversial posts: "hour", "day", "week", "month", "year", or "all" \(default: "all"\) |
| `limit` | number | No | Maximum number of posts to return \(e.g., 25\). Default: 10, max: 100 |
| `after` | string | No | Fullname of a thing to fetch items after \(for pagination\) |
| `before` | string | No | Fullname of a thing to fetch items before \(for pagination\) |
| `count` | number | No | A count of items already seen in the listing \(used for numbering\) |
| `show` | string | No | Show items that would normally be filtered \(e.g., "all"\) |
| `sr_detail` | boolean | No | Expand subreddit details in the response |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `subreddit` | string | Name of the subreddit where posts were fetched from |
| `posts` | array | Array of controversial posts with title, author, URL, score, comments count, and metadata |
| ↳ `id` | string | Post ID |
| ↳ `title` | string | Post title |
| ↳ `author` | string | Author username |
| ↳ `url` | string | Post URL |
| ↳ `permalink` | string | Reddit permalink |
| ↳ `score` | number | Post score \(upvotes - downvotes\) |
| ↳ `num_comments` | number | Number of comments |
| ↳ `created_utc` | number | Creation timestamp \(UTC\) |
| ↳ `is_self` | boolean | Whether this is a text post |
| ↳ `selftext` | string | Text content for self posts |
| ↳ `thumbnail` | string | Thumbnail URL |
| ↳ `subreddit` | string | Subreddit name |
### `reddit_search`
Search for posts within a subreddit
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `subreddit` | string | Yes | The subreddit to search in \(e.g., "technology", "programming"\) |
| `query` | string | Yes | Search query text \(e.g., "artificial intelligence", "machine learning tutorial"\) |
| `sort` | string | No | Sort method for search results \(e.g., "relevance", "hot", "top", "new", "comments"\). Default: "relevance" |
| `time` | string | No | Time filter for search results: "hour", "day", "week", "month", "year", or "all" \(default: "all"\) |
| `limit` | number | No | Maximum number of posts to return \(e.g., 25\). Default: 10, max: 100 |
| `restrict_sr` | boolean | No | Restrict search to the specified subreddit only \(default: true\) |
| `after` | string | No | Fullname of a thing to fetch items after \(for pagination\) |
| `before` | string | No | Fullname of a thing to fetch items before \(for pagination\) |
| `count` | number | No | A count of items already seen in the listing \(used for numbering\) |
| `show` | string | No | Show items that would normally be filtered \(e.g., "all"\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `subreddit` | string | Name of the subreddit where search was performed |
| `posts` | array | Array of search result posts with title, author, URL, score, comments count, and metadata |
| ↳ `id` | string | Post ID |
| ↳ `title` | string | Post title |
| ↳ `author` | string | Author username |
| ↳ `url` | string | Post URL |
| ↳ `permalink` | string | Reddit permalink |
| ↳ `score` | number | Post score \(upvotes - downvotes\) |
| ↳ `num_comments` | number | Number of comments |
| ↳ `created_utc` | number | Creation timestamp \(UTC\) |
| ↳ `is_self` | boolean | Whether this is a text post |
| ↳ `selftext` | string | Text content for self posts |
| ↳ `thumbnail` | string | Thumbnail URL |
| ↳ `subreddit` | string | Subreddit name |
### `reddit_submit_post`
Submit a new post to a subreddit (text or link)
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `subreddit` | string | Yes | The subreddit to post to \(e.g., "technology", "programming"\) |
| `title` | string | Yes | Title of the submission \(e.g., "Check out this new AI tool"\). Max 300 characters |
| `text` | string | No | Text content for a self post in markdown format \(e.g., "This is the **body** of my post"\) |
| `url` | string | No | URL for a link post \(cannot be used with text\) |
| `nsfw` | boolean | No | Mark post as NSFW |
| `spoiler` | boolean | No | Mark post as spoiler |
| `send_replies` | boolean | No | Send reply notifications to inbox \(default: true\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the post was submitted successfully |
| `message` | string | Success or error message |
| `data` | object | Post data including ID, name, URL, and permalink |
| ↳ `id` | string | New post ID |
| ↳ `name` | string | Thing fullname \(t3_xxxxx\) |
| ↳ `url` | string | Post URL from API response |
| ↳ `permalink` | string | Full Reddit permalink |
### `reddit_vote`
Upvote, downvote, or unvote a Reddit post or comment
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | string | Yes | Thing fullname to vote on \(e.g., "t3_abc123" for post, "t1_def456" for comment\) |
| `dir` | number | Yes | Vote direction: 1 \(upvote\), 0 \(unvote\), or -1 \(downvote\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the vote was successful |
| `message` | string | Success or error message |
### `reddit_save`
Save a Reddit post or comment to your saved items
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | string | Yes | Thing fullname to save \(e.g., "t3_abc123" for post, "t1_def456" for comment\) |
| `category` | string | No | Category to save under \(Reddit Gold feature\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the save was successful |
| `message` | string | Success or error message |
### `reddit_unsave`
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `subreddit` | string | Subreddit name |
| `posts` | json | Posts data |
| `post` | json | Single post data |
| `comments` | json | Comments data |
### `reddit_reply`
Add a comment reply to a Reddit post or comment
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `parent_id` | string | Yes | Thing fullname to reply to \(e.g., "t3_abc123" for post, "t1_def456" for comment\) |
| `text` | string | Yes | Comment text in markdown format \(e.g., "Great post! Here is my **reply**"\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the reply was posted successfully |
| `message` | string | Success or error message |
| `data` | object | Comment data including ID, name, permalink, and body |
| ↳ `id` | string | New comment ID |
| ↳ `name` | string | Thing fullname \(t1_xxxxx\) |
| ↳ `permalink` | string | Comment permalink |
| ↳ `body` | string | Comment body text |
### `reddit_edit`
Edit the text of your own Reddit post or comment
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `thing_id` | string | Yes | Thing fullname to edit \(e.g., "t3_abc123" for post, "t1_def456" for comment\) |
| `text` | string | Yes | New text content in markdown format \(e.g., "Updated **content** here"\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the edit was successful |
| `message` | string | Success or error message |
| `data` | object | Updated content data |
| ↳ `id` | string | Edited thing ID |
| ↳ `body` | string | Updated comment body \(for comments\) |
| ↳ `selftext` | string | Updated post text \(for self posts\) |
### `reddit_delete`
Delete your own Reddit post or comment
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | string | Yes | Thing fullname to delete \(e.g., "t3_abc123" for post, "t1_def456" for comment\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the deletion was successful |
| `message` | string | Success or error message |
### `reddit_subscribe`
Subscribe or unsubscribe from a subreddit
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `subreddit` | string | Yes | The subreddit to subscribe to or unsubscribe from \(e.g., "technology", "programming"\) |
| `action` | string | Yes | Action to perform: "sub" to subscribe or "unsub" to unsubscribe |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the subscription action was successful |
| `message` | string | Success or error message |