Apify example task · whoareyouanas/google-trends-batch-research

Compare tea and coffee search interest in the US

Compare tea and coffee on a shared Google Trends timeline for the United States. Use the same 12-month comparison group to compare relative scores.

Actor
Google Trends API: Bulk Keyword Trends Export
Result limit
6 (maxAnalyses)
Estimated cost
Up to $0.06
Run options
Actor defaults

Example updated 2026-11-20 · actor build 1.1.10 · runs in your own Apify account

01 / About the actor

Google Trends API: Bulk Keyword Trends Export

Research Google Trends keywords across geographies and time windows. Export relative interest, regions, and related-query reports with explicit analysis outcomes, quality notes, and resumable batches.

Plan a research matrix

Expand keywords or comparison groups across selected countries and time windows.

Shared comparison scales

Use native comparison groups when keywords need a shared timeline scale.

Review analysis quality

Keep completion status, coverage, effective periods, and source quality distinct.

02 / Input

The exact input this example runs.

Supply keywords for independent research or comparisonGroups for compare mode. The geography/time-window matrix determines planned analyses. maxAnalyses bounds the plan, and planOnly can preview it without a completed-analysis event.

input.json · google-trends-compare-tea-coffee
{
  "maxRunSeconds": 180,
  "concurrency": 1,
  "maxAnalyses": 6,
  "reviewRelatedQueries": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "mode": "compare",
  "comparisonGroups": [
    {
      "label": "Tea and coffee",
      "keywords": [
        "tea",
        "coffee"
      ]
    }
  ],
  "geographies": [
    "US"
  ],
  "timeWindows": [
    "today 12-m"
  ],
  "surfaces": [
    "timeline"
  ]
}
Input fields used by this example, their values and what they control
FieldValue in this exampleWhat it controls
maxRunSeconds180Stop new work before this runtime budget and preserve results for resume.
concurrency1Maximum analyses in flight; requests also follow a shared pacing limit.
maxAnalysesChange this6Reject a larger expanded matrix before any source requests; maximum 1,000.
reviewRelatedQueriesChange thisfalseAdd literal seed-token overlap, URL-looking text and exact promotional-phrase annotations. Never filters or ranks relevance. Disable without changing the research plan, including on resume.
proxyConfiguration2 settingsResidential sessions are recommended for production. Set useApifyProxy to false for direct local tests.
modeChange this"compare"Research each keyword independently or compare explicit groups on a native shared timeline scale.
comparisonGroupsChange this{"label":"Tea and coffee","keywords":["tea","coffee"]}Compare mode only. Each object contains keywords (2–5 distinct terms) and an optional label. Related queries require independent mode.
geographiesChange thisUSCountry/subregion codes, such as US, GB, IN or US-CA. Use an empty string for worldwide.
timeWindowsChange thistoday 12-mGoogle preset or YYYY-MM-DD YYYY-MM-DD. Use fixed dates for repeatable research.
surfacesChange thistimelineTimeline is required. Related queries are available for independent keyword research.
Other inputs you can add (8)
Deployed actor input fields, types, defaults, and descriptions
FieldType / requiredDefaultPurpose
keywordsarrayNot specifiedSearch terms or Google topic IDs. Required in independent mode.
categoryintegerNot specifiedGoogle Trends category ID; zero includes all categories.

Minimum: 0 · Maximum: 100000

propertystringNot specifiedThe Google search surface to measure.

Options: web, images, news, youtube, shopping

languagestringNot specifiedInterface language for source labels; does not translate keywords.
timezoneOffsetMinutesintegerNot specifiedGoogle/JavaScript convention: India is -330, UTC is 0. Does not set research geography.

Minimum: -1439 · Maximum: 1439

requestDelayMillisintegerNot specifiedMinimum time between source requests across all workers. Increase when Google rate-limits requests.

Minimum: 250 · Maximum: 60000

maxRetriesintegerNot specifiedMaximum additional attempts per source operation, excluding the first attempt.

Minimum: 0 · Maximum: 3

requestTimeoutSecondsintegerNot specifiedMaximum duration of one HTTP request.

Minimum: 5 · Maximum: 60

03 / Make it yours

