1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "flow": "import",
12 "ncms": [
13 "10019900",
14 "27090010"
15 ],
16 "periodoDe": "2025-01",
17 "periodoAte": "2025-01",
18 "paises": [],
19 "ufs": [],
20 "detalhar": "pais",
21 "metricas": [
22 "metricFOB",
23 "metricKG",
24 "metricStatistic",
25 "metricFreight",
26 "metricInsurance",
27 "metricCIF"
28 ],
29 "incremental": false,
30 "maxItems": 1000,
31 "timeoutSecs": 30
32};
33
34
35const run = await client.actor("kman-br/importacao-ncm").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45