1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "rows": [
12 {
13 "name": "France",
14 "capital": "Paris",
15 "population": 68200000,
16 "area_km2": 551695,
17 "currency": {
18 "code": "EUR",
19 "name": "Euro"
20 },
21 "tags": [
22 "EU",
23 "G7"
24 ],
25 "checkedAt": "2026-11-20"
26 },
27 {
28 "name": "Japan",
29 "capital": "Tokyo",
30 "population": 123800000,
31 "area_km2": 377975,
32 "currency": {
33 "code": "JPY",
34 "name": "Yen"
35 },
36 "tags": [
37 "G7"
38 ],
39 "checkedAt": "2026-11-20"
40 },
41 {
42 "name": "Brazil",
43 "capital": "Brasilia",
44 "population": 216400000,
45 "area_km2": 8515767,
46 "currency": {
47 "code": "BRL",
48 "name": "Real"
49 },
50 "tags": [
51 "BRICS"
52 ],
53 "checkedAt": "2026-11-20"
54 },
55 {
56 "name": "Canada",
57 "capital": "Ottawa",
58 "population": 40100000,
59 "area_km2": 9984670,
60 "currency": {
61 "code": "CAD",
62 "name": "Canadian dollar"
63 },
64 "tags": [
65 "G7"
66 ],
67 "checkedAt": "2026-11-20"
68 },
69 {
70 "name": "Tunisia",
71 "capital": "Tunis",
72 "population": 12500000,
73 "area_km2": 163610,
74 "currency": {
75 "code": "TND",
76 "name": "Tunisian dinar"
77 },
78 "tags": [
79 "Africa"
80 ],
81 "checkedAt": "2026-11-20"
82 }
83 ],
84 "rowsCsv": "",
85 "fileName": "dataset",
86 "nestedFields": "flatten",
87 "rowsPerFile": 250000,
88 "maxRows": 1000000,
89 "s3Bucket": "",
90 "s3Region": "us-east-1",
91 "s3KeyPrefix": "",
92 "s3Endpoint": "",
93 "gcsBucket": "",
94 "gcsKeyPrefix": ""
95};
96
97
98const run = await client.actor("that_red_bird/dataset-to-parquet").call(input);
99
100
101console.log('Results from dataset');
102console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
103const { items } = await client.dataset(run.defaultDatasetId).listItems();
104items.forEach((item) => {
105 console.dir(item);
106});
107
108