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.
{
"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"
]
}| Field | Value in this example | What it controls |
|---|---|---|
| maxRunSeconds | 180 | Stop new work before this runtime budget and preserve results for resume. |
| concurrency | 1 | Maximum analyses in flight; requests also follow a shared pacing limit. |
| maxAnalysesChange this | 6 | Reject a larger expanded matrix before any source requests; maximum 1,000. |
| reviewRelatedQueriesChange this | false | 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. |
| proxyConfiguration | 2 settings | Residential 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 this | US | Country/subregion codes, such as US, GB, IN or US-CA. Use an empty string for worldwide. |
| timeWindowsChange this | today 12-m | Google preset or YYYY-MM-DD YYYY-MM-DD. Use fixed dates for repeatable research. |
| surfacesChange this | timeline | Timeline is required. Related queries are available for independent keyword research. |
Other inputs you can add (8)
| Field | Type / required | Default | Purpose |
|---|---|---|---|
| keywords | array | Not specified | Search terms or Google topic IDs. Required in independent mode. |
| category | integer | Not specified | Google Trends category ID; zero includes all categories. Minimum: 0 · Maximum: 100000 |
| property | string | Not specified | The Google search surface to measure. Options: web, images, news, youtube, shopping |
| language | string | Not specified | Interface language for source labels; does not translate keywords. |
| timezoneOffsetMinutes | integer | Not specified | Google/JavaScript convention: India is -330, UTC is 0. Does not set research geography. Minimum: -1439 · Maximum: 1439 |
| requestDelayMillis | integer | Not specified | Minimum time between source requests across all workers. Increase when Google rate-limits requests. Minimum: 250 · Maximum: 60000 |
| maxRetries | integer | Not specified | Maximum additional attempts per source operation, excluding the first attempt. Minimum: 0 · Maximum: 3 |
| requestTimeoutSeconds | integer | Not specified | Maximum duration of one HTTP request. Minimum: 5 · Maximum: 60 |
03 / Make it yours
Change these fields for your own research.
01 · maxAnalyses
Maximum expanded analyses
Reject a larger expanded matrix before any source requests; maximum 1,000.
Example: 6
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
03 · mode
Research mode
Research each keyword independently or compare explicit groups on a native shared timeline scale.
Example: "compare"
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"]}
05 · geographies
Countries or subregions
Country/subregion codes, such as US, GB, IN or US-CA. Use an empty string for worldwide.
Example: US
06 · timeWindows
Date windows
Google preset or YYYY-MM-DD YYYY-MM-DD. Use fixed dates for repeatable research.
Example: today 12-m
07 · surfaces
Research surfaces
Timeline is required. Related queries are available for independent keyword research.
Example: timeline
Run it in three steps
- Open the example on Apify and select Try for free to copy it into your Apify account.
- Replace the sample values above with your own target and keep the limit small.
- Start the run, then export the dataset as JSON, CSV or Excel.
04 / Output
What the results table shows.
- Analyst rows include relative-interest summaries, effective periods, status, quality notes, and report references.
- Independent requests have independent scales. Google Trends is relative interest, not absolute search volume or keyword difficulty. Quality state and extraction status answer different questions.
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.
Completed research analysis
$0.01 per event
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 --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.
- Do not compare independently scaled request values as if they were one shared popularity ranking.
- Availability, low-volume data, rate limits, and selected surfaces can affect completeness. Keep effective source periods and quality notes.
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.
Track US search interest in coffee with Google Trends
Chart relative Google Search interest for coffee in the United States over the last three months. Review the timeline scores and quality notes before comparing another period.
View exampleCompare US regional search interest for heat pumps
Use the Google Trends regional breakdown to review relative search interest in heat pumps across the United States over the past year.
View exampleFind related YouTube searches for home workouts
Review top and rising related queries for home workouts using the YouTube Search property in Google Trends. Start with the United States and a recent three-month window.
View exampleGuides