1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "fileUrls": [
12 "https://raw.githubusercontent.com/datasets/currency-codes/main/data/codes-all.csv"
13 ],
14 "filters": [
15 {
16 "field": "WithdrawalDate",
17 "op": "empty"
18 }
19 ],
20 "dedupFields": [
21 "AlphabeticCode"
22 ],
23 "fields": [
24 "AlphabeticCode",
25 "Currency",
26 "NumericCode",
27 "MinorUnit"
28 ],
29 "renameFields": {
30 "AlphabeticCode": "code",
31 "Currency": "currency"
32 },
33 "outputFile": "csv"
34};
35
36
37const run = await client.actor("mcpkit/merge-dedup-datasets").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47