Google Trends
Query Google Trends through Frevana.
Purpose
This skill is for retrieving Google Trends results.
Inputs:
q- optional
geo - optional
cat - optional
date - optional
gprop - optional
hl - optional
tz
Output:
- validated response JSON with Google Trends results
- the same validated JSON saved to a local file on every successful run
This skill validates that the response is JSON, saves it to disk, and returns it unchanged on stdout. Do not rewrite or reshape the returned data unless the user explicitly asks for a transformation.
What This Skill Needs
- user-provided
q - optional
geo - optional
cat - optional
date - optional
gprop - optional
hl - optional
tz FREVANA_TOKENin the environment variables, or an explicit--tokenoverride for the current runcurlbashpython3
Execution Order
Use this flow so the request stays simple and reliable:
- Confirm the user has provided
qor an equivalent trend search query. - Prefer the script over ad hoc
curlcommands. - Let the script read
FREVANA_TOKENfirst. - In interactive shell usage, if
FREVANA_TOKENis missing, the script may prompt for it. - In non-interactive or agent workflows, fail fast if the token is missing and tell the user to set
FREVANA_TOKENor pass--tokenexplicitly. - Run the script once. It prints the validated JSON to stdout and saves the same JSON to a file.
- Use the saved JSON file for any follow-up parsing or summarization instead of calling the trends API again.
- Return the validated response JSON, or summarize the trend data if the user does not need the full payload.
Commands
Basic trends query
bash <skill-path>/scripts/search_google_trends.sh \
--q "home treadmill"
--query is accepted as an alias for --q.
Query with region, date range, language, and timezone
bash <skill-path>/scripts/search_google_trends.sh \
--q "home treadmill" \
--geo US \
--date "today 12-m" \
--hl en \
--tz 420
Query with category and Google property
bash <skill-path>/scripts/search_google_trends.sh \
--q "running shoes" \
--cat 18 \
--gprop images
Save response JSON to a specific file
bash <skill-path>/scripts/search_google_trends.sh \
--q "home treadmill" \
--geo US \
--output ./out/google-trends-result.json
Token override for the current run
bash <skill-path>/scripts/search_google_trends.sh \
--q "home treadmill" \
--token "your bearer token"
Fixed Request Shape
The script sends this payload shape, omitting optional fields that were not provided:
{
"q": "home treadmill",
"geo": "US",
"cat": "18",
"date": "today 12-m",
"gprop": "images",
"hl": "en",
"tz": "420"
}
Only q is required. Do not invent geo, cat, date, gprop, hl, or tz values when the user did not provide them.
Response Shape
The API returns Frevana JSON. This skill validates the response as JSON and returns it unchanged.
Output
- Success: the script validates that the response body is JSON, writes it to a file, prints the saved path to stderr, and prints the JSON to stdout
- Default file path:
./out/google-trends-<UTC timestamp>-<pid>.json - With
--output: the same JSON is written to the specified file path instead of the default path - Failure: the script prints the response body or parsing error and exits non-zero
Notes
- Require
--qor--query - Use
--geoonly when the user requests a country/region code for Trends - Use
--catonly when the user provides a category id - Use
--dateonly when the user provides a date range - Use
--gproponly when the user requests a Google property such as images, news, youtube, or froogle - Use
--hlonly when the user requests a language code - Use
--tzonly when the user provides a timezone offset in minutes - If
curlis missing, stop and tell the user to installcurl - If
python3is missing, stop and tell the user to installpython3 - Do not echo the Bearer token back to the user
- Summarize the trend results the user actually cares about instead of dumping raw JSON unless they ask for the full payload
Example Prompts
中文
- "查询 Google Trends 上 home treadmill 的趋势"
- "查一下 Google Trends 里 q=家庭跑步机,geo=US,date=today 12-m,hl=en"
- "用 Google Trends 看 running shoes 在美国过去 12 个月的趋势,并保存原始 JSON"
English
- "Search Google Trends for home treadmill"
- "Look up Google Trends for running shoes with geo=US and date=today 12-m"
- "Query Google Trends for coffee maker in the shopping property and save the raw JSON"