Reddit

RedditTools enables agents to interact with Reddit for browsing posts, comments, and subreddit information.

Prerequisites

uv pip install agno praw openai
export REDDIT_CLIENT_ID=***
export REDDIT_CLIENT_SECRET=***

Write operations (create_post, reply_to_post, reply_to_comment) also require REDDIT_USERNAME and REDDIT_PASSWORD.

Example

The following agent can browse and analyze Reddit content:

from agno.agent import Agent
from agno.tools.reddit import RedditTools

agent = Agent(
    instructions=[
        "You are a Reddit content analyst that helps explore and understand Reddit data",
        "Browse subreddits, analyze posts, and provide insights about discussions",
        "Respect Reddit's community guidelines and rate limits",
        "Provide clear summaries of Reddit content and trends",
    ],
    tools=[RedditTools()],
)

agent.print_response("Show me the top posts from r/technology today", stream=True)

Authentication and write limitations

Use explicit constructor credentials for write operations. Injecting a reddit_instance works for reads, but the current write-auth check accesses unset username and password attributes and can fail before making the request. The optional create_post flair path also confuses flair text with its provider ID; omit flair until that adapter path is corrected.

get_trending_subreddits lists popular subreddits; it does not call a separate trending endpoint.

Toolkit Params

ParameterTypeDefaultDescription
reddit_instanceOptional[praw.Reddit]NoneExisting Reddit instance to use.
client_idOptional[str]NoneReddit client ID. Uses REDDIT_CLIENT_ID if not set.
client_secretOptional[str]NoneReddit client secret. Uses REDDIT_CLIENT_SECRET if not set.
user_agentOptional[str]"RedditTools v1.0"User agent string for API requests. Uses REDDIT_USER_AGENT if not set.
usernameOptional[str]NoneReddit username for authenticated access. Uses REDDIT_USERNAME if not set.
passwordOptional[str]NoneReddit password for authenticated access. Uses REDDIT_PASSWORD if not set.
allowed_subredditsOptional[List[str]]NoneRestrict write operations to these subreddits.

Toolkit Functions

FunctionDescription
get_user_infoGet information about a Reddit user.
get_top_postsGet top posts from a subreddit for a given time period.
get_subreddit_infoGet information about a specific subreddit.
get_trending_subredditsGet currently trending subreddits.
get_subreddit_statsGet statistics about a subreddit.
create_postCreate a new post (requires authentication).
reply_to_postReply to a post (requires authentication).
reply_to_commentReply to a comment (requires authentication).

You can use include_tools or exclude_tools to modify the list of tools the agent has access to. Learn more about selecting tools.

Developer Resources