DEV Community

Matthew Curtis
Matthew Curtis

Posted on

How to Track Competitors on Google Trends Automatically (No Browser, $0.035 a Run)

TL;DR — Google Trends has no official API, and browser-based scrapers fail half the time. This tutorial shows how to get competitor search-interest data (12-month trend, US state ranking, rising and Breakout queries) for five brands in one 21-second run costing $0.035, and how to turn it into a weekly Slack alert for about $0.07 a week. Every number below comes from a real run on 2026-11-08.

Who this is for: SEO and content teams, brand and category managers, market researchers, and anyone building an AI agent that needs a quick "is this brand trending?" answer.

Why automate Google Trends competitor analysis?

Google Trends is the cheapest competitive-intelligence source there is. It tells you when demand for a competitor peaks, where in the country they are strongest, and which new product names people have started searching for — weeks before that shows up in sales data.

The problem is getting the data out. There is no official Google Trends API, the unofficial Python libraries break every few months, and browser-based scrapers are slow and get rate-limited. The approach here calls the same JSON endpoints the Trends website uses, so a brand's full series arrives in about two seconds and the run pays per record.

We'll use five US running-shoe brands as the example — Hoka, Brooks, ASICS, New Balance and On — but the input works for any category: SaaS tools, car models, skincare lines, podcast names.

Step 1: Set up the Google Trends scraper input

Open Google Trends Scraper on Apify (free account, no credit card for the first runs), switch the input to the JSON tab and paste:

{
  "keywords": ["hoka", "brooks running", "asics", "new balance", "on running"],
  "geo": "US",
  "timeRange": "today 12-m",
  "datasets": ["interestOverTime", "interestByRegion", "relatedQueries"],
  "maxItems": 50
}
Enter fullscreen mode Exit fullscreen mode

Three tips before you press Start:

  1. Type brand names the way searchers do — brooks running, not Brooks Running Company.
  2. Watch common-word brands. on running is also plain English; the related-queries list will show you how much noise that adds (see Step 3).
  3. Pick the right time range. today 12-m gives weekly points for a year; today 3-m gives daily points and is the better choice for monitoring (Step 4).

Prefer code? The same input works via the API:

curl -X POST "https://api.apify.com/v2/acts/mdcurt~google-trends-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" -d @input.json
Enter fullscreen mode Exit fullscreen mode

Step 2: Run it (21 seconds, $0.035)

The run returns 15 records: for each of the 5 brands one interestOverTime record, one interestByRegion record and one relatedQueries record. In the sample run: 20/20 requests OK, 0 rate limits, 0 blocked pages, first record after 7 s, 19 compute-seconds on a 256 MB run. Price: 15 records × $0.002 + $0.005 start = $0.035.

You can download the result as JSON, CSV or Excel from the run's Dataset tab.

Step 3: Read the competitor data (real numbers, 2026-11-08)

One rule first: Google Trends values are relative. Each keyword is indexed on its own, so 100 means that brand's own busiest week in the period. Compare shapes and ratios within a brand, not bar heights across brands.

