1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "catalog": [
12 {
13 "catalogItemId": "tree-runner-jet-black-8",
14 "title": "Men's Tree Runner Jet Black size 8",
15 "brand": "Allbirds",
16 "gtin": "843416184854",
17 "mpn": "TR3MJBW080",
18 "sku": "TR3MJBW080",
19 "packQuantity": 1
20 },
21 {
22 "catalogItemId": "strider-explore-natural-black-10",
23 "title": "Men's Strider Explore Natural Black size 10",
24 "brand": "Allbirds",
25 "gtin": "196942208595",
26 "mpn": "A11768M100",
27 "sku": "A11768M100",
28 "packQuantity": 1
29 },
30 {
31 "catalogItemId": "coconut-caramel-1-bag",
32 "title": "Coconut Caramel Coffee 1 bag",
33 "brand": "Death Wish Coffee",
34 "gtin": "810063344313",
35 "mpn": "LGCCML09",
36 "sku": "LGCCML09",
37 "packQuantity": 1
38 },
39 {
40 "catalogItemId": "coconut-caramel-5-bag",
41 "title": "Coconut Caramel Coffee 5 bags",
42 "brand": "Death Wish Coffee",
43 "gtin": "810063344313",
44 "mpn": "LGCCML45K",
45 "sku": "LGCCML45K",
46 "packQuantity": 5
47 },
48 {
49 "catalogItemId": "classic-percale-queen-white",
50 "title": "Classic Percale Core Sheet Set Solid White Queen",
51 "brand": "Brooklinen",
52 "gtin": "840302715352",
53 "mpn": "COR-Q1",
54 "sku": "COR-Q1",
55 "packQuantity": 1
56 }
57 ],
58 "mappings": [
59 {
60 "url": "https://www.allbirds.com/products/mens-tree-runners?variant=33179624669264",
61 "catalogItemId": "tree-runner-jet-black-8"
62 },
63 {
64 "url": "https://www.allbirds.com/products/mens-strider-explore?variant=41334294020176",
65 "catalogItemId": "strider-explore-natural-black-10"
66 },
67 {
68 "url": "https://www.deathwishcoffee.com/products/coconut-caramel-coffee",
69 "catalogItemId": "coconut-caramel-1-bag"
70 },
71 {
72 "url": "https://www.deathwishcoffee.com/products/coconut-caramel-coffee",
73 "catalogItemId": "coconut-caramel-5-bag"
74 },
75 {
76 "url": "https://www.brooklinen.com/products/classic-core-sheet-set?variant=41405019586650",
77 "catalogItemId": "classic-percale-queen-white"
78 }
79 ],
80 "expectedCurrency": "USD",
81 "country": "US",
82 "outputMode": "all",
83 "stateStoreName": "exact-variant-monitor-state",
84 "maxOffers": 50
85};
86
87
88const run = await client.actor("plusonets/exact-variant-price-stock-monitor").call(input);
89
90
91console.log('Results from dataset');
92console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
93const { items } = await client.dataset(run.defaultDatasetId).listItems();
94items.forEach((item) => {
95 console.dir(item);
96});
97
98