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": "e1",
14 "title": "Competitor acquires startup",
15 "relevanceScore": 96,
16 "velocityPct": 82,
17 "sourceCount": 74,
18 "impactScore": 91,
19 "riskScore": 63
20 },
21 {
22 "id": "e2",
23 "title": "Minor office update",
24 "relevanceScore": 42,
25 "velocityPct": 18,
26 "sourceCount": 8,
27 "impactScore": 20,
28 "riskScore": 12
29 }
30 ],
31 "previousItems": [
32 {
33 "id": "e1",
34 "title": "Acquisition rumor",
35 "relevanceScore": 72,
36 "velocityPct": 35,
37 "sourceCount": 21,
38 "impactScore": 58,
39 "riskScore": 48
40 }
41 ]
42};
43
44
45const run = await client.actor("quanmatrix/google-news-competitive-event-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