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 "rows": [
13 {
14 "signalId": "nike-launch-001",
15 "brandName": "Nike",
16 "eventType": "product_launch",
17 "severity": "high",
18 "status": "active",
19 "observedAt": "2024-02-29T12:00:00Z",
20 "sourceUrl": "https://example.com/nike-launch"
21 },
22 {
23 "signalId": "nike-price-001",
24 "brandName": "Nike",
25 "eventType": "price_change",
26 "severity": "medium",
27 "status": "resolved",
28 "observedAt": "2024-03-01T12:00:00Z",
29 "sourceUrl": "https://example.com/retail/nike-price"
30 },
31 {
32 "signalId": "apple-risk-001",
33 "brandName": "Apple",
34 "eventType": "risk",
35 "severity": "critical",
36 "status": "active",
37 "observedAt": "2024-03-02T12:00:00Z",
38 "sourceUrl": "https://example.org/apple-risk"
39 },
40 {
41 "signalId": "apple-review-001",
42 "brandName": "Apple",
43 "eventType": "review",
44 "severity": "low",
45 "status": "active",
46 "observedAt": "2024-03-03T12:00:00Z",
47 "sourceUrl": "https://example.org/apple-review"
48 }
49 ]
50};
51
52
53const run = await client.actor("zinin/us-brand-signal-brand-summary").call(input);
54
55
56console.log('Results from dataset');
57console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
58const { items } = await client.dataset(run.defaultDatasetId).listItems();
59items.forEach((item) => {
60 console.dir(item);
61});
62
63