1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "posts",
10 "urls": ["https://www.astralcodexten.com"],
11 "keywords": [],
12 "authorHandles": [],
13 "leaderboardCategory": "Technology",
14 "leaderboardType": "paid",
15 "maxItems": 10,
16 "maxPostsPerNewsletter": 10,
17 "maxNewslettersPerKeyword": 10,
18 "includeContent": True,
19 "contentFormat": "markdown",
20 "includePublicationInfo": True,
21 "includeRecommendations": True,
22 "includeComments": False,
23 "maxCommentsPerPost": 50,
24 "includeNotes": False,
25 "contentType": "all",
26 "onlyFree": False,
27 "outputMode": "post",
28}
29
30
31run = client.actor("normdata/substack-scraper").call(run_input=run_input)
32
33
34print(f"πΎ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
35for item in client.dataset(run.default_dataset_id).iterate_items():
36 print(item)
37
38