1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "dataSource": "csvUrl",
12 "sourceUrl": "https://drive.google.com/uc?id=1x2IdSNcHGLmot9i1h90gwMJr5lULC2QV&export=download",
13 "rawJson": "[{\"name\":\"Alice\",\"age\":30,\"city\":\"NYC\"},{\"name\":\"Bob\",\"age\":25,\"city\":\"LA\"},{\"name\":\"Carol\",\"age\":35,\"city\":\"Chicago\"}]",
14 "reportTitle": "Data Profiling Report",
15 "sampleRows": 0,
16 "correlationThreshold": 0.8,
17 "missingThreshold": 10,
18 "outputFormat": "html",
19 "includeHistograms": true,
20 "includeCorrelationMatrix": true,
21 "detectOutliers": true,
22 "outlierIqrMultiplier": 1.5,
23 "cardinalityThreshold": 50,
24 "csvDelimiter": ",",
25 "csvEncoding": "utf-8",
26 "proxyConfiguration": {
27 "useApifyProxy": false
28 },
29 "requestTimeoutSecs": 60
30};
31
32
33const run = await client.actor("moving_beacon-owner1/my-actor-74").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43