Skip to main content

Reddit trend analysis for content creators

Project description

TrendSleuth

From Reddit signals to validated ideas

License: MIT Python 3.12+ codecov

TrendSleuth analyzes Reddit conversations to uncover emerging trends, pain points, and unanswered questions and turns those insights into actionable content, product, and business ideas.

Anaylsis screenshot

Features

  • ๐Ÿ” Auto-discover subreddits - Find relevant communities for your niche
  • ๐Ÿ“Š AI-powered analysis - Extract topics, pain points, and questions
  • ๐Ÿ”— Evidence collection - Gather verbatim quotes from Reddit and web sources
  • ๐Ÿ’ก Niche generation - Generate specific niche ideas for any theme
  • ๐ŸŽฏ Idea generation - Transform analysis into business, app, or content ideas
  • ๐Ÿ“ Markdown & JSON output - Get results in your preferred format
  • ๐ŸŒ Web evidence - Search the web using Brave Search API for additional insights
  • ๐Ÿ’ฐ Cost tracking - See token usage and estimated API costs
  • ๐Ÿš€ Fast & efficient - Process hundreds of posts and comments quickly
  • ๐Ÿ“บ Rich terminal UI - Beautiful progress indicators and results

Installation

Prerequisites

  • Python 3.12 or higher
  • Reddit API credentials
  • OpenAI API key

Quick Install (from PyPI)

# Using pip
pip install trendsleuth

# Or using pipx (recommended for CLI tools)
pipx install trendsleuth

# Or using uv
uv tool install trendsleuth

Install from Source

If you want the latest development version:

# Clone the repository
git clone https://github.com/lukemaxwell/trendsleuth.git
cd trendsleuth

# Install with uv (recommended)
uv sync

# Activate the virtual environment
source .venv/bin/activate  # Linux/macOS
# or
.venv\Scripts\activate     # Windows

# Install in development mode
uv pip install -e .

Alternative: Install from source with pip

# Clone the repository
git clone https://github.com/lukemaxwell/trendsleuth.git
cd trendsleuth

# Create a virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/macOS
# or
.venv\Scripts\activate     # Windows

# Install dependencies
pip install -e .

Configure API Keys

# Set environment variables
export REDDIT_CLIENT_ID="your_reddit_client_id"
export REDDIT_CLIENT_SECRET="your_reddit_client_secret"
export REDDIT_USER_AGENT="TrendSleuth/0.1.0"
export OPENAI_API_KEY="your_openai_api_key"

# Optional: For web evidence gathering
export BRAVE_API_KEY="your_brave_api_key"

Get API Credentials:

Usage

Analyze Trends

Basic trend analysis:

trendsleuth analyze "ai agents"

With evidence from Reddit:

trendsleuth analyze "ai agents" --include-evidence

With web evidence from Brave Search:

trendsleuth analyze "ai agents" --include-evidence --include-web

Advanced Analysis Options

# Analyze specific subreddits
trendsleuth analyze "machine learning" \
  --subreddits r/MachineLearning,r/ArtificialIntel,r/learnmachinelearning

# Save results to a file
trendsleuth analyze "content creation" \
  --output report.md

# Get JSON output with evidence
trendsleuth analyze "photography" \
  --format json \
  --include-evidence

# Adjust analysis depth and web evidence
trendsleuth analyze "gaming" \
  --limit 100 \
  --include-web \
  --web-evidence-limit 20 \
  --web-results-per-query 10

Generate Niche Ideas

Generate niche ideas for a theme:

trendsleuth niches --theme "productivity"

With custom count:

trendsleuth niches --theme "fitness" --count 25

JSON output:

trendsleuth niches --theme "travel" --json

Generate Ideas from Analysis

Transform TrendSleuth analysis into actionable business, app, or content ideas:

# Generate business ideas from analysis
trendsleuth ideas --input analysis.json --type business --count 3

# Generate app ideas
trendsleuth ideas --input analysis.md --type app --count 5

# Generate content ideas
trendsleuth ideas --input report.json --type content --count 10

# Get JSON output
trendsleuth ideas --input analysis.json --type business --format json

Idea types:

  • business: Complete business concepts with monetization, validation, etc.
  • app: Product/MVP ideas with features and scope
  • content: High-engagement content ideas for social media

Full Command Reference

Analyze Command

Usage: trendsleuth analyze [OPTIONS] NICHE

Arguments:
  NICHE              The niche or topic to analyze

Options:
  -s, --subreddits TEXT          Comma-separated list of subreddits
  -o, --output PATH              Output file path
  -l, --limit INTEGER            Maximum posts to analyze (default: 50)
  -f, --format [markdown|json]   Output format (default: markdown)
  --model TEXT                   OpenAI model (default: gpt-4o-mini)
  --include-evidence             Include evidence with verbatim quotes
  --include-web                  Gather web evidence using Brave Search
  --web-evidence-limit INTEGER   Max web evidence items (default: 15)
  --web-results-per-query INT    Brave results per query (default: 5)
  --web-rate-limit-rps FLOAT     Brave API rate limit RPS (default: 1.0)
  -v, --verbose                  Enable verbose output
  --help                         Show this message and exit

