1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "schemaVersion": "1.1",
12 "groupingMode": "brand",
13 "rows": [
14 {
15 "signalId": "sig-nike-launch-001",
16 "brandName": "Nike",
17 "eventType": "product_launch",
18 "severity": "high",
19 "analysisStatus": "unreviewed"
20 },
21 {
22 "signalId": "sig-nike-price-002",
23 "brandName": "Nike",
24 "eventType": "price_change",
25 "severity": "medium",
26 "analysisStatus": "reviewed"
27 },
28 {
29 "signalId": "sig-acme-recall-003",
30 "brandName": "Acme Labs",
31 "eventType": "recall",
32 "severity": "critical",
33 "analysisStatus": "reviewed"
34 },
35 {
36 "signalId": "sig-contoso-news-004",
37 "brandName": "Contoso",
38 "eventType": "news_item",
39 "severity": "low",
40 "analysisStatus": "unknown"
41 }
42 ]
43};
44
45
46const run = await client.actor("zinin/us-brand-signal-batch-splitter").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56