Brand 12-month average Peak week Latest (week of 2026-11-08) Latest ÷ average Top-3 states after Wyoming* Rising queries flagged Breakout
on running 69.6 2026-04-12 60 0.86 Kansas 41, Oklahoma 37, Alabama 35 1 of 22
asics 48.9 2026-04-12 40 0.82 Delaware 28, DC 27, New York 26 2 of 25 (asics men's gel-nimbus 28, asics hypersync)
hoka 47.7 2026-04-12 33 0.69 Hawaii 35, California 31, Alabama 28 0 of 25 (top riser hoka cielo x1 3.0, +3,900 %)
new balance 46.2 2026-04-12 34 0.74 Massachusetts 23, DC 22, California 21 3 of 24 (new balance men's 1080v15, women's 1080v15, fresh foam x more v6)
brooks running 25.2 2026-04-12 12 0.48 Washington 18, DC 17, Nebraska 17 2 of 4 (brooks adrenaline gts 25, brooks women's adrenaline gts 25 running shoes)

What this table tells a category manager in one minute:

  • Seasonality is shared. All five brands peaked in the same week (2026-04-12, spring-marathon season) and all five are below their yearly average in November. Latest ÷ average is the fair momentum metric when every series has its own 100.
  • Who is holding up. On keeps 86 % of its average going into winter; Brooks is at 48 %. Part of Brooks' drop is the query itself — people search brooks shoes more than brooks running (the top[] list shows this), so add both spellings next week.
  • Product launches appear as Breakouts first. new balance 1080v15, asics gel-nimbus 28 and brooks adrenaline gts 25 are all current-season models. A Breakout means the query grew more than 5,000 % — it is the field worth an alert.
  • Check for noise. On's rising list includes ps5 games running on xbox hardware. For common-word brands pass a Google topic id instead of free text (the keywords field accepts /m/… ids) or set category: 20 (Sports).

* Why does Wyoming score 100 for every brand? It is a Google Trends sampling artefact in very low-population states — a handful of searches moves the index. It happens for many consumer terms. Drop Wyoming when ranking states, and read Alaska, Vermont and DC with the same caution.

What a record looks like

interestOverTime, one per brand:

{ "kind": "interestOverTime", "keyword": "hoka", "geo": "US", "timeRange": "today 12-m",
  "resolution": "WEEK", "pointCount": 54, "average": 47.7,
  "peak":   { "date": "2026-04-12T00:00:00.000Z", "value": 100 },
  "latest": { "date": "2026-11-08T00:00:00.000Z", "value": 33, "isPartial": true },
  "points": [ { "date": "2025-11-02T00:00:00.000Z", "value": 39, "isPartial": false }, "… 53 more" ],
  "url": "https://trends.google.com/trends/explore?q=hoka&geo=US&date=today+12-m" }
Enter fullscreen mode Exit fullscreen mode

relatedQueries carries top[] and rising[], each { query, value, formattedValue, isBreakout, url }. interestByRegion carries regions[] of { geoCode, name, value } sorted by value, plus topRegion and regionCount (51 for the US).

Record ids are stable per keyword × location × time range × category, so the same brand has the same id every week. That is what makes the next step work.

Step 4: Get a weekly Google Trends alert in Slack

Schedule the monitor, not the scraper. Dataset Diff Monitor runs the Trends scraper for you, compares the new dataset with last week's snapshot by id, and sends one digest to Slack, Discord, Telegram or a webhook (n8n, Make, Zapier).

{
  "sourceActorId": "mdcurt/google-trends-scraper",
  "sourceInput": {
    "keywords": ["hoka", "brooks running", "asics", "new balance", "on running"],
    "geo": "US",
    "timeRange": "today 3-m",
    "datasets": ["interestOverTime", "relatedQueries"],
    "maxItems": 50
  },
  "keyFields": ["id"],
  "watchFields": ["latest", "rising"],
  "ignoreFields": ["scrapedAt", "points", "top"],
  "notifyOn": ["changed", "added"],
  "firstRunBehavior": "snapshot",
  "title": "Running-shoe brands – Google Trends weekly",
  "labelField": "keyword",
  "urlField": "url",
  "slackWebhookUrl": "https://hooks.slack.com/services/…"
}
Enter fullscreen mode Exit fullscreen mode

How it behaves:

  • today 3-m gives daily points, so latest changes every week (the 12-month series only has a partial last week).
  • watchFields: ["latest", "rising"] means a brand is reported only when its latest value or its rising-queries list changed. New Breakout model names land in Slack the week they appear; points and top churn slightly every run and are ignored.
  • The first run stores the baseline silently. From the second run on you get a digest listing each changed brand with a link to its Trends page, and every change is also written to a dataset you can chart.
  • Cost per weekly run ≈ $0.07 (10 source records $0.025 + monitor start $0.02 + 10 rows compared $0.01 + one message $0.01). Under $4 a year.

Create the schedule in Apify Console → Schedules, cron 0 7 * * 1 (Monday 07:00), pointing at Dataset Diff Monitor with the input above.

More ways to use the same setup

  • Several countries: one monitor per geo (US, GB, DE, JP) — Trends indexes each country separately.
  • Trending-now watch: datasets: ["trendingNow"], hourly schedule, notifyOn: ["added"] → an alert when a new search enters a country's Trending-now feed (≈ $0.08 per hourly run including the monitor).
  • Post-campaign analysis: a custom range such as "2026-03-01 2026-04-30" with relatedQueries shows which queries a campaign lifted.
  • AI agents: pass {"keywords": ["<brand>"], "geo": "US"} and read latest.value, average, peak.date and rising[] from the three records that return in 2–3 seconds; one brand costs about $0.011. MCP endpoint: https://mcp.apify.com/?tools=mdcurt/google-trends-scraper.

FAQ

Is there an official Google Trends API?
No. Google offers Trends only as a website and a daily RSS feed. Tools either drive a browser or call the site's internal JSON endpoints; this scraper does the latter, which is why it needs no browser and finishes in seconds.

Can I compare brands on one scale?
Not in this version — each keyword is fetched on its own, so each has its own 100. Use Latest ÷ average for cross-brand momentum, or run the five-term comparison once a quarter in the Trends UI for the level set. Multi-keyword comparison on one scale is on the roadmap.

Why does one state show 100 for every keyword?
Sampling: in states with few searches a handful of queries moves the index to 100. Wyoming is the usual culprit for US data. Exclude it when ranking regions.

What does "Breakout" mean in Google Trends?
A related query whose search volume grew more than 5,000 % versus the previous period — usually a new product name, a news event or a viral term. The scraper flags it as isBreakout: true.

Will Google block this?
Google rate-limits rather than blocks: the scraper paces requests, pauses and retries on HTTP 429 (never counted as a failure), and drops any challenge page instead of working around it. A 70-keyword run passed 280/280 requests with datacenter proxies; residential proxies are not needed.

How much does it cost at scale?
$0.005 per run plus $0.002 per record (a record is a whole series or table, not a data point). 100 keywords × 3 datasets ≈ $0.61. Store discounts apply on paid Apify plans.


The full 15-record sample dataset, the input and the run's SUMMARY ship in the Actor source under examples/competitor-search-interest-monitor/, and the input is one click away as the example task "Monitor competitor brands' Google search interest by US state" on the Actor page. Feature requests — comparison on one scale, YouTube/News/Shopping properties — are welcome in the Actor's Issues tab.

Top comments (0)