1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "id": "t1",
14 "title": "ai agents",
15 "interest": 94,
16 "growthPct": 88,
17 "breakoutScore": 97,
18 "regionalSpread": 82,
19 "seasonalityFit": 76
20 },
21 {
22 "id": "t2",
23 "title": "old keyword",
24 "interest": 48,
25 "growthPct": 3,
26 "breakoutScore": 21,
27 "regionalSpread": 44,
28 "seasonalityFit": 52
29 }
30 ],
31 "previousItems": [
32 {
33 "id": "t1",
34 "title": "ai agents",
35 "interest": 71,
36 "growthPct": 52,
37 "breakoutScore": 76,
38 "regionalSpread": 63,
39 "seasonalityFit": 70
40 }
41 ]
42};
43
44
45const run = await client.actor("quanmatrix/google-trends-breakout-demand-intelligence").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55