Skip to main content
📈 PART 1 OF 5

Google Trends Intelligence — Search Interest as a Leading Indicator

ℹ️ Informational only. Alternative data sources vary in accuracy and timeliness. Nothing here is investment advice. Always verify data independently before making any decisions.

Why Google Trends?

Search interest often moves 4–6 weeks before earnings surprises. When people search for a brand more, they're engaging with it more — buying, researching, or reacting to a product launch. pytrends is a free, unofficial Python wrapper around the Google Trends API. No key required.

What to Track

HEARTBEAT Configuration

name: trends_monitor
schedule: "0 8 * * 1"
steps:
  - fetch_trends:
      keywords:
        - "Apple"
        - "Samsung"
        - "Google Pixel"
      timeframe: "today 3-m"
      geo: "US"
  - compare:
      baseline: 12_week_average
      flag_if_change_pct_exceeds: 25
  - llm:
      prompt: |
        Analyze these Google Trends results for my watchlist.
        Flag any keyword showing unusual acceleration or deceleration vs baseline.
        Data: {{ trends_data }}
  - notify:
      channel: email
      subject: "📈 Weekly Trends Brief — {{ date }}"

pytrends Python Implementation

Core Function: Fetch Brand Trends

from pytrends.request import TrendReq
import pandas as pd

def get_brand_trends(keywords: list, timeframe: str = "today 3-m", geo: str = "US"):
    pytrends = TrendReq(hl="en-US", tz=360)
    pytrends.build_payload(keywords, timeframe=timeframe, geo=geo)
    df = pytrends.interest_over_time()
    if "isPartial" in df.columns:
        df = df.drop(columns=["isPartial"])
    return df

# Compare current week vs 12-week average
def trend_velocity(df: pd.DataFrame) -> dict:
    results = {}
    for col in df.columns:
        recent = df[col].iloc[-1]
        baseline = df[col].iloc[-13:-1].mean()
        pct_change = ((recent - baseline) / baseline) * 100 if baseline > 0 else 0
        results[col] = {"recent": recent, "baseline": round(baseline, 1), "change_pct": round(pct_change, 1)}
    return results

Competitor Comparison

def compare_competitors(brand: str, competitors: list, timeframe: str = "today 12-m"):
    all_keywords = [brand] + competitors
    # Google Trends allows max 5 keywords at once
    chunks = [all_keywords[i:i+5] for i in range(0, len(all_keywords), 5)]
    frames = []
    pytrends = TrendReq(hl="en-US", tz=360)
    for chunk in chunks:
        pytrends.build_payload(chunk, timeframe=timeframe, geo="US")
        df = pytrends.interest_over_time()
        frames.append(df)
    return pd.concat(frames, axis=1).loc[:, ~pd.concat(frames, axis=1).columns.duplicated()]

Limitations

Important: Google Trends returns relative interest (0–100), not absolute search volume. It's best used for directional signals and relative comparisons, not absolute demand forecasting.

Frequently Asked Questions

Q: Is pytrends official?

No — it's an unofficial wrapper. Google doesn't provide an official Trends API. It's widely used but could break if Google changes their backend.

Q: How often can I poll Google Trends?

Rate limit gently — no more than a few requests per minute. Build in sleep() between calls.

Q: Can I track rising searches automatically?

Yes, pytrends has a related_queries() method that surfaces breakout and rising associated terms.

Next Steps

Now that you understand how to automate Google Trends monitoring, move to Part 2: Job Posting Intelligence to layer hiring signals on top of search trends. The combination of rising brand search interest plus aggressive hiring is a powerful convergent signal.