1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "files": [
12 {
13 "fileName": "example.html",
14 "text": "<h1>Quarterly Report</h1><p>Revenue grew in every region. 모든 지역에서 매출이 증가했습니다.</p><h2>Next steps</h2><ol><li>Expand to two new markets</li><li>Launch the mobile app<ol><li>Beta in Q1</li><li>Release in Q2</li></ol></li></ol><h2>Regional results</h2><table><tr><th rowspan=\"2\">Region</th><th colspan=\"2\">2026 revenue</th></tr><tr><th>H1</th><th>H2</th></tr><tr><td>Seoul</td><td>100</td><td>120</td></tr><tr><td>Busan</td><td>80</td><td>95</td></tr></table>"
15 }
16 ]
17};
18
19
20const run = await client.actor("aaron_lee/document-to-markdown-rag-chunks").call(input);
21
22
23console.log('Results from dataset');
24console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
25const { items } = await client.dataset(run.defaultDatasetId).listItems();
26items.forEach((item) => {
27 console.dir(item);
28});
29
30