1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "keywords": [
12 "coffee",
13 "tea",
14 "matcha",
15 "espresso",
16 "latte",
17 "cold brew",
18 "cappuccino",
19 "green tea",
20 "chai",
21 "iced coffee",
22 "mocha",
23 "flat white",
24 "french press",
25 "decaf",
26 "oat milk",
27 "bubble tea",
28 "kombucha",
29 "hot chocolate",
30 "energy drink",
31 "yerba mate"
32 ],
33 "proxyConfiguration": {
34 "useApifyProxy": true,
35 "apifyProxyGroups": [
36 "RESIDENTIAL"
37 ]
38 }
39};
40
41
42const run = await client.actor("s3nafps/google-trends-bulk-compare").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52