1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "proxy": {
10 "ip": "http://proxy.example.com",
11 "port": "1080",
12 "username": "example_username",
13 "password": "example_password",
14 },
15 "origin": "https://www.reddit.com",
16 "referer": "https://www.reddit.com/",
17 "maxCount": 10,
18 "sort": "best",
19 "csrfToken": "example_csrfToken",
20 "userAgent": "Mozilla/5.0 ...",
21 "redditHost": "www.reddit.com",
22 "cookieHeader": "session=example",
23 "subRedditUrl": "https://www.reddit.com/r/codex/",
24 "acceptLanguage": "en-US,en;q=0.9",
25}
26
27
28run = client.actor("automationagents/reddit-subreddit-posts-export").call(run_input=run_input)
29
30
31print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
32for item in client.dataset(run["defaultDatasetId"]).iterate_items():
33 print(item)
34
35