> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reddit

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

## Prerequisites

```shell theme={null}
uv pip install praw openai
```

```shell theme={null}
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:

```python theme={null}
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)
```

## Toolkit Params

| Parameter            | Type                    | Default              | Description                                                                 |
| -------------------- | ----------------------- | -------------------- | --------------------------------------------------------------------------- |
| `reddit_instance`    | `Optional[praw.Reddit]` | `None`               | Existing Reddit instance to use.                                            |
| `client_id`          | `Optional[str]`         | `None`               | Reddit client ID. Uses REDDIT\_CLIENT\_ID if not set.                       |
| `client_secret`      | `Optional[str]`         | `None`               | Reddit client secret. Uses REDDIT\_CLIENT\_SECRET if not set.               |
| `user_agent`         | `Optional[str]`         | `"RedditTools v1.0"` | User agent string for API requests. Uses REDDIT\_USER\_AGENT if not set.    |
| `username`           | `Optional[str]`         | `None`               | Reddit username for authenticated access. Uses REDDIT\_USERNAME if not set. |
| `password`           | `Optional[str]`         | `None`               | Reddit password for authenticated access. Uses REDDIT\_PASSWORD if not set. |
| `allowed_subreddits` | `Optional[List[str]]`   | `None`               | Restrict write operations to these subreddits.                              |

## Toolkit Functions

| Function                  | Description                                             |
| ------------------------- | ------------------------------------------------------- |
| `get_user_info`           | Get information about a Reddit user.                    |
| `get_top_posts`           | Get top posts from a subreddit for a given time period. |
| `get_subreddit_info`      | Get information about a specific subreddit.             |
| `get_trending_subreddits` | Get currently trending subreddits.                      |
| `get_subreddit_stats`     | Get statistics about a subreddit.                       |
| `create_post`             | Create a new post (requires authentication).            |
| `reply_to_post`           | Reply to a post (requires authentication).              |
| `reply_to_comment`        | Reply 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](/tools/selecting-tools).

## Developer Resources

* [Tools Source](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/reddit.py)
* [Reddit API Documentation](https://www.reddit.com/dev/api/)
* [PRAW Documentation](https://praw.readthedocs.io/)
