1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "previous": [
12 {
13 "id": "001",
14 "title": "Linen shirt",
15 "price": 1499,
16 "currency": "INR",
17 "availability": "in_stock"
18 }
19 ],
20 "current": [
21 {
22 "id": "001",
23 "title": "Linen shirt",
24 "price": 149.9,
25 "currency": "INR",
26 "availability": "in_stock"
27 }
28 ],
29 "options": {
30 "priceThresholdPct": 20,
31 "removalThresholdPct": 10,
32 "stockOutThresholdPct": 20
33 }
34};
35
36
37const run = await client.actor("shoyeb/catalog-gate").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47