1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "maxCount": 10,
10 "sort": "relevance",
11 "timeRange": "all",
12 "safeSearch": "off",
13 "restrictSubreddit": False,
14 "acceptLanguage": "en-US,en;q=0.9",
15 "redditHost": "www.reddit.com",
16 "referer": "https://www.reddit.com/",
17 "origin": "https://www.reddit.com",
18 "proxy": {
19 "ip": "http://portal.anyip.io",
20 "port": "1080",
21 "username": "",
22 "password": "",
23 },
24}
25
26
27run = client.actor("automationagents/reddit-posts-search-export").call(run_input=run_input)
28
29
30print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
31for item in client.dataset(run["defaultDatasetId"]).iterate_items():
32 print(item)
33
34