1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "productCsv": [
12 {
13 "title": "Demo Tee",
14 "sku": "TEE-RED-S",
15 "option1Name": "Color",
16 "option1Value": "Red",
17 "urlHandle": "demo-tee",
18 "variantImageUrl": "https://cdn.example/p/tee-red-s-csv.jpg"
19 }
20 ],
21 "livePageUrls": [
22 "https://demo-store-01.example/products/tee"
23 ],
24 "pages": {
25 "pages": {
26 "https://demo-store-01.example/products/tee": {
27 "variants": [
28 {
29 "sku": "TEE-RED-S",
30 "optionName": "Color",
31 "optionValue": "Red",
32 "imageUrl": "https://cdn.example/p/tee-red-s-live.jpg"
33 }
34 ]
35 }
36 }
37 },
38 "scopeStore": "demo-store-01",
39 "runId": "audit-001",
40 "freshnessHours": 72,
41 "capMode": "capped"
42};
43
44
45const run = await client.actor("steadyworks/shopify-variant-image-audit").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55