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

# Reddit Tools

## Code

```python cookbook/tools/reddit_tools.py 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",
    ],
    tools=[RedditTools()],
    markdown=True,
)

agent.print_response("Show me the top posts from r/technology today")
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Set your credentials">
    ```bash theme={null}
    export REDDIT_CLIENT_ID=your-reddit-client-id
    export REDDIT_CLIENT_SECRET=your-reddit-client-secret
    export REDDIT_USER_AGENT=YourApp/1.0
    export OPENAI_API_KEY=xxx
    ```
  </Step>

  <Step title="Install libraries">
    ```bash theme={null}
    pip install -U praw openai agno
    ```
  </Step>

  <Step title="Run Agent">
    <CodeGroup>
      ```bash Mac theme={null}
      python cookbook/tools/reddit_tools.py
      ```

      ```bash Windows theme={null}
      python cookbook/tools/reddit_tools.py
      ```
    </CodeGroup>
  </Step>
</Steps>
