1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "independent",
12 "keywords": [
13 "coffee"
14 ],
15 "geographies": [
16 "US"
17 ],
18 "timeWindows": [
19 "today 12-m"
20 ],
21 "surfaces": [
22 "timeline",
23 "regions",
24 "relatedQueries"
25 ],
26 "category": 0,
27 "property": "web",
28 "language": "en-US",
29 "timezoneOffsetMinutes": 0,
30 "maxAnalyses": 1000,
31 "maxRunSeconds": 3600,
32 "concurrency": 2,
33 "requestDelayMillis": 1000,
34 "maxRetries": 2,
35 "requestTimeoutSeconds": 30,
36 "reviewRelatedQueries": true,
37 "planOnly": false,
38 "proxyConfiguration": {
39 "useApifyProxy": true,
40 "apifyProxyGroups": [
41 "RESIDENTIAL"
42 ]
43 }
44};
45
46
47const run = await client.actor("whoareyouanas/google-trends-batch-research").call(input);
48
49
50console.log('Results from dataset');
51console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57