1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "urls": [
12 "https://en.wikipedia.org/wiki/Markdown",
13 "https://docs.python.org/3/tutorial/introduction.html",
14 "https://www.propublica.org/article/3m-forever-chemicals-pfas-pfos-inside-story"
15 ],
16 "render": false,
17 "respectRobotsTxt": true,
18 "timeoutSecs": 30,
19 "userAgent": "Mozilla/5.0 (compatible; AgentFetchBot/1.0; +https://apify.com/omargnagy/agent-fetch-markdown)",
20 "includeLinks": true,
21 "includeArticleJson": false,
22 "maxMarkdownChars": 120000
23};
24
25
26const run = await client.actor("omargnagy/agent-fetch-markdown").call(input);
27
28
29console.log('Results from dataset');
30console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
31const { items } = await client.dataset(run.defaultDatasetId).listItems();
32items.forEach((item) => {
33 console.dir(item);
34});
35
36