1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://crawlee.dev/docs/introduction"
14 }
15 ],
16 "maxPages": 100,
17 "maxDepth": 0,
18 "outputFormats": [
19 "markdown"
20 ],
21 "chunkSize": 1000,
22 "chunkOverlap": 200,
23 "chunkStrategy": "semantic",
24 "waitForTimeout": 5000,
25 "maxScrolls": 20,
26 "paginationMaxPages": 10,
27 "minContentLength": 50,
28 "proxyConfiguration": {
29 "useApifyProxy": true
30 },
31 "maxRetries": 3,
32 "requestTimeout": 30000
33};
34
35
36const run = await client.actor("junipr/rag-web-extractor").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46