1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "csv": `id;amount;date
12001;1.234,50;2026-10-26
13002;1234,500;2026-02-30`,
14 "delimiter": ";",
15 "schema": {
16 "id": {
17 "type": "text",
18 "required": true,
19 "unique": true
20 },
21 "amount": {
22 "type": "decimal",
23 "decimal_separator": ",",
24 "group_separator": ".",
25 "unique": true
26 },
27 "date": {
28 "type": "date",
29 "format": "%Y-%m-%d"
30 }
31 },
32 "includePreview": true
33};
34
35
36const run = await client.actor("mick_mouse/my-actor-1").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46