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 "sku": "A1",
14 "brand": "Acme",
15 "category": "Headphones",
16 "productName": "Pro X",
17 "price": 199
18 },
19 {
20 "sku": "A2",
21 "brand": "Acme",
22 "category": "Headphones",
23 "productName": "Mini X",
24 "price": 99
25 },
26 {
27 "sku": "B1",
28 "brand": "Beta",
29 "category": "Speakers",
30 "productName": "Boom",
31 "price": 149
32 }
33 ],
34 "previousItems": [
35 {
36 "sku": "A1",
37 "brand": "Acme",
38 "category": "Headphones",
39 "productName": "Pro X",
40 "price": 189
41 },
42 {
43 "sku": "OLD",
44 "brand": "Acme",
45 "category": "Headphones",
46 "productName": "Legacy",
47 "price": 79
48 },
49 {
50 "sku": "B1",
51 "brand": "Beta",
52 "category": "Speakers",
53 "productName": "Boom",
54 "price": 149
55 }
56 ]
57};
58
59
60const run = await client.actor("quanmatrix/product-launch-delisting-intelligence").call(input);
61
62
63console.log('Results from dataset');
64console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
65const { items } = await client.dataset(run.defaultDatasetId).listItems();
66items.forEach((item) => {
67 console.dir(item);
68});
69
70