1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "matches": [
12 {
13 "teams": [
14 [
15 "ana"
16 ],
17 [
18 "ben"
19 ]
20 ],
21 "winner": 0,
22 "timestamp": "2026-10-01T18:00:00Z"
23 },
24 {
25 "teams": [
26 [
27 "cat"
28 ],
29 [
30 "dan"
31 ]
32 ],
33 "winner": 1,
34 "timestamp": "2026-10-01T18:30:00Z"
35 },
36 {
37 "teams": [
38 [
39 "ana",
40 "dan"
41 ],
42 [
43 "ben",
44 "cat"
45 ]
46 ],
47 "winner": 0,
48 "timestamp": "2026-10-02T19:00:00Z"
49 },
50 {
51 "teams": [
52 [
53 "ana"
54 ],
55 [
56 "dan"
57 ]
58 ],
59 "ranks": [
60 0,
61 0
62 ],
63 "timestamp": "2026-10-03T18:00:00Z"
64 },
65 {
66 "teams": [
67 [
68 "ben"
69 ],
70 [
71 "cat"
72 ]
73 ],
74 "winner": 0,
75 "weight": 0.5,
76 "timestamp": "2026-10-03T18:45:00Z"
77 },
78 {
79 "teams": [
80 [
81 "ana"
82 ],
83 [
84 "cat"
85 ]
86 ],
87 "winner": 0,
88 "timestamp": "2026-10-04T18:00:00Z"
89 }
90 ],
91 "algorithm": "openskill",
92 "predict": [
93 [
94 [
95 "ana"
96 ],
97 [
98 "cat"
99 ]
100 ],
101 [
102 [
103 "ana",
104 "ben"
105 ],
106 [
107 "cat",
108 "dan"
109 ]
110 ]
111 ]
112};
113
114
115const run = await client.actor("keith-apis/skill-rating").call(input);
116
117
118console.log('Results from dataset');
119console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
120const { items } = await client.dataset(run.defaultDatasetId).listItems();
121items.forEach((item) => {
122 console.dir(item);
123});
124
125