Niches Command

Usage: trendsleuth niches [OPTIONS]

Options:
  --theme TEXT         Topic or domain to generate niches for (required)
  --count INTEGER      Number of niches to generate (default: 15)
  --json               Output as JSON array
  --model TEXT         OpenAI model (default: gpt-4o-mini)
  --help               Show this message and exit

Ideas Command

It is highly recommended to use the best models available for idea generation, e.g. gpt-5.2.

Usage: trendsleuth ideas [OPTIONS]

Options:
  --input TEXT         Path to TrendSleuth analysis file (JSON or Markdown) (required)
  --type TEXT          Type of ideas: business, app, or content (default: business)
  --count INTEGER      Number of ideas to generate (default: 1)
  --format TEXT        Output format: md or json (default: md)
  --model TEXT         OpenAI model (default: gpt-4o-mini)
  --help               Show this message and exit

Configuration Commands

# Show current configuration
trendsleuth config --show

Output Examples

Analyze Command Output

# Trend Analysis: ai agents

**Generated at:** 2026-02-23 15:30:45

## Summary

The AI agents community shows strong enthusiasm for autonomous agents, with 
significant focus on LLM integration and practical applications across various 
industries. Users express excitement about rapid advancements while concerned 
about accessibility and implementation complexity.

## Trending Topics

1. Autonomous AI agents
2. LLM-powered workflows
3. Multi-agent systems
4. AI coding assistants
5. Customer service automation
6. Creative AI tools
7. AI agent frameworks
8. Agent orchestration
9. AI safety and alignment
10. Enterprise AI adoption

## Pain Points

1. High computational costs
2. Complex setup and configuration
3. Lack of comprehensive documentation
4. Integration with existing tools
5. Model selection confusion
6. Security concerns
7. Cost management

## Questions & Curiosities

1. How to get started with AI agents?
2. What are the best frameworks for building agents?
3. How do I choose the right LLM for my agent?
4. What are best practices for agent orchestration?
5. How can I reduce costs while maintaining performance?
6. What security measures are essential?
7. Are there enterprise-grade AI agent solutions?

## Evidence (Recent)

- [2024-02-20] [REDDIT] "The setup process is way too complicated for beginners..." โ€” https://reddit.com/r/ai/...
- [2024-02-19] [WEB] "Cost management is a huge issue when running multiple agents..." โ€” https://example.com/...
- [unknown] [WEB] "Documentation is severely lacking for most frameworks." โ€” https://example.com/...

## Metrics

- **Total tokens used:** 12,345
- **Estimated cost:** $0.0315

Niches Command Output

$ trendsleuth niches --theme "productivity" --count 5
1. AI-powered meeting summarization tools
2. Focus mode apps for remote workers
3. Habit tracking with behavioral psychology
4. Time blocking calendars for ADHD users
5. Automated workflow builders for solopreneurs

With JSON output:

$ trendsleuth niches --theme "productivity" --count 3 --json
[
  "AI-powered meeting summarization tools",
  "Focus mode apps for remote workers",
  "Habit tracking with behavioral psychology"
]

Ideas Command Output

$ trendsleuth ideas --input analysis.json --type business --count 2
## Idea 1

**AgentStack Pro**

_All-in-one platform for deploying and managing AI agents at scale_

**Target Customer:** Mid-size companies (50-500 employees) wanting to implement AI agents without hiring specialized ML engineers

**Core Pain:** High computational costs and complex setup make AI agents inaccessible to most businesses

**Product:** Managed platform that handles infrastructure, provides pre-built agent templates, and includes monitoring/cost optimization tools

**Why Existing Solutions Fail:** Current solutions require deep technical expertise and force companies to build everything from scratch

**Monetization:** Usage-based pricing with enterprise support tiers

**Pricing:** Free tier (1 agent, 10k messages/month), Pro at $99/month (5 agents, 100k messages), Enterprise custom pricing

**Validation Strategy:** Launch with 3 pre-built agent templates (customer support, sales assistant, content writer). Partner with 5 beta companies for case studies. Success metric: 50+ signups in first month with 20% converting to paid.

## Idea 2

**Agent Cost Optimizer**

_SaaS tool that automatically reduces AI agent operational costs by 40-60%_

**Target Customer:** Companies already running AI agents who are struggling with unpredictable and high costs

**Core Pain:** Cost management is a huge challenge when running multiple agents with different LLM providers

**Product:** Dashboard that analyzes agent usage patterns, recommends model optimizations, implements caching strategies, and auto-routes queries to most cost-effective models

**Why Existing Solutions Fail:** No dedicated tools exist for AI agent cost optimization - companies do this manually and miss significant savings

**Monetization:** Revenue share model - we take 20% of the savings we generate

