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 "sku": "DEMO-001",
14 "name": "Synthetic sample cup",
15 "price": "19.90",
16 "photoRefs": [
17 "demo-001-front.jpg"
18 ]
19 },
20 {
21 "sku": "",
22 "name": "Synthetic sample bowl",
23 "price": "12.00",
24 "photoRefs": [
25 "bowl.jpg"
26 ]
27 },
28 {
29 "sku": "DEMO-003",
30 "name": "",
31 "price": "",
32 "photoRefs": [
33 "missing.jpg"
34 ]
35 },
36 {
37 "sku": "DEMO-004",
38 "name": "Synthetic sample plate",
39 "price": "24.50"
40 },
41 {
42 "sku": "DEMO-004",
43 "name": "Synthetic duplicate plate",
44 "price": "24.50"
45 }
46 ],
47 "photos": [
48 {
49 "fileName": "demo-001-front.jpg",
50 "sku": "DEMO-001"
51 },
52 {
53 "fileName": "bowl.jpg",
54 "sku": ""
55 },
56 {
57 "fileName": "plate-a.jpg",
58 "sku": "DEMO-004"
59 },
60 {
61 "fileName": "plate-b.jpg",
62 "sku": "DEMO-004"
63 }
64 ]
65};
66
67
68const run = await client.actor("atesen-software/catalog-photo-readiness-qa").call(input);
69
70
71console.log('Results from dataset');
72console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
73const { items } = await client.dataset(run.defaultDatasetId).listItems();
74items.forEach((item) => {
75 console.dir(item);
76});
77
78