1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "publications": [
10 "astralcodexten",
11 "https://www.lennysnewsletter.com",
12 ],
13 "maxPostsPerPublication": 20,
14 "includeBody": True,
15 "sort": "new",
16 "postTypes": [
17 "newsletter",
18 "podcast",
19 "thread",
20 "video",
21 ],
22 "searchQueries": [],
23 "maxResultsPerQuery": 20,
24 "search": "",
25 "since": "",
26 "includeComments": False,
27 "maxCommentsPerPost": 100,
28 "commentSort": "best_first",
29 "includeHtml": False,
30 "includePublicationInfo": True,
31 "maxConcurrency": 4,
32 "proxyConfiguration": { "useApifyProxy": True },
33}
34
35
36run = client.actor("insight.solutions/substack-scraper").call(run_input=run_input)
37
38
39print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
40for item in client.dataset(run.default_dataset_id).iterate_items():
41 print(item)
42
43