1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "targets": [
12 {
13 "comparisonId": "allbirds-tree-runner",
14 "retailer": "Allbirds",
15 "productUrl": "https://www.allbirds.com/products/mens-tree-runners",
16 "ownPrice": 75,
17 "currency": "USD",
18 "minPrice": 60
19 },
20 {
21 "comparisonId": "gymshark-arrival-shorts",
22 "retailer": "Gymshark",
23 "productUrl": "https://www.gymshark.com/products/gymshark-arrival-5-shorts-black-ss22",
24 "ownPrice": 20,
25 "currency": "USD"
26 },
27 {
28 "comparisonId": "airpods-pro-2",
29 "retailer": "Walmart",
30 "productUrl": "https://www.walmart.com/ip/Apple-AirPods-Pro-2nd-Generation/1752657021",
31 "ownPrice": 249,
32 "currency": "USD"
33 }
34 ],
35 "alertThresholdPercent": 5,
36 "maxConcurrency": 10
37};
38
39
40const run = await client.actor("khadinakbar/wiser-alternative").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50