1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 {
13 "id": "camera",
14 "name": "Used camera",
15 "price": 75,
16 "category": "camera",
17 "cost": 30,
18 "shippingCharged": 8,
19 "shippingCost": 7
20 },
21 {
22 "id": "sneakers",
23 "name": "Adult sneakers",
24 "price": 180,
25 "category": "sneakers",
26 "cost": 85,
27 "shippingCost": 8
28 },
29 {
30 "id": "cards",
31 "name": "Trading card",
32 "price": 35,
33 "category": "cards",
34 "cost": 12,
35 "shippingCharged": 4,
36 "shippingCost": 3.5
37 }
38 ],
39 "sellerType": {
40 "storeLevel": "none",
41 "topRatedPlus": false,
42 "promotedListingRate": 0
43 }
44};
45
46
47const run = await client.actor("moggedhq/ebay-fee-calculator").call(input);
48
49
50console.log('Results from dataset');
51console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57