Inspiration

I noticed creators and marketers jumping on trends that were already fading — posting content when interest was already declining. That sparked an idea: what if you could predict when a trend would die? Trend-Track forecasts the full lifecycle of any Google Trends topic, so users know exactly when to jump in and when to jump out.

How I Built It

Trend-Track is a modular pipeline: Google Trends → Prophet ML → Phase classification → Death detection → Interactive visualization.

Data Fetching: I use pytrends to pull 5 years of weekly interest scores from Google Trends, with a curated fallback topic list to handle API instability.

Caching & Persistence:

  • MongoDB Atlas caches fresh results with 24-hour TTL to avoid redundant API calls

ML Forecasting: Facebook Prophet decomposes each trend into trend, seasonality, and error components, then forecasts ~365 days ahead. I auto-tune Prophet's changepoint sensitivity based on trend volatility.

Death Detection: A trend is "dead" when predicted interest drops below 10 (out of 100) for 4 consecutive weeks, avoiding false positives.

AI Reports: GROQ API generates natural-language trend analysis reports directly in the UI using its high-speed chat completions.

Frontend: Streamlit powers the web app with interactive Plotly charts showing historical data, forecasts, confidence bands, and death dates. Users can search keywords, browse trending topics, view metrics, and download CSV exports.

Logging: loguru provides clean, color-coded logging while silencing noisy dependencies.

Key Challenges

  1. Google Trends instability — Solved with MongoDB caching and fallback lists
  2. False death predictions — Required 4 consecutive weeks below threshold
  3. Prophet tuning — Auto-tuned based on trend volatility
  4. Performance — Cached queries + fire-and-forget S3/Snowflake writes keep the UI responsive
Share this project:

Updates