Change these fields for your own research.

  1. 01 · maxAnalyses

    Maximum expanded analyses

    Reject a larger expanded matrix before any source requests; maximum 1,000.

    Example: 6

  2. 02 · reviewRelatedQueries

    Annotate related queries for review

    Add literal seed-token overlap, URL-looking text and exact promotional-phrase annotations. Never filters or ranks relevance. Disable without changing the research plan, including on resume.

    Example: false

  3. 03 · mode

    Research mode

    Research each keyword independently or compare explicit groups on a native shared timeline scale.

    Example: "compare"

  4. 04 · comparisonGroups

    Comparison groups

    Compare mode only. Each object contains keywords (2–5 distinct terms) and an optional label. Related queries require independent mode.

    Example: {"label":"Tea and coffee","keywords":["tea","coffee"]}

  5. 05 · geographies

    Countries or subregions

    Country/subregion codes, such as US, GB, IN or US-CA. Use an empty string for worldwide.

    Example: US

  6. 06 · timeWindows

    Date windows

    Google preset or YYYY-MM-DD YYYY-MM-DD. Use fixed dates for repeatable research.

    Example: today 12-m

  7. 07 · surfaces

    Research surfaces

    Timeline is required. Related queries are available for independent keyword research.

    Example: timeline

Run it in three steps

  1. Open the example on Apify and select Try for free to copy it into your Apify account.
  2. Replace the sample values above with your own target and keep the limit small.
  3. Start the run, then export the dataset as JSON, CSV or Excel.

04 / Output

What the results table shows.

Columns in the “Analyst report” view

keyword

Keyword

geography

Country / region

time

Requested period

effectiveTime

Effective timeline period

analysisStatus

Extraction

qualityState

Timeline quality

latestCompleteInterest

Latest complete index

latestCompleteDate

Latest interval start (UTC)

recentChangePercent

Descriptive change (%)

changeLabel

Change period

coverageLabel

Returned interval coverage

regionMetricLabel

Regional metric

topRegionsText

Regional highlights

risingQueriesText

Rising leads for review

queryReviewEnabled

Lexical review enabled

risingReviewFlagsText

Literal query-review facts

qualityNotesText

Quality notes

metricNotesText

Metric notes

analysisId

Analysis / comparison identifier

keywords

Terms in this analysis

captureScope

Timeline scale scope

sourceUrl

Timeline source context

report

report

A view selects columns for the table. The full JSON export keeps every field, including nested arrays and objects.

05 / Cost

What this example costs to run.

At most about $0.06: up to 6 results at $0.01 each (Completed research analysis). Fewer results cost less. The live Pricing tab on Apify is authoritative.

Prices checked 2026-11-22. Set a run spending limit in Apify when you widen the input.

06 / API

Run the same input from your code.

This call starts a billable run of Google Trends API: Bulk Keyword Trends Export with this example's input and returns the dataset items when it finishes. Synchronous calls wait up to five minutes; for longer runs, POST to /runs instead and read the run's default dataset when it succeeds. Keep the token in an environment variable.

cURL · run and return the results
curl --request POST \
  'https://api.apify.com/v2/acts/whoareyouanas~google-trends-batch-research/run-sync-get-dataset-items?format=json' \
  --header "Authorization: Bearer $APIFY_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{"maxRunSeconds":180,"concurrency":1,"maxAnalyses":6,"reviewRelatedQueries":false,"proxyConfiguration":{"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"]},"mode":"compare","comparisonGroups":[{"label":"Tea and coffee","keywords":["tea","coffee"]}],"geographies":["US"],"timeWindows":["today 12-m"],"surfaces":["timeline"]}'

Coverage & interpretation

Check the result before relying on it.

Questions

About this example.

What does the "Compare tea and coffee search interest in the US" example collect?

Compare tea and coffee on a shared Google Trends timeline for the United States. Use the same 12-month comparison group to compare relative scores. It runs Google Trends API: Bulk Keyword Trends Export, published by whoareyouanas on Apify.

Which input does this example use?

Maximum expanded analyses (maxAnalyses) set to 6; Annotate related queries for review (reviewRelatedQueries) set to false; Research mode (mode) set to "compare"; Comparison groups (comparisonGroups) set to {"label":"Tea and coffee","keywords":["tea","coffee"]}; Countries or subregions (geographies) set to US; Date windows (timeWindows) set to today 12-m. The full JSON input is shown on this page.

How much does it cost to run this example?

At most about $0.06: up to 6 results at $0.01 each (Completed research analysis). Fewer results cost less. The live Pricing tab on Apify is authoritative.

How do I change it for my own research?

Open the example on Apify and select Try for free to copy it into your account, then edit Maximum expanded analyses, Annotate related queries for review, Research mode, Comparison groups, Countries or subregions, Date windows, Research surfaces. Keep the result limit small for the first run and check the output before scaling up.

Can I run it from the API or on a schedule?

Yes. Send the same JSON input to the Google Trends API: Bulk Keyword Trends Export run endpoint with your Apify API token, or save the copied task in your Apify account and add a schedule. Results land in the run's default dataset as JSON, CSV or Excel.

More examples

Related tasks you can copy.

Guides

Read more about this workflow.