1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "products": [
12 {
13 "id": 101,
14 "handle": "demo-tumbler",
15 "title": "Insulated Steel Travel Tumbler",
16 "body_html": "<p>A durable insulated steel tumbler for everyday use. Includes a non-slip lid and easy cleaning instructions for long-term product care.</p>",
17 "images": [
18 {
19 "src": "https://example.org/a.jpg",
20 "alt": ""
21 }
22 ],
23 "variants": [
24 {
25 "id": 1001,
26 "sku": "TUMBLER-01",
27 "price": "26.00",
28 "compare_at_price": "35.00",
29 "option1": "Silver"
30 }
31 ]
32 },
33 {
34 "id": 102,
35 "handle": "demo-mug",
36 "title": "Everyday Ceramic Mug",
37 "body_html": "<p>A reusable ceramic mug with a comfortable handle, durable glaze and microwave safe construction for daily kitchen use.</p>",
38 "images": [],
39 "variants": [
40 {
41 "id": 1002,
42 "sku": "TUMBLER-01",
43 "price": "13.00",
44 "option1": "Default Title"
45 }
46 ]
47 }
48 ]
49};
50
51
52const run = await client.actor("practical_ai_lab_jp/pal-shopify-store-product-catalog-qa").call(input);
53
54
55console.log('Results from dataset');
56console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
57const { items } = await client.dataset(run.defaultDatasetId).listItems();
58items.forEach((item) => {
59 console.dir(item);
60});
61
62