1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "baselineCsv": `asin,seller,sku,currency,price,unit_cost,freight_cost,duty_cost,referral_fee_pct,fba_fee,units
12B000000001,Northwind Goods,NW-100,USD,29.99,9.50,1.20,0.60,15,5.10,120
13B000000001,Contoso Supply,CS-100,USD,28.99,9.80,1.10,0.60,15,5.10,60
14B000000002,Northwind Goods,NW-200,USD,19.99,6.00,0.90,0.30,15,3.80,200
15B000000003,Contoso Supply,CS-300,USD,49.00,20.00,2.50,1.00,15,7.00,40`,
16 "currentCsv": `asin,seller,sku,currency,price,unit_cost,freight_cost,duty_cost,referral_fee_pct,fba_fee,units
17B000000001,Northwind Goods,NW-100,USD,27.99,9.50,2.90,0.60,15,5.40,130
18B000000001,Contoso Supply,CS-100,USD,28.99,9.80,1.10,0.60,15,5.10,55
19B000000002,Northwind Goods,NW-200,USD,19.99,6.00,,0.30,15,3.80,210
20B000000003,Contoso Supply,CS-300,EUR,45.00,20.00,2.50,1.00,15,7.00,35`
21};
22
23
24const run = await client.actor("practical_ai_lab_jp/pal-amazon-landed-cost-margin-audit").call(input);
25
26
27console.log('Results from dataset');
28console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
29const { items } = await client.dataset(run.defaultDatasetId).listItems();
30items.forEach((item) => {
31 console.dir(item);
32});
33
34