1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "snapshots": [
12 {
13 "store": "demo-store",
14 "label": "October",
15 "capturedAt": "2026-10-01",
16 "products": [
17 {
18 "id": 1,
19 "handle": "trail-shoe",
20 "title": "Trail Shoe",
21 "vendor": "Northpeak",
22 "product_type": "Footwear",
23 "variants": [
24 {
25 "price": "89.00",
26 "available": true
27 }
28 ]
29 },
30 {
31 "id": 2,
32 "handle": "rain-jacket",
33 "title": "Rain Jacket",
34 "vendor": "Northpeak",
35 "product_type": "Outerwear",
36 "variants": [
37 {
38 "price": "120.00",
39 "available": true
40 }
41 ]
42 },
43 {
44 "id": 3,
45 "handle": "wool-sock",
46 "title": "Wool Sock",
47 "vendor": "Fieldwool",
48 "product_type": "Accessories",
49 "variants": [
50 {
51 "price": "14.00",
52 "available": true
53 }
54 ]
55 }
56 ]
57 },
58 {
59 "store": "demo-store",
60 "label": "November",
61 "capturedAt": "2026-11-01",
62 "products": [
63 {
64 "id": 1,
65 "handle": "trail-shoe",
66 "title": "Trail Shoe",
67 "vendor": "Northpeak",
68 "product_type": "Footwear",
69 "variants": [
70 {
71 "price": "79.00",
72 "available": true
73 }
74 ]
75 },
76 {
77 "id": 2,
78 "handle": "rain-jacket",
79 "title": "Rain Jacket",
80 "vendor": "Northpeak",
81 "product_type": "Outerwear",
82 "variants": [
83 {
84 "price": "120.00",
85 "available": false
86 }
87 ]
88 },
89 {
90 "id": 4,
91 "handle": "city-bag",
92 "title": "City Bag",
93 "vendor": "Urbanloop",
94 "product_type": "Bags",
95 "variants": [
96 {
97 "price": "65.00",
98 "available": true
99 }
100 ]
101 }
102 ]
103 }
104 ]
105};
106
107
108const run = await client.actor("practical_ai_lab_jp/pal-shopify-brand-assortment-shifts").call(input);
109
110
111console.log('Results from dataset');
112console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
113const { items } = await client.dataset(run.defaultDatasetId).listItems();
114items.forEach((item) => {
115 console.dir(item);
116});
117
118