1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "baselineDate": "2026-10-01",
10 "currentDate": "2026-11-01",
11 "baselineProducts": [
12 {
13 "handle": "trail-bottle",
14 "title": "Trail Bottle",
15 "variants": [{ "available": True }],
16 },
17 {
18 "handle": "canvas-tote",
19 "title": "Canvas Tote",
20 "variants": [
21 { "available": True },
22 { "available": True },
23 ],
24 },
25 {
26 "handle": "desk-lamp",
27 "title": "Desk Lamp",
28 "variants": [{ "available": True }],
29 },
30 {
31 "handle": "wool-socks",
32 "title": "Wool Socks",
33 "variants": [{ "available": True }],
34 },
35 {
36 "handle": "sample-mug",
37 "title": "Sample Mug",
38 "variants": [{ "available": False }],
39 },
40 ],
41 "currentProducts": [
42 {
43 "handle": "trail-bottle",
44 "title": "Trail Bottle",
45 "variants": [{ "available": True }],
46 },
47 {
48 "handle": "canvas-tote",
49 "title": "Canvas Tote",
50 "variants": [
51 { "available": False },
52 { "available": False },
53 ],
54 },
55 {
56 "handle": "wool-socks",
57 "title": "Wool Socks",
58 "variants": [{ "available": True }],
59 },
60 {
61 "handle": "sample-mug",
62 "title": "Sample Mug",
63 "variants": [{ "available": False }],
64 },
65 {
66 "handle": "new-scarf",
67 "title": "New Scarf",
68 "variants": [{ "available": True }],
69 },
70 ],
71 "salesWeights": [
72 {
73 "handle": "trail-bottle",
74 "weight": 400,
75 },
76 {
77 "handle": "canvas-tote",
78 "weight": 250,
79 },
80 {
81 "handle": "desk-lamp",
82 "weight": 120,
83 },
84 {
85 "handle": "sample-mug",
86 "weight": 30,
87 },
88 ],
89}
90
91
92run = client.actor("practical_ai_lab_jp/pal-shopify-collection-revenue-exposure-audit").call(run_input=run_input)
93
94
95print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
96for item in client.dataset(run.default_dataset_id).iterate_items():
97 print(item)
98
99