1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "products": [
10 {
11 "id": 101,
12 "storeHost": "demo-shop.myshopify.com",
13 "handle": "sky-blue-widget",
14 "title": "Sky Blue Everyday Widget",
15 "vendor": "PAL Demo",
16 "product_type": "Accessories",
17 "body_html": "<p>A reusable everyday accessory with durable materials, practical sizing and detailed care instructions for reliable daily use.</p>",
18 "images": [{
19 "src": "https://cdn.example.org/widget-blue.jpg",
20 "alt": "",
21 }],
22 "variants": [{
23 "id": 1001,
24 "sku": "WIDGET-BLUE",
25 "price": "29.00",
26 "compare_at_price": "39.00",
27 "available": True,
28 "option1": "Blue",
29 }],
30 },
31 {
32 "id": 102,
33 "storeHost": "demo-shop.myshopify.com",
34 "handle": "bright-red-widget",
35 "title": "Bright Red Everyday Widget",
36 "vendor": "PAL Demo",
37 "product_type": "Accessories",
38 "body_html": "<p>A colorful durable accessory with helpful product measurements, materials information and intended use explained clearly.</p>",
39 "images": [],
40 "variants": [{
41 "id": 1002,
42 "sku": "WIDGET-RED",
43 "price": "21.00",
44 "available": False,
45 "option1": "Red",
46 }],
47 },
48 ],
49 "previousProducts": [{
50 "id": 101,
51 "storeHost": "demo-shop.myshopify.com",
52 "handle": "sky-blue-widget",
53 "title": "Sky Blue Everyday Widget",
54 "vendor": "PAL Demo",
55 "product_type": "Accessories",
56 "body_html": "<p>A reusable everyday accessory with durable materials, practical sizing and detailed care instructions for reliable daily use.</p>",
57 "images": [{
58 "src": "https://cdn.example.org/widget-blue.jpg",
59 "alt": "",
60 }],
61 "variants": [{
62 "id": 1001,
63 "sku": "WIDGET-BLUE",
64 "price": "35.00",
65 "compare_at_price": "39.00",
66 "available": False,
67 "option1": "Blue",
68 }],
69 }],
70 "competitorProducts": [{
71 "id": 201,
72 "storeHost": "sample-competitor.myshopify.com",
73 "handle": "blue-competitor-widget",
74 "title": "Competitor Blue Everyday Widget",
75 "vendor": "PAL Demo",
76 "product_type": "Accessories",
77 "body_html": "<p>A reusable everyday accessory with durable materials, practical sizing and detailed care instructions for reliable daily use.</p>",
78 "images": [{
79 "src": "https://cdn.example.org/competitor-blue.jpg",
80 "alt": "Blue accessory",
81 }],
82 "variants": [{
83 "id": 2001,
84 "sku": "WIDGET-BLUE",
85 "price": "27.50",
86 "available": True,
87 "option1": "Blue",
88 }],
89 }],
90 "publicStores": [],
91 "currencyByStore": {
92 "demo-shop.myshopify.com": "USD",
93 "sample-competitor.myshopify.com": "USD",
94 },
95 "costBySku": { "WIDGET-BLUE": "12.00" },
96}
97
98
99run = client.actor("practical_ai_lab_jp/pal-shopify-commerce-intelligence-suite").call(run_input=run_input)
100
101
102print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
103for item in client.dataset(run.default_dataset_id).iterate_items():
104 print(item)
105
106