1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "documents": [
10 {
11 "id": "guide",
12 "sourceUrl": "https://example.com/guide",
13 "html": """<!doctype html><html lang=\"en\"><head><title>Knowledge guide</title></head><body><nav>Navigation</nav><main id=\"guide\"><h1>Knowledge guide</h1><h2 id=\"delivery\">Delivery</h2><p>Standard delivery takes three working days. Contact support when a delivery needs review.</p><h2 id=\"returns\">Returns</h2><p>Keep the order reference when requesting a return. Review the original source before publishing an answer.</p><pre>status = \"ready\"
14 preserve_indentation()</pre></main></body></html>""",
15 },
16 {
17 "id": "support",
18 "sourceUrl": "https://example.com/support",
19 "html": "<html lang=\"en\"><head><title>Support</title></head><body><main id=\"support\"><h1>Support</h1><p>Include the order reference and a description of the issue. This is supplied demonstration content, not a fetched support page.</p></main></body></html>",
20 },
21 ],
22 "chunkChars": 200,
23}
24
25
26run = client.actor("danielmichalek/website-to-rag-dataset").call(run_input=run_input)
27
28
29print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
30for item in client.dataset(run.default_dataset_id).iterate_items():
31 print(item)
32
33