mcpField
G
google-trends

google-trends

github.com/finpeakincMarketing & growth2134 installsUpdated 6d ago
Repository

About google-trends

A skill for retrieving Google Trends data through Frevana. It accepts a search query and optional filters, validates the JSON response, saves it locally, and returns it unchanged.

Key features

  1. 01Query Google Trends through Frevana
  2. 02Filter by region, category, date, property, language, and timezone
  3. 03Validate response JSON
  4. 04Save response JSON to a file

Use cases

  1. 01Retrieve trend data for a search query
  2. 02Compare a query across a specified region or date range
  3. 03Save raw results for later analysis

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/finpeakinc/frevana-skills --skill google-trends

After installing, type/google-trendsin Claude Code to confirm it loaded.

Bundled filesevals/evals.jsonscripts/search_google_trends.sh

Details

From the project README

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_TOKEN in the environment variables, or an explicit --token override for the current run
  • curl
  • bash
  • python3

Execution Order

Use this flow so the request stays simple and reliable:

  1. Confirm the user has provided q or an equivalent trend search query.
  2. Prefer the script over ad hoc curl commands.
  3. Let the script read FREVANA_TOKEN first.
  4. In interactive shell usage, if FREVANA_TOKEN is missing, the script may prompt for it.
  5. In non-interactive or agent workflows, fail fast if the token is missing and tell the user to set FREVANA_TOKEN or pass --token explicitly.
  6. Run the script once. It prints the validated JSON to stdout and saves the same JSON to a file.
  7. Use the saved JSON file for any follow-up parsing or summarization instead of calling the trends API again.
  8. 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 --q or --query
  • Use --geo only when the user requests a country/region code for Trends
  • Use --cat only when the user provides a category id
  • Use --date only when the user provides a date range
  • Use --gprop only when the user requests a Google property such as images, news, youtube, or froogle
  • Use --hl only when the user requests a language code
  • Use --tz only when the user provides a timezone offset in minutes
  • If curl is missing, stop and tell the user to install curl
  • If python3 is missing, stop and tell the user to install python3
  • 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"

Comments

Markdown supported