1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "leftCsv": `order_id,email,total,status
12A-1001,ana@example.com,49.00,paid
13A-1002,ben@example.com,15.50,paid
14A-1003,cy@example.com,120.00,refunded
15A-1004,dee@example.com,8.99,paid
16A-1005,eli@example.com,64.20,paid
17A-1006,fay@example.com,30.00,paid
18,gus@example.com,12.00,paid`,
19 "rightCsv": `Order ID,Customer Email,Amount,Payment Status
20A-1001,ana@example.com,49.00,paid
21A-1002,ben@example.com,15.50,paid
22A-1003,cy@example.com,120.00,paid
23A-1004,dee@example.com,8.99,paid
24A-1004,dee@example.com,8.99,paid
25A-1005,eli@example.com,64.02,paid
26A-1007,hal@example.com,22.00,paid`,
27 "keyPairs": [
28 {
29 "left": "order_id",
30 "right": "Order ID"
31 }
32 ],
33 "comparePairs": [
34 {
35 "left": "email",
36 "right": "Customer Email"
37 },
38 {
39 "left": "total",
40 "right": "Amount"
41 },
42 {
43 "left": "status",
44 "right": "Payment Status"
45 }
46 ]
47};
48
49
50const run = await client.actor("kestrelwick/csv-export-parity-auditor").call(input);
51
52
53console.log('Results from dataset');
54console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
55const { items } = await client.dataset(run.defaultDatasetId).listItems();
56items.forEach((item) => {
57 console.dir(item);
58});
59
60