1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sources": [
12 {
13 "name": "storeA",
14 "records": [
15 {
16 "title": "Sony WH-1000XM4 Wireless Noise Cancelling Headphones, Black - Best Seller!",
17 "brand": "Sony",
18 "gtin": "027242920404"
19 },
20 {
21 "title": "CeraVe Moisturizing Cream, 16 oz - Free Shipping",
22 "brand": "CeraVe"
23 },
24 {
25 "title": "Bounty Paper Towels, 2-Ply, 6 Pack"
26 }
27 ]
28 },
29 {
30 "name": "storeB",
31 "records": [
32 {
33 "title": "Sony WH-1000XM4 Black Bluetooth Headphones (Free Shipping)",
34 "brand": "Sony",
35 "gtin": "027242920404"
36 },
37 {
38 "title": "CeraVe Moisturizing Cream 19 oz Jar",
39 "brand": "CeraVe"
40 },
41 {
42 "title": "Bounty Paper Towels, 2-Ply, 12 Pack - Hot Deal"
43 }
44 ]
45 }
46 ]
47};
48
49
50const run = await client.actor("that_red_bird/product-matcher").call(input);
51
52
53console.log('Results from dataset');
54console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
55const { items } = await client.dataset(run.defaultDatasetId).listItems();
56items.forEach((item) => {
57 console.dir(item);
58});
59
60