1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "posts",
12 "urls": [
13 "https://www.astralcodexten.com"
14 ],
15 "keywords": [],
16 "authorHandles": [],
17 "leaderboardCategory": "Technology",
18 "leaderboardType": "paid",
19 "maxItems": 10,
20 "maxPostsPerNewsletter": 10,
21 "maxNewslettersPerKeyword": 10,
22 "includeContent": true,
23 "contentFormat": "markdown",
24 "includePublicationInfo": true,
25 "includeRecommendations": true,
26 "includeComments": false,
27 "maxCommentsPerPost": 50,
28 "includeNotes": false,
29 "contentType": "all",
30 "onlyFree": false,
31 "outputMode": "post"
32};
33
34
35const run = await client.actor("normdata/substack-scraper").call(input);
36
37
38console.log('Results from dataset');
39console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45