1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "subreddits": ["python"],
10 "searchQuery": "machine learning",
11 "searchQueriesList": [],
12 "usernames": ["spez"],
13 "postUrls": ["https://www.reddit.com/r/Python/comments/1r19hu1/after_25_years_using_orms_i_switched_to_raw/"],
14 "proxyConfiguration": {
15 "useApifyProxy": True,
16 "apifyProxyGroups": ["RESIDENTIAL"],
17 },
18}
19
20
21run = client.actor("labrat011/reddit-scraper").call(run_input=run_input)
22
23
24print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
25for item in client.dataset(run.default_dataset_id).iterate_items():
26 print(item)
27
28