1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "previousSnapshot": {
12 "sourceId": "example-store",
13 "scope": "all-public-products",
14 "capturedAt": "2026-09-03T12:00:00Z",
15 "complete": true,
16 "products": [
17 {
18 "id": 1,
19 "type": "simple",
20 "name": "Product 1",
21 "sku": "SKU-1",
22 "is_in_stock": true,
23 "prices": {
24 "price": "1000",
25 "currency_code": "USD",
26 "currency_minor_unit": 2
27 }
28 },
29 {
30 "id": 2,
31 "type": "simple",
32 "name": "Product 2",
33 "sku": "SKU-2",
34 "is_in_stock": true,
35 "prices": {
36 "price": "1000",
37 "currency_code": "USD",
38 "currency_minor_unit": 2
39 }
40 },
41 {
42 "id": 3,
43 "type": "simple",
44 "name": "Product 3",
45 "sku": "SKU-3",
46 "is_in_stock": true,
47 "prices": {
48 "price": "1000",
49 "currency_code": "USD",
50 "currency_minor_unit": 2
51 }
52 },
53 {
54 "id": 4,
55 "type": "simple",
56 "name": "Product 4",
57 "sku": "SKU-4",
58 "is_in_stock": true,
59 "prices": {
60 "price": "1000",
61 "currency_code": "USD",
62 "currency_minor_unit": 2
63 }
64 },
65 {
66 "id": 5,
67 "type": "simple",
68 "name": "Product 5",
69 "sku": "SKU-5",
70 "is_in_stock": true,
71 "prices": {
72 "price": "1000",
73 "currency_code": "USD",
74 "currency_minor_unit": 2
75 }
76 }
77 ]
78 },
79 "currentSnapshot": {
80 "sourceId": "example-store",
81 "scope": "all-public-products",
82 "capturedAt": "2026-09-04T12:00:00Z",
83 "complete": false,
84 "products": [
85 {
86 "id": 1,
87 "type": "simple",
88 "name": "Product 1",
89 "sku": "SKU-1",
90 "is_in_stock": true,
91 "prices": {
92 "price": "1",
93 "currency_code": "USD",
94 "currency_minor_unit": 2
95 }
96 },
97 {
98 "id": 2,
99 "type": "simple",
100 "name": "Product 2",
101 "sku": "SKU-2",
102 "is_in_stock": false,
103 "prices": {
104 "price": "1000",
105 "currency_code": "USD",
106 "currency_minor_unit": 2
107 }
108 },
109 {
110 "id": 3,
111 "type": "simple",
112 "name": "Product 3",
113 "sku": "SKU-3",
114 "is_in_stock": true,
115 "prices": {
116 "price": "900",
117 "currency_code": "EUR",
118 "currency_minor_unit": 2
119 }
120 },
121 {
122 "id": 4,
123 "type": "simple",
124 "name": "Product 4",
125 "sku": "SKU-4",
126 "is_in_stock": true,
127 "prices": {
128 "price": "",
129 "currency_code": "USD",
130 "currency_minor_unit": 2
131 }
132 }
133 ]
134 }
135};
136
137
138const run = await client.actor("willing_relic/woocommerce-catalog-change-guard").call(input);
139
140
141console.log('Results from dataset');
142console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
143const { items } = await client.dataset(run.defaultDatasetId).listItems();
144items.forEach((item) => {
145 console.dir(item);
146});
147
148