1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "beforeSnapshot": { "products": [
10 {
11 "id": 1001,
12 "handle": "trail-bottle",
13 "title": "Trail Bottle",
14 "vendor": "Northline",
15 "product_type": "Drinkware",
16 "tags": "outdoor, steel",
17 "variants": [
18 {
19 "id": 5001,
20 "sku": "TB-500",
21 "title": "500 ml",
22 "price": "24.00",
23 "available": True,
24 },
25 {
26 "id": 5002,
27 "sku": "TB-750",
28 "title": "750 ml",
29 "price": "28.00",
30 "available": True,
31 },
32 ],
33 },
34 {
35 "id": 1002,
36 "handle": "camp-mug",
37 "title": "Camp Mug",
38 "vendor": "Northline",
39 "product_type": "Drinkware",
40 "tags": "outdoor",
41 "variants": [{
42 "id": 5003,
43 "sku": "CM-1",
44 "title": "Default",
45 "price": "12.00",
46 "available": True,
47 }],
48 },
49 ] },
50 "afterSnapshot": { "products": [
51 {
52 "id": 1001,
53 "handle": "trail-bottle",
54 "title": "Trail Bottle",
55 "vendor": "Northline Outdoors",
56 "product_type": "Drinkware",
57 "tags": "outdoor, steel, bestseller",
58 "variants": [
59 {
60 "id": 5001,
61 "sku": "TB-500",
62 "title": "500 ml",
63 "price": "26.00",
64 "available": True,
65 },
66 {
67 "id": 5004,
68 "sku": "TB-1000",
69 "title": "1 L",
70 "price": "32.00",
71 "available": False,
72 },
73 ],
74 },
75 {
76 "id": 1003,
77 "handle": "camp-stove",
78 "title": "Camp Stove",
79 "vendor": "Northline Outdoors",
80 "product_type": "Cooking",
81 "tags": "outdoor",
82 "variants": [{
83 "id": 5005,
84 "sku": "CS-1",
85 "title": "Default",
86 "price": "59.00",
87 "available": True,
88 }],
89 },
90 ] },
91}
92
93
94run = client.actor("practical_ai_lab_jp/pal-shopify-store-catalog-diff").call(run_input=run_input)
95
96
97print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
98for item in client.dataset(run.default_dataset_id).iterate_items():
99 print(item)
100
101