1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentFeedText": `SKU,Title,Price,Availability,Brand
12A-100,Stainless Water Bottle 750ml,$22.99,in stock,Hydra
13A-101,Insulated Lunch Box,$32.00,out of stock,Hydra
14A-102,Bamboo Cutlery Set,$12.50,in stock,GreenKit
15A-103,Collapsible Coffee Cup - Sage,$18.00,in stock,GreenKit
16A-105,Glass Meal Prep Containers,"$1,099.00",in stock,Prepco
17A-106,Silicone Storage Bags,$21.00,in stock,Prepco
18A-107,Reusable Produce Bags,$9.99,preorder,Wrapsy`,
19 "previousFeedText": `SKU,Title,Price,Availability,Brand
20A-100,Stainless Water Bottle 750ml,$24.99,in stock,Hydra
21A-101,Insulated Lunch Box,$32.00,in stock,Hydra
22A-102,Bamboo Cutlery Set,$12.50,out of stock,GreenKit
23A-103,Collapsible Coffee Cup,$18.00,in stock,GreenKit
24A-104,Beeswax Food Wraps (3 pack),$15.00,in stock,Wrapsy
25A-105,Glass Meal Prep Containers,"$1,049.00",in stock,Prepco
26A-106,Silicone Storage Bags,$21.00,in stock,Prepco`,
27 "compareFields": [
28 "Brand"
29 ]
30};
31
32
33const run = await client.actor("althorlabs/catalog-feed-diff").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43