1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "html": `<!doctype html>
12<html lang="en"><head><title>Release notes 2.4 | Example Blog</title>
13<meta name="description" content="What changed in version 2.4: faster exports, a new CLI flag and two fixes.">
14<script>window.dataLayer=[];</script><style>body{font-family:sans-serif}</style></head>
15<body>
16<div id="cookie-banner" class="cookie-consent">We use cookies. <button>Accept all</button></div>
17<header class="site-header"><nav><a href="/">Home</a> <a href="/blog/">Blog</a> <a href="/pricing">Pricing</a></nav></header>
18<main>
19<article>
20<h1>Release notes 2.4</h1>
21<p>Version 2.4 makes <strong>exports about 3x faster</strong> and adds a <code>--dry-run</code> flag.
22Read the <a href="../docs/export">export guide</a> or the <a href="changelog#v2-4">full changelog</a>.</p>
23<h2>What changed</h2>
24<ul><li>Faster CSV and JSON exports</li><li>New <code>--dry-run</code> flag<ul><li>prints the plan only</li></ul></li>
25<li>Two bug fixes</li></ul>
26<h2>Benchmarks</h2>
27<table><tr><th>Rows</th><th>2.3</th><th>2.4</th></tr><tr><td>10,000</td><td>4.1 s</td><td>1.3 s</td></tr>
28<tr><td>100,000</td><td>39 s</td><td>12 s</td></tr></table>
29<h2>Try it</h2>
30<pre><code class="language-bash">pip install example-cli==2.4
31example export --format csv --dry-run</code></pre>
32<blockquote>Tip: the old flags still work.</blockquote>
33<img src="/img/chart.png" alt="Export speed chart">
34</article>
35<aside class="sidebar"><h3>Related posts</h3><a href="/blog/2-3">Release notes 2.3</a></aside>
36</main>
37<footer><p>© 2026 Example Inc. <a href="/privacy">Privacy</a></p></footer>
38</body></html>`,
39 "baseUrl": "https://example.com/blog/"
40};
41
42
43const run = await client.actor("gazidev/html-to-markdown-converter").call(input);
44
45
46console.log('Results from dataset');
47console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
48const { items } = await client.dataset(run.defaultDatasetId).listItems();
49items.forEach((item) => {
50 console.dir(item);
51});
52
53