1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "usernames": [
12 "spez"
13 ],
14 "includeProfileInfo": true,
15 "includeTrophies": false,
16 "includeModeratedSubreddits": false,
17 "sections": [
18 "posts"
19 ],
20 "maxPosts": 100,
21 "maxComments": 100,
22 "sort": "new",
23 "timeFilter": "all",
24 "includeNSFW": false,
25 "onlyWithFlair": false,
26 "onlyOriginalContent": false,
27 "excludeArchived": false,
28 "excludeStickied": false,
29 "excludeRemoved": false,
30 "excludeCrossposts": false,
31 "excludeSpoilers": false,
32 "excludeLocked": false,
33 "excludeDeletedAuthor": false
34};
35
36
37const run = await client.actor("crawlerbros/reddit-profile-crawler").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47