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