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": "c1",
14 "issuer": "Acme Corp",
15 "agency": "Agency A",
16 "rating": "BBB-",
17 "action": "downgrade",
18 "ratingScore": 6
19 },
20 {
21 "id": "c2",
22 "issuer": "Acme Corp",
23 "agency": "Agency B",
24 "rating": "BBB",
25 "outlook": "negative",
26 "ratingScore": 7
27 },
28 {
29 "id": "c3",
30 "issuer": "Beta Corp",
31 "agency": "Agency A",
32 "rating": "A",
33 "ratingScore": 9
34 }
35 ],
36 "previousItems": [
37 {
38 "id": "c1",
39 "issuer": "Acme Corp",
40 "agency": "Agency A",
41 "rating": "BBB",
42 "action": "affirm",
43 "ratingScore": 7
44 },
45 {
46 "id": "c2",
47 "issuer": "Acme Corp",
48 "agency": "Agency B",
49 "rating": "BBB",
50 "outlook": "stable",
51 "ratingScore": 7
52 },
53 {
54 "id": "c3",
55 "issuer": "Beta Corp",
56 "agency": "Agency A",
57 "rating": "A",
58 "ratingScore": 9
59 }
60 ]
61};
62
63
64const run = await client.actor("quanmatrix/credit-rating-action-drift-intelligence").call(input);
65
66
67console.log('Results from dataset');
68console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
69const { items } = await client.dataset(run.defaultDatasetId).listItems();
70items.forEach((item) => {
71 console.dir(item);
72});
73
74