1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "pairs": [
12 {
13 "id": "same-model",
14 "left": {
15 "title": "ACME A100 electric drill 18V blue tool only",
16 "brand": "ACME",
17 "mpn": "A100",
18 "color": "blue",
19 "packQuantity": "1",
20 "condition": "new"
21 },
22 "right": {
23 "title": "ACME A100 18 volt drill blue without battery",
24 "brand": "ACME",
25 "mpn": "A100",
26 "color": "blue",
27 "packQuantity": "1",
28 "condition": "new"
29 }
30 },
31 {
32 "id": "pack-conflict",
33 "left": {
34 "title": "Filter F20 1 pack",
35 "packQuantity": "1"
36 },
37 "right": {
38 "title": "Filter F20 6 pack",
39 "packQuantity": "6"
40 }
41 },
42 {
43 "id": "capacity-conflict",
44 "left": {
45 "title": "Phone Z 128 GB",
46 "capacity": "128 GB"
47 },
48 "right": {
49 "title": "Phone Z 256 GB",
50 "capacity": "256 GB"
51 }
52 }
53 ]
54};
55
56
57const run = await client.actor("dapper_locket/product-variant-match-audit").call(input);
58
59
60console.log('Results from dataset');
61console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
62const { items } = await client.dataset(run.defaultDatasetId).listItems();
63items.forEach((item) => {
64 console.dir(item);
65});
66
67