I build monthly niche reports from US Google Trends data. The Pets report and the upcoming Garden & Outdoors one broke my junk filter in a way worth writing down.
The problem: real places that share a topic word
Google Trends' rising related searches for "aquarium" (Pets) were full of places, not products:
- "monterey bay aquarium", "shedd aquarium", "ripley's aquarium"
- "aquarium restaurant", "columbus zoo"
(More on the aquarium data here.)
For "grill" (Garden & Outdoors) it was restaurant chains: "firebirds", "burtons grill", "carrabba", "eggs up grill", "grill 23".
None of these are niches anyone can sell into. All of them share a word with a real topic.
Why a word blocklist failed
My first filter blocked single words: "lyrics", "tour", "laptop" and so on (the original filter is here). Adding words for this batch would have done damage:
- blocking "eggs" (for "eggs up grill") would also drop real garden searches about hens and eggs
- blocking "boston" (for "boston aquarium") would also drop "boston terrier" in a pets report
So the fix was a per-theme list of phrases, kept in a JSON file next to the code:
{
"_note": "phrases, matched as substrings, per theme",
"Garden & Outdoors": ["firebirds", "burtons grill", "carrabba", "eggs up grill", "grill 23"],
"Pets": ["monterey bay aquarium", "shedd aquarium", "ripley's aquarium", "aquarium restaurant", "columbus zoo"]
}
import json, re
from pathlib import Path
def theme_excludes(path: Path) -> set[str]:
d = json.loads(path.read_text(encoding="utf-8"))
return {
p.lower()
for key, phrases in d.items()
if not key.startswith("_") and isinstance(phrases, list)
for p in phrases
if len(p) >= 4
}
def off_topic(query: str, blocked_words: set[str], blocked_phrases: set[str]) -> bool:
q = query.lower()
words = set(re.findall(r"[a-z0-9']+", q))
return bool(words & blocked_words) or any(p in q for p in blocked_phrases)
The bug I hit on the way
The first version looped over every value in the JSON. The "_note" value is a string, so iterating it yielded single characters: "p", "h", "r"... and any(p in q for p in phrases) flagged every query as off-topic.
Three guards fixed it, and they are all in the code above:
- skip keys starting with
_ - only read values that are lists
- ignore phrases shorter than 4 characters
If you keep blocklists in config files, an empty-output test catches this class of mistake fast.
Update: all five reports in one bundle
The five reports (Beauty & Skincare, Pets, Fitness & Wellness, Home & Kitchen, Home Office & Tech) are now available as one bundle: Rising Niches: All 5 Reports, €29 instead of €55 bought separately. Code LAUNCH30 takes 30% off any order.
If you'd rather pull the data yourself: Google Trends API on RapidAPI or the Google Trends Scraper on Apify.
Limits: Google Trends values are relative interest, not search counts.
Top comments (0)