history_sql
Run read-only SQL SELECT queries on saved Google Trends history to answer custom questions beyond built-in history tools. Query trending, snapshots, watchlists, and readings data.
Instructions
Run a read-only SQL SELECT on the local data file, for questions the other history tools do not cover.
Tables: trending(geo, title, qkey, started, ended, volume, growth, categories, breakdown, first_seen, last_seen) — one row per saved trend; times are unix seconds UTC; categories and breakdown are JSON lists. snapshots(id, taken_at, geo, hours, trends) — one row per snapshot_trending run. watchlist(keyword, geo, note, added_at) readings(keyword, geo, taken_at, latest, average, yoy, label) — one row per watchlist_report measurement. Example: SELECT title, volume, datetime(started,'unixepoch') FROM trending WHERE geo='US' ORDER BY volume DESC LIMIT 20
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |