1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "currentProducts": [{
10 "id": 1001,
11 "title": "Trail Jacket",
12 "handle": "trail-jacket",
13 "variants": [
14 {
15 "id": 2001,
16 "product_id": 1001,
17 "title": "Blue / S",
18 "sku": "TJ-BLU-S",
19 "image_id": 3001,
20 },
21 {
22 "id": 2002,
23 "product_id": 1001,
24 "title": "Blue / M",
25 "sku": "TJ-BLU-S",
26 "image_id": 3999,
27 },
28 ],
29 "images": [{
30 "id": 3001,
31 "product_id": 1001,
32 "src": "https://cdn.example.com/trail-jacket-blue.jpg",
33 "alt": "",
34 "variant_ids": [2001],
35 }],
36 }],
37 "baselineProducts": [{
38 "id": 1001,
39 "title": "Trail Jacket",
40 "handle": "trail-jacket",
41 "variants": [
42 {
43 "id": 2001,
44 "product_id": 1001,
45 "title": "Blue / S",
46 "sku": "TJ-BLU-S",
47 "image_id": 3001,
48 },
49 {
50 "id": 2002,
51 "product_id": 1001,
52 "title": "Blue / M",
53 "sku": "TJ-BLU-M",
54 "image_id": 3002,
55 },
56 ],
57 "images": [
58 {
59 "id": 3001,
60 "product_id": 1001,
61 "src": "https://cdn.example.com/trail-jacket-blue.jpg",
62 "alt": "Blue trail jacket, front view",
63 "variant_ids": [2001],
64 },
65 {
66 "id": 3002,
67 "product_id": 1001,
68 "src": "https://cdn.example.com/trail-jacket-blue-m.jpg",
69 "alt": "Blue trail jacket, size M",
70 "variant_ids": [2002],
71 },
72 ],
73 }],
74}
75
76
77run = client.actor("practical_ai_lab_jp/pal-shopify-variant-image-association-audit").call(run_input=run_input)
78
79
80print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
81for item in client.dataset(run.default_dataset_id).iterate_items():
82 print(item)
83
84