**Pricing:** Free audit, then 20% of monthly savings (minimum $299/month)

**Validation Strategy:** Offer free cost audits to 20 companies from r/LocalLLaMA and r/ArtificialIntelligence. Show concrete savings projections. Success metric: 5+ companies sign LOIs.

App ideas output:

$ trendsleuth ideas --input analysis.md --type app --count 1
## Idea 1

**AgentLab**

**Target User:** Developers and technical founders who want to experiment with AI agents without infrastructure overhead

**Problem:** Setting up AI agent development environments is complex, time-consuming, and expensive

**Core Features:**
- One-click agent templates (customer service, research, coding assistant)
- Visual workflow builder for agent orchestration
- Built-in testing sandbox with mock data
- Cost tracking per agent and per conversation
- One-click deployment to production

**Unique Value:** Get from idea to working agent prototype in under 30 minutes without touching infrastructure code

**MVP Scope:** Build template system with 3 pre-configured agents, basic visual editor, and local testing. No deployment features in MVP. 8-10 weeks to ship.

**Monetization:** Free tier (local testing only), Pro $29/month (cloud hosting, 10k messages), Team $99/month (unlimited)

Content ideas output:

$ trendsleuth ideas --input analysis.json --type content --count 1
## Idea 1

**I spent $12,000 on AI agents so you don't have to: The brutal truth about costs**

**Format:** Long-form Twitter/X thread (15-20 tweets) with cost breakdown screenshots

**Target Audience:** Founders, indie hackers, and developers considering implementing AI agents

**Angle:** Expose the hidden costs everyone ignores: API fees compound fast, memory/context management is expensive, failed requests still cost money, and most agents are over-engineered. Share exact cost breakdowns and lessons learned.

**Why It Works:** Combines fear (cost warnings) + value (concrete data) + authority (real experience). Screenshots of bills make it credible. Helps people avoid expensive mistakes. High save/share potential from people wanting to reference it later.

Development

Contributing

If you want to contribute to TrendSleuth development, follow these steps:

# Clone the repository
git clone https://github.com/lukemaxwell/trendsleuth.git
cd trendsleuth

# Install with uv (recommended for development)
uv sync

# Activate the virtual environment
source .venv/bin/activate  # Linux/macOS
# or
.venv\Scripts\activate     # Windows

# The project is automatically installed in editable mode

Note: The installation instructions above already install TrendSleuth in development mode (-e flag), so you don't need to do anything extra.

Running Tests

uv run pytest

Code Quality

# Linting
uv run ruff check .

# Type checking (if configured)
uv run mypy .

Project Structure

trendsleuth/
โ”œโ”€โ”€ src/trendsleuth/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ cli.py          # CLI entry point
โ”‚   โ”œโ”€โ”€ config.py       # Configuration management
โ”‚   โ”œโ”€โ”€ reddit.py       # Reddit API client
โ”‚   โ”œโ”€โ”€ analyzer.py     # LLM-based analysis
โ”‚   โ”œโ”€โ”€ ideas.py        # Idea generation from analysis
โ”‚   โ”œโ”€โ”€ formatter.py    # Output formatting
โ”‚   โ”œโ”€โ”€ brave.py        # Brave Search API client
โ”‚   โ”œโ”€โ”€ web_scraper.py  # Web page text extraction
โ”‚   โ””โ”€โ”€ web_evidence.py # Web evidence gathering
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ test_reddit.py
โ”‚   โ”œโ”€โ”€ test_analyzer.py
โ”‚   โ”œโ”€โ”€ test_ideas.py
โ”‚   โ””โ”€โ”€ test_formatter.py
โ”œโ”€โ”€ examples/
โ”‚   โ””โ”€โ”€ sample-output.md
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

License

MIT License - See LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Acknowledgments

  • Built with Typer for the CLI
  • Powered by PRAW for Reddit API access
  • AI analysis via LangChain + OpenAI

Happy analyzing! ๐Ÿ“Š๐Ÿค–

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trendsleuth-0.1.0.tar.gz (216.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trendsleuth-0.1.0-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file trendsleuth-0.1.0.tar.gz.

File metadata

  • Download URL: trendsleuth-0.1.0.tar.gz
  • Upload date:
  • Size: 216.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for trendsleuth-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1b753b4fbc15c9f6e3415bec55ff48ef3329fceed6045dbf77bcb2e54bd3d3db
MD5 f6996f89d31d8c21ad707f2dbd64bdbb
BLAKE2b-256 34633145bd8b099ac180dba994ca7c355240ba6292caceebcb1a53da3b07d2c3

See more details on using hashes here.

File details

Details for the file trendsleuth-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: trendsleuth-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for trendsleuth-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56656652137bd7d7de1d1737ff90d3f399c5f2713088d2837f4dc7f85b4c7160
MD5 e09b3c1b229dc1d9edbcbb4738eb2fb5
BLAKE2b-256 454e30aad1620aa3bd33e9423e515b5568e893b274db77cdc1238b175381d58b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page