1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "maxCount": 10,
12 "sort": "new",
13 "acceptLanguage": "en-US,en;q=0.9",
14 "redditHost": "www.reddit.com",
15 "referer": "https://www.reddit.com/",
16 "origin": "https://www.reddit.com",
17 "proxy": {
18 "ip": "http://portal.anyip.io",
19 "port": "1080",
20 "username": "",
21 "password": ""
22 }
23};
24
25
26const run = await client.actor("automationagents/reddit-subreddit-comments-export").call(input);
27
28
29console.log('Results from dataset');
30console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
31const { items } = await client.dataset(run.defaultDatasetId).listItems();
32items.forEach((item) => {
33 console.dir(item);
34});
35
36