1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "baselineDate": "2026-10-01",
12 "baselineProducts": [
13 {
14 "id": 1001,
15 "handle": "city-tee",
16 "title": "City Tee",
17 "published_at": "2026-09-01T00:00:00Z",
18 "options": [
19 {
20 "name": "Size"
21 },
22 {
23 "name": "Color"
24 }
25 ],
26 "variants": [
27 {
28 "id": 5001,
29 "sku": "TEE-S-BLK",
30 "barcode": "4006381333931",
31 "option1": "S",
32 "option2": "Black",
33 "available": true
34 },
35 {
36 "id": 5002,
37 "sku": "TEE-M-BLK",
38 "barcode": "",
39 "option1": "M",
40 "option2": "Black",
41 "available": true
42 }
43 ]
44 },
45 {
46 "id": 1002,
47 "handle": "canvas-tote",
48 "title": "Canvas Tote",
49 "published_at": "2026-09-01T00:00:00Z",
50 "options": [
51 {
52 "name": "Color"
53 }
54 ],
55 "variants": [
56 {
57 "id": 5101,
58 "sku": "TOTE-NAT",
59 "barcode": "5012345678900",
60 "option1": "Natural",
61 "available": true
62 }
63 ]
64 }
65 ],
66 "currentDate": "2026-11-01",
67 "currentProducts": [
68 {
69 "id": 1001,
70 "handle": "city-tee",
71 "title": "City Tee - Organic Cotton",
72 "published_at": "2026-09-01T00:00:00Z",
73 "options": [
74 {
75 "name": "Size"
76 },
77 {
78 "name": "Colour"
79 }
80 ],
81 "variants": [
82 {
83 "id": 5001,
84 "sku": "TEE-S-BLK",
85 "barcode": "4006381333931",
86 "option1": "S",
87 "option2": "Black",
88 "available": true
89 },
90 {
91 "id": 5002,
92 "sku": "TEE-M-BLK",
93 "barcode": "4006381333948",
94 "option1": "M",
95 "option2": "Black",
96 "available": true
97 },
98 {
99 "id": 5003,
100 "sku": "TEE-L-BLK",
101 "barcode": "",
102 "option1": "L",
103 "option2": "Black",
104 "available": false
105 }
106 ]
107 },
108 {
109 "id": 1002,
110 "handle": "canvas-tote",
111 "title": "Canvas Tote",
112 "published_at": null,
113 "options": [
114 {
115 "name": "Color"
116 }
117 ],
118 "variants": [
119 {
120 "id": 5101,
121 "sku": "TOTE-NAT",
122 "barcode": "5012345678900",
123 "option1": "Natural",
124 "available": true
125 }
126 ]
127 }
128 ]
129};
130
131
132const run = await client.actor("practical_ai_lab_jp/pal-shopify-variant-listing-drift-audit").call(input);
133
134
135console.log('Results from dataset');
136console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
137const { items } = await client.dataset(run.defaultDatasetId).listItems();
138items.forEach((item) => {
139 console.dir(item);
140});
141
142