ScrapeMole
Home / Tools / Google Trends

Google Trends API

Use when you need how search interest in a topic changes over time or by region, or which related queries are rising. Returns weekly/daily interest (0-100), per-region interest and top/rising related queries from Google Trends. $0.01 per successful call; errors are not charged.

Call it →openapi.jsonLive on Base$0.01 USDC per successful call

Parameters

GET https://scrapemole-api-mainnet.scrapemole.workers.dev/v1/google-trends

NameRequiredDescription
qyesSearch term. Compare up to 5 terms by separating them with commas.
geonoCountry or region code (US, GB, DE, US-CA). Empty = worldwide.
timenoTime range.
One of: now 1-H now 4-H now 1-d now 7-d today 1-m today 3-m today 12-m today 5-y all
Default: today 12-m
regionsnoInclude interest by region.
One of: true false
Default: true
relatednoInclude related queries.
One of: true false
Default: true

Call it

// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig, decodePaymentResponseHeader } from '@x402/fetch';
import { ExactEvmScheme } from '@x402/evm';
import { privateKeyToAccount } from 'viem/accounts';

// Your agent's own wallet, holding a little USDC on Base. No ScrapeMole account or API key.
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: 'eip155:8453', client: new ExactEvmScheme(account) }],
});

// On 402 the wrapper signs the USDC authorization and retries once.
const res = await pay('https://scrapemole-api-mainnet.scrapemole.workers.dev/v1/google-trends?q=espresso%20machine&geo=US');
console.log(res.status, await res.json());
// Settled only on 200; the receipt (tx hash) is in the PAYMENT-RESPONSE header.
if (res.ok) console.log(decodePaymentResponseHeader(res.headers.get('payment-response')));

Also available as the MCP tool google_trends on https://scrapemole-api-mainnet.scrapemole.workers.dev/mcp (x402 MCP transport, same price).

Example response

A real response from this endpoint (arrays and long strings trimmed here).

{
  "type": "comparison",
  "searchTerm": null,
  "searchTerms": [
    "espresso machine",
    "french press"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 0,
  "searchType": "web",
  "trendsUrl": "https://trends.google.com/trends/explore?q=espresso+machine%2Cfrench+press&hl=en-US&geo=US&date=today+12-m",
  "interestOverTime": [
    {
      "date": "2025-10-05T00:00:00.000Z",
      "timestamp": 1759622400,
      "formattedTime": "Oct 5 – 11, 2025",
      "values": {
        "espresso machine": 34,
        "french press": 12
      },
      "hasData": true,
      "isPartial": false
    },
    {
      "date": "2025-10-12T00:00:00.000Z",
      "timestamp": 1760227200,
      "formattedTime": "Oct 12 – 18, 2025",
      "values": {
        "espresso machine": 29,
        "french press": 12
      },
      "hasData": true,
      "isPartial": false
    },
    "… 1 more"
  ],
  "averages": {
    "espresso machine": 51,
    "french press": 19
  },
  "interestByRegion": [
    {
      "geoCode": "US-WY",
      "geoName": "Wyoming",
      "values": {
        "espresso machine": 73,
        "french press": 27
      },
      "hasData": true
    },
    {
      "geoCode": "US-WA",
      "geoName": "Washington",
      "values": {
        "espresso machine": 76,
        "french press": 24
      },
      "hasData": true
    },
    "… 1 more"
  ],
  "relatedQueries": {
    "espresso machine": {
      "top": [
        {
          "query": "espresso machine breville",
          "value": 100,
          "formattedValue": "100",
          "isBreakout": false,
          "link": "https://trends.google.com/trends/explore?q=espresso+machine+breville&date=today+12-m&geo=US"
        },
        {
          "query": "breville",
          "value": 98,
          "formattedValue": "98",
          "isBreakout": false,
          "link": "https://trends.google.com/trends/explore?q=breville&date=today+12-m&geo=US"
        },
        "… 1 more"
      ],
      "rising": [
        {
          "query": "espresso machine arc raiders",
          "value": 18250,
          "formattedValue": "Breakout",
          "isBreakout": true,
          "link": "https://trends.google.com/trends/explore?q=espresso+machine+arc+raiders&date=today+12-m&geo=US"
        },
        {
          "query": "ninja luxe café premier series 3-in-1 espresso coffee & cold brew machine",
          "value": 15450,
          "formattedValue": "Breakout",
          "isBreakout": true,
          "link": "https://trends.google.com/trends/explore?q=ninja+luxe+caf%C3%A9+premier+series+3-in-1+espresso+coffee+%26+cold+brew+machine&date=today+12…"
        },
        "… 1 more"
      ]
    },
    "french press": {
      "top": [
        {
          "query": "french press how to",
          "value": 100,
          "formattedValue": "100",
          "isBreakout": false,
          "link": "https://trends.google.com/trends/explore?q=french+press+how+to&date=today+12-m&geo=US"
        },
        {
          "query": "french coffee press",
          "value": 90,
          "formattedValue": "90",
          "isBreakout": false,
          "link": "https://trends.google.com/trends/explore?q=french+coffee+press&date=today+12-m&geo=US"
        },
        "… 1 more"
      ],
      "rising": [
        {
          "query": "lidl near me",
          "value": 1200,
          "formattedValue": "+1,200%",
          "isBreakout": false,
          "link": "https://trends.google.com/trends/explore?q=lidl+near+me&date=today+12-m&geo=US"
        },
        {
          "query": "french toast near me",
          "value": 850,
          "formattedValue": "+850%",
          "isBreakout": false,
          "link": "https://trends.google.com/trends/explore?q=french+toast+near+me&date=today+12-m&geo=US"
        },
        "… 1 more"
      ]
    }
  },
  "relatedTopics": {},
  "errors": []
}

Live test results

10/10Live calls from Cloudflare Workers (with regional retry), 11 Oct 2026 11:18 UTC

Paid end-to-end checks (Base Sepolia testnet, 11 Oct 2026 18:36 UTC)

CallStatusChargedPass
unpaid /v1/google-trends402price quoted✓
paid /v1/google-trends?q=espresso%20machine&geo=US200$0.01✓
paid /v1/google-trends?q=espresso&time=bogus (bad time range)400$0✓

Errors

Failures return JSON like {"error": {"code": "NOT_FOUND", "message": "…", "charged": false}}. None of them are charged.

Status / errorCodeMeaning
400 INVALID_INPUTMissing or malformed parameter. Fix the input.
404 NOT_FOUNDThe video, channel, product or term doesn't exist or isn't public.
404 NO_DATAIt exists, but has nothing to return (for example no captions).
503 BLOCKEDThe source rate-limited us even after retries. Try again later.
502 / 504Upstream error or timeout. Try again.
402No or invalid payment. Pay the quoted amount